Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hb_1.1.h
Go to the documentation of this file.
1 #ifndef CONFIG_HB_V1_1_H
2 #define CONFIG_HB_V1_1_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 /* led 1 and led 2 are not seperate leds, but leds indicating the power switch status */
22 
23 #ifndef USE_LED_1
24 #define USE_LED_1 1
25 #endif
26 #define LED_1_BANK 1
27 #define LED_1_PIN 18
28 
29 #ifndef USE_LED_2
30 #define USE_LED_2 1
31 #endif
32 #define LED_2_BANK 1
33 #define LED_2_PIN 19
34 
35 #define POWER_SWITCH_LED 1
36 #define POWER_SWITCH_2_LED 2
37 
38 /* there are no actual leds 3 and 4, these defines are just to conveniently switch the buzzer and the cam switch */
39 #ifndef USE_LED_3
40 #define USE_LED_3 1
41 #endif
42 #define LED_3_BANK 1
43 #define LED_3_PIN 20
44 
45 #ifndef USE_LED_4
46 #define USE_LED_4 1
47 #endif
48 #define LED_4_BANK 1
49 #define LED_4_PIN 25
50 
51 #define BUZZER_LED 3
52 #define CAM_SWITCH_LED 4
53 
54 /* P0.22 aka MAT0.0 */
55 #define SERVO_CLOCK_PIN 22
56 #define SERVO_CLOCK_PINSEL PINSEL1
57 #define SERVO_CLOCK_PINSEL_VAL 0x03
58 #define SERVO_CLOCK_PINSEL_BIT 12
59 /* p1.24 */
60 #define SERVO_RESET_PIN 24
61 
62 /* PPM : rc rx on P0.16 ( CAP0.2 ) */
63 #define PPM_PINSEL PINSEL1
64 #define PPM_PINSEL_VAL 0x03
65 #define PPM_PINSEL_BIT 0
66 #define PPM_CRI TIR_CR2I
67 #define PPM_CCR_CRF TCCR_CR2_F
68 #define PPM_CCR_CRR TCCR_CR2_R
69 #define PPM_CCR_CRI TCCR_CR2_I
70 #define PPM_CR T0CR2
71 
72 
73 /* ADC */
74 
75 /* IR3 */
76 #define ADC_0 AdcBank0(3)
77 #ifdef USE_ADC_0
78 #ifndef USE_AD0
79 #define USE_AD0
80 #endif
81 #define USE_AD0_3
82 #endif
83 
84 /* IR2 */
85 #define ADC_1 AdcBank0(2)
86 #ifdef USE_ADC_1
87 #ifndef USE_AD0
88 #define USE_AD0
89 #endif
90 #define USE_AD0_2
91 #endif
92 
93 /* IR1 */
94 #define ADC_2 AdcBank0(1)
95 #ifdef USE_ADC_2
96 #ifndef USE_AD0
97 #define USE_AD0
98 #endif
99 #define USE_AD0_1
100 #endif
101 
102 
103 /* ADC2 on ANALOG connector */
104 #define ADC_3 AdcBank1(2)
105 #ifdef USE_ADC_3
106 #ifndef USE_AD1
107 #define USE_AD1
108 #endif
109 #define USE_AD1_2
110 #endif
111 
112 /* ADC3 on ANALOG connector */
113 #define ADC_4 AdcBank1(3)
114 #ifdef USE_ADC_4
115 #ifndef USE_AD1
116 #define USE_AD1
117 #endif
118 #define USE_AD1_3
119 #endif
120 
121 /* ADC4 on ANALOG connector */
122 #define ADC_5 AdcBank1(4)
123 #ifdef USE_ADC_5
124 #ifndef USE_AD1
125 #define USE_AD1
126 #endif
127 #define USE_AD1_4
128 #endif
129 
130 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
131 #ifndef ADC_CHANNEL_VSUPPLY
132 #define ADC_CHANNEL_VSUPPLY AdcBank1(6)
133 #ifndef USE_AD1
134 #define USE_AD1
135 #endif
136 #define USE_AD1_6
137 #endif
138 
139 
140 #define DefaultVoltageOfAdc(adc) (0.032362123*adc)
141 
142 
143 #endif /* CONFIG_HB_V1_1_H */