Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
hbmini_1.0.h
Go to the documentation of this file.
1 #ifndef CONFIG_HBMINI_V1_0_H
2 #define CONFIG_HBMINI_V1_0_H
3 
4 /* Master oscillator freq. */
5 #define FOSC (12000000)
6 
7 /* PLL multiplier */
8 #define PLL_MUL (5)
9 
10 /* CPU clock freq. */
11 #define CCLK (FOSC * PLL_MUL)
12 
13 /* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */
14 #define PBSD_BITS 0x02
15 #define PBSD_VAL 2
16 
17 /* Peripheral bus clock freq. */
18 #define PCLK (CCLK / PBSD_VAL)
19 
20 /* Onboard LEDs */
21 #ifndef USE_LED_1
22 #define USE_LED_1 1
23 #endif
24 #define LED_1_BANK 0
25 #define LED_1_PIN 22
26 
27 #ifndef USE_LED_2
28 #define USE_LED_2 1
29 #endif
30 #define LED_2_BANK 1
31 #define LED_2_PIN 28
32 
33 #ifndef USE_LED_3
34 #define USE_LED_3 1
35 #endif
36 #define LED_3_BANK 1
37 #define LED_3_PIN 29
38 
39 #ifndef USE_LED_4
40 #define USE_LED_4 1
41 #endif
42 #define LED_4_BANK 1
43 #define LED_4_PIN 30
44 
45 /* PPM : rc rx on P0.28 ( CAP0.2 ) */
46 #define PPM_PINSEL PINSEL0
47 #define PPM_PINSEL_VAL 0x02
48 #define PPM_PINSEL_BIT 12
49 #define PPM_CRI TIR_CR2I
50 #define PPM_CCR_CRF TCCR_CR2_F
51 #define PPM_CCR_CRR TCCR_CR2_R
52 #define PPM_CCR_CRI TCCR_CR2_I
53 #define PPM_CR T0CR2
54 
55 /* ADC */
56 
57 /* not compatible with PWM1 */
58 #define ADC_0 AdcBank1(6)
59 #if USE_ADC_0
60 #ifndef USE_AD1
61 #define USE_AD1
62 #endif
63 #define USE_AD1_6
64 #endif
65 
66 /* battery */
67 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
68 #ifndef ADC_CHANNEL_VSUPPLY
69 #define ADC_CHANNEL_VSUPPLY AdcBank1(6)
70 #ifndef USE_AD1
71 #define USE_AD1
72 #endif
73 #define USE_AD1_6
74 #endif
75 
76 #define DefaultVoltageOfAdc(adc) (0.03385*adc)
77 
78 /* SPI (SSP) */
79 #define SPI_SELECT_SLAVE0_PORT 0
80 #define SPI_SELECT_SLAVE0_PIN 20
81 #define SPI_SELECT_SLAVE0_PINSEL PINSEL1
82 #define SPI_SELECT_SLAVE0_PINSEL_BIT 8
83 #define SPI_SELECT_SLAVE0_PINSEL_VAL 0
84 
85 //#define SPI_SELECT_SLAVE1_PORT 1
86 //#define SPI_SELECT_SLAVE1_PIN 19
87 
88 #define SPI1_DRDY_PINSEL PINSEL1
89 #define SPI1_DRDY_PINSEL_BIT 0
90 #define SPI1_DRDY_PINSEL_VAL 1
91 #define SPI1_DRDY_EINT 0
92 #define SPI1_DRDY_VIC_IT VIC_EINT0
93 
94 
95 /* MAX1168 EOC pin (booz2 imu) */
96 #define MAX1168_EOC_PIN 16
97 #define MAX1168_EOC_PINSEL PINSEL1
98 #define MAX1168_EOC_PINSEL_BIT 0
99 #define MAX1168_EOC_PINSEL_VAL 1
100 #define MAX1168_EOC_EINT 0
101 #define MAX1168_EOC_VIC_IT VIC_EINT0
102 
103 /* Servo definition for actruators_pwm driver */
104 
105 /* HBMINI PWM0 = PWM_SERVO_2 (driver) = PWM2 (lpc) */
106 #if USE_PWM0
107 #define PWM_SERVO_2 1
108 #define SERVO_REG_0 PWMMR2
109 #endif
110 
111 /* HBMINI PWM1 = PWM_SERVO_5 (driver) = PWM5 (lpc) */
112 #if USE_PWM1
113 #define PWM_SERVO_5 1
114 #define SERVO_REG_1 PWMMR5
115 #endif
116 
117 
118 /* by default activate onboard baro */
119 #ifndef USE_BARO_BOARD
120 #define USE_BARO_BOARD 1
121 #endif
122 
123 #endif /* CONFIG_HBMINI_V1_0_H */