Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules 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 /* power switch status */
21 #define POWER_SWITCH_GPIO GPIOB,GPIO18
22 #define POWER_SWITCH_2_GPIO GPIOB,GPIO19
23 
24 /* buzzer and cam switch */
25 #define BUZZER_GPIO GPIOB,GPIO20
26 #define CAM_SWITCH_GPIO GPIOB,GPIO25
27 
28 /* P0.22 aka MAT0.0 */
29 #define SERVO_CLOCK_PIN 22
30 #define SERVO_CLOCK_PINSEL PINSEL1
31 #define SERVO_CLOCK_PINSEL_VAL 0x03
32 #define SERVO_CLOCK_PINSEL_BIT 12
33 /* p1.24 */
34 #define SERVO_RESET_PIN 24
35 
36 /* PPM : rc rx on P0.16 ( CAP0.2 ) */
37 #define PPM_PINSEL PINSEL1
38 #define PPM_PINSEL_VAL 0x03
39 #define PPM_PINSEL_BIT 0
40 #define PPM_CRI TIR_CR2I
41 #define PPM_CCR_CRF TCCR_CR2_F
42 #define PPM_CCR_CRR TCCR_CR2_R
43 #define PPM_CCR_CRI TCCR_CR2_I
44 #define PPM_CR T0CR2
45 
46 
47 /* ADC */
48 
49 /* IR3 */
50 #define ADC_0 AdcBank0(3)
51 #if USE_ADC_0
52 #ifndef USE_AD0
53 #define USE_AD0
54 #endif
55 #define USE_AD0_3
56 #endif
57 
58 /* IR2 */
59 #define ADC_1 AdcBank0(2)
60 #if USE_ADC_1
61 #ifndef USE_AD0
62 #define USE_AD0
63 #endif
64 #define USE_AD0_2
65 #endif
66 
67 /* IR1 */
68 #define ADC_2 AdcBank0(1)
69 #if USE_ADC_2
70 #ifndef USE_AD0
71 #define USE_AD0
72 #endif
73 #define USE_AD0_1
74 #endif
75 
76 
77 /* ADC2 on ANALOG connector */
78 #define ADC_3 AdcBank1(2)
79 #if USE_ADC_3
80 #ifndef USE_AD1
81 #define USE_AD1
82 #endif
83 #define USE_AD1_2
84 #endif
85 
86 /* ADC3 on ANALOG connector */
87 #define ADC_4 AdcBank1(3)
88 #if USE_ADC_4
89 #ifndef USE_AD1
90 #define USE_AD1
91 #endif
92 #define USE_AD1_3
93 #endif
94 
95 /* ADC4 on ANALOG connector */
96 #define ADC_5 AdcBank1(4)
97 #if USE_ADC_5
98 #ifndef USE_AD1
99 #define USE_AD1
100 #endif
101 #define USE_AD1_4
102 #endif
103 
104 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
105 #ifndef ADC_CHANNEL_VSUPPLY
106 #define ADC_CHANNEL_VSUPPLY AdcBank1(6)
107 #ifndef USE_AD1
108 #define USE_AD1
109 #endif
110 #define USE_AD1_6
111 #endif
112 
113 
114 #define DefaultVoltageOfAdc(adc) (0.032362123*adc)
115 
116 
117 #endif /* CONFIG_HB_V1_1_H */