Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
logom_2.6.h
Go to the documentation of this file.
1 /* board definition file for Sparkfun Logomatic V2.6 data logger */
2 
3 #ifndef CONFIG_LOGOMATIC_H
4 #define CONFIG_LOGOMATIC_H
5 
6 #ifdef SITL
7 /* Dummy definitions: adc are unused anyway */
8 #define AdcBank0(x) (x)
9 #define AdcBank1(x) (x)
10 #endif /* SITL */
11 
12 /* Master oscillator freq. */
13 #define FOSC (12000000)
14 
15 /* PLL multiplier */
16 #define PLL_MUL (5)
17 
18 /* CPU clock freq. */
19 #define CCLK (FOSC * PLL_MUL)
20 
21 /* PCLK needs to run @ 30MHz for USB */
22 #define USE_USB_HIGH_PCLK
23 
24 #ifdef USE_USB_HIGH_PCLK
25 /* Peripheral bus speed mask 0x00-> 4, 0x01-> 1, 0x02-> 2 */
26 /* change both PBSD_BITS/VAL 15MHz, 60MHz, 30MHz */
27 #define PBSD_BITS 0x02
28 #define PBSD_VAL 2
29 #else
30 /* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */
31 #define PBSD_BITS 0x00
32 #define PBSD_VAL 4
33 #endif
34 
35 /* Peripheral bus clock freq. */
36 #define PCLK (CCLK / PBSD_VAL)
37 
38 #ifndef USE_LED_1
39 #define USE_LED_1 1
40 #endif
41 #define LED_1_BANK 1
42 #define LED_1_PIN 16
43 
44 #ifndef USE_LED_2
45 #define USE_LED_2 1
46 #endif
47 #define LED_2_BANK 0
48 #define LED_2_PIN 2
49 
50 #ifndef USE_LED_3
51 #define USE_LED_3 1
52 #endif
53 #define LED_3_BANK 0
54 #define LED_3_PIN 11
55 
56 #ifndef USE_LED_4
57 #define USE_LED_4 1
58 #endif
59 #define LED_4_BANK 1
60 #define LED_4_PIN 17
61 
62 #define POWER_SWITCH_LED 4
63 
64 #ifndef USE_LED_5
65 #define USE_LED_5 1
66 #endif
67 #define LED_5_BANK 1
68 #define LED_5_PIN 18
69 
70 #define CAM_SWITCH_LED 5
71 
72 #ifndef USE_LED_6
73 #define USE_LED_6 1
74 #endif
75 #define LED_6_BANK 1
76 #define LED_6_PIN 19
77 
78 #define GPS_RESET 6
79 
80 #define Configure_GPS_RESET_Pin() LED_INIT(GPS_RESET)
81 #define Set_GPS_RESET_Pin_LOW() LED_ON(GPS_RESET)
82 #define Open_GPS_RESET_Pin() ClearBit(LED_DIR(GPS_RESET), LED_PIN(GPS_RESET))
83 
84 /* P0.29 aka MAT0.3 (P2) */
85 #define SERVO_CLOCK_PIN 29
86 #define SERVO_CLOCK_PINSEL PINSEL0
87 #define SERVO_CLOCK_PINSEL_VAL 0x02
88 #define SERVO_CLOCK_PINSEL_BIT 10
89 /* p1.20 */
90 #define SERVO_RESET_PIN 20
91 
92 /* PPM : rc rx on P0.6 aka CAP0.0 (P1) */
93 #define PPM_PINSEL PINSEL0
94 #define PPM_PINSEL_VAL 0x02
95 #define PPM_PINSEL_BIT 12
96 #define PPM_CRI TIR_CR2I
97 #define PPM_CCR_CRF TCCR_CR2_F
98 #define PPM_CCR_CRR TCCR_CR2_R
99 #define PPM_CCR_CRI TCCR_CR2_I
100 #define PPM_CR T0CR2
101 
102 /* ADC */
103 
104 #define ADC_0 AdcBank0(3)
105 #ifdef USE_ADC_0
106 #ifndef USE_AD0
107 #define USE_AD0
108 #endif
109 #define USE_AD0_3
110 #endif
111 
112 #define ADC_1 AdcBank0(2)
113 #ifdef USE_ADC_1
114 #ifndef USE_AD0
115 #define USE_AD0
116 #endif
117 #define USE_AD0_2
118 #endif
119 
120 
121 #define ADC_2 AdcBank0(1)
122 #ifdef USE_ADC_2
123 #ifndef USE_AD0
124 #define USE_AD0
125 #endif
126 #define USE_AD0_1
127 #endif
128 
129 #define ADC_3 AdcBank0(4)
130 #ifdef USE_ADC_3
131 #ifndef USE_AD0
132 #define USE_AD0
133 #endif
134 #define USE_AD0_4
135 #endif
136 
137 #define ADC_4 AdcBank1(7)
138 #ifdef USE_ADC_4
139 #ifndef USE_AD1
140 #define USE_AD1
141 #endif
142 #define USE_AD1_7
143 #endif
144 
145 #define ADC_5 AdcBank1(6)
146 #ifdef USE_ADC_5
147 #ifndef USE_AD1
148 #define USE_AD1
149 #endif
150 #define USE_AD1_6
151 #endif
152 
153 #define ADC_6 AdcBank1(2)
154 #ifdef USE_ADC_6
155 #ifndef USE_AD1
156 #define USE_AD1
157 #endif
158 #define USE_AD1_2
159 #endif
160 
161 #define ADC_7 AdcBank1(2)
162 #ifdef USE_ADC_7
163 #ifndef USE_AD1
164 #define USE_AD1
165 #endif
166 #define USE_AD1_2
167 #endif
168 
169 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
170 #ifndef ADC_CHANNEL_VSUPPLY
171 #define ADC_CHANNEL_VSUPPLY AdcBank1(4)
172 #ifndef USE_AD1
173 #define USE_AD1
174 #endif
175 #define USE_AD1_4
176 #endif
177 
178 
179 #define DefaultVoltageOfAdc(adc) (0.068505859375*adc)
180 
181 #define SPI_SELECT_SLAVE0_PORT 0
182 #define SPI_SELECT_SLAVE0_PIN 20
183 
184 #define SPI1_DRDY_PINSEL PINSEL1
185 #define SPI1_DRDY_PINSEL_BIT 0
186 #define SPI1_DRDY_PINSEL_VAL 1
187 #define SPI1_DRDY_EINT 0
188 #define SPI1_DRDY_VIC_IT VIC_EINT0
189 
190 /* micro SD connected to SPI0 */
191 #define SPI_CHANNEL 0
192 
193 /* STOP button P0.3 */
194 #define LOG_STOP_KEY 3
195 
196 #endif /* CONFIG_LOGOMATIC_H */
197