Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces 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 #define POWER_SWITCH_GPIO GPIOB,GPIO17
57 
58 #define CAM_SWITCH_GPIO GPIOB,GPIO18
59 
60 #define GPS_RESET_GPIO GPIOB,GPIO19
61 
62 #define Configure_GPS_RESET_Pin() gpio_setup_output(GPS_RESET_GPIO)
63 #define Set_GPS_RESET_Pin_LOW() gpio_clear(GPS_RESET_GPIO)
64 #define Open_GPS_RESET_Pin() gpio_setup_input(GPS_RESET_GPIO)
65 
66 /* P0.29 aka MAT0.3 (P2) */
67 #define SERVO_CLOCK_PIN 29
68 #define SERVO_CLOCK_PINSEL PINSEL0
69 #define SERVO_CLOCK_PINSEL_VAL 0x02
70 #define SERVO_CLOCK_PINSEL_BIT 10
71 /* p1.20 */
72 #define SERVO_RESET_PIN 20
73 
74 /* PPM : rc rx on P0.6 aka CAP0.0 (P1) */
75 #define PPM_PINSEL PINSEL0
76 #define PPM_PINSEL_VAL 0x02
77 #define PPM_PINSEL_BIT 12
78 #define PPM_CRI TIR_CR2I
79 #define PPM_CCR_CRF TCCR_CR2_F
80 #define PPM_CCR_CRR TCCR_CR2_R
81 #define PPM_CCR_CRI TCCR_CR2_I
82 #define PPM_CR T0CR2
83 
84 /* ADC */
85 
86 #define ADC_0 AdcBank0(3)
87 #if USE_ADC_0
88 #ifndef USE_AD0
89 #define USE_AD0
90 #endif
91 #define USE_AD0_3
92 #endif
93 
94 #define ADC_1 AdcBank0(2)
95 #if USE_ADC_1
96 #ifndef USE_AD0
97 #define USE_AD0
98 #endif
99 #define USE_AD0_2
100 #endif
101 
102 
103 #define ADC_2 AdcBank0(1)
104 #if USE_ADC_2
105 #ifndef USE_AD0
106 #define USE_AD0
107 #endif
108 #define USE_AD0_1
109 #endif
110 
111 #define ADC_3 AdcBank0(4)
112 #if USE_ADC_3
113 #ifndef USE_AD0
114 #define USE_AD0
115 #endif
116 #define USE_AD0_4
117 #endif
118 
119 #define ADC_4 AdcBank1(7)
120 #if USE_ADC_4
121 #ifndef USE_AD1
122 #define USE_AD1
123 #endif
124 #define USE_AD1_7
125 #endif
126 
127 #define ADC_5 AdcBank1(6)
128 #if USE_ADC_5
129 #ifndef USE_AD1
130 #define USE_AD1
131 #endif
132 #define USE_AD1_6
133 #endif
134 
135 #define ADC_6 AdcBank1(2)
136 #if USE_ADC_6
137 #ifndef USE_AD1
138 #define USE_AD1
139 #endif
140 #define USE_AD1_2
141 #endif
142 
143 #define ADC_7 AdcBank1(2)
144 #if USE_ADC_7
145 #ifndef USE_AD1
146 #define USE_AD1
147 #endif
148 #define USE_AD1_2
149 #endif
150 
151 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
152 #ifndef ADC_CHANNEL_VSUPPLY
153 #define ADC_CHANNEL_VSUPPLY AdcBank1(4)
154 #ifndef USE_AD1
155 #define USE_AD1
156 #endif
157 #define USE_AD1_4
158 #endif
159 
160 
161 #define DefaultVoltageOfAdc(adc) (0.068505859375*adc)
162 
163 #define SPI_SELECT_SLAVE0_PORT 0
164 #define SPI_SELECT_SLAVE0_PIN 20
165 
166 #define SPI1_DRDY_PINSEL PINSEL1
167 #define SPI1_DRDY_PINSEL_BIT 0
168 #define SPI1_DRDY_PINSEL_VAL 1
169 #define SPI1_DRDY_EINT 0
170 #define SPI1_DRDY_VIC_IT VIC_EINT0
171 
172 /* micro SD connected to SPI0 */
173 #define SPI_CHANNEL 0
174 
175 /* STOP button P0.3 */
176 #define LOG_STOP_KEY 3
177 
178 #endif /* CONFIG_LOGOMATIC_H */
179