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
lisa_l_1.0.h
Go to the documentation of this file.
1 #ifndef CONFIG_LISA_L_1_0_H
2 #define CONFIG_LISA_L_1_0_H
3 
4 #define BOARD_LISA_L
5 
6 /* Lisa/L has an 8MHZ external clock and 72MHz internal. */
7 #define EXT_CLK 8000000
8 #define AHB_CLK 72000000
9 
10 /* Onboard LEDs */
11 #ifndef USE_LED_1
12 #define USE_LED_1 1
13 #endif
14 #define LED_STP08
15 
16 // FIXME, this is just to make it compile
17 #define POWER_SWITCH_LED 5
18 
19 /* SPI slave mapping */
20 
21 #define SPI_SELECT_SLAVE0_PERIPH RCC_APB2ENR_IOPAEN
22 #define SPI_SELECT_SLAVE0_PORT GPIOA
23 #define SPI_SELECT_SLAVE0_PIN GPIO15
24 
25 #define SPI_SELECT_SLAVE1_PERIPH RCC_APB2ENR_IOPAEN
26 #define SPI_SELECT_SLAVE1_PORT GPIOA
27 #define SPI_SELECT_SLAVE1_PIN GPIO4
28 
29 #define SPI_SELECT_SLAVE2_PERIPH RCC_APB2ENR_IOPBEN
30 #define SPI_SELECT_SLAVE2_PORT GPIOB
31 #define SPI_SELECT_SLAVE2_PIN GPIO12
32 
33 #define SPI_SELECT_SLAVE3_PERIPH RCC_APB2ENR_IOPCEN
34 #define SPI_SELECT_SLAVE3_PORT GPIOC
35 #define SPI_SELECT_SLAVE3_PIN GPIO13
36 
37 #define SPI_SELECT_SLAVE4_PERIPH RCC_APB2ENR_IOPCEN
38 #define SPI_SELECT_SLAVE4_PORT GPIOC
39 #define SPI_SELECT_SLAVE4_PIN GPIO12
40 
41 
42 /*
43  * I2C
44  *
45  */
46 #define I2C1_GPIO_PORT GPIOB
47 #define I2C1_GPIO_SCL GPIO6
48 #define I2C1_GPIO_SDA GPIO7
49 
50 #define I2C2_GPIO_PORT GPIOB
51 #define I2C2_GPIO_SCL GPIO10
52 #define I2C2_GPIO_SDA GPIO11
53 
54 
55 /*
56  * UART pin configuration
57  *
58  * sets on which pins the UARTs are connected
59  */
60 #define UART1_GPIO_AF 0
61 #define UART1_GPIO_PORT_RX GPIO_BANK_USART1_RX
62 #define UART1_GPIO_RX GPIO_USART1_RX
63 #define UART1_GPIO_PORT_TX GPIO_BANK_USART1_TX
64 #define UART1_GPIO_TX GPIO_USART1_TX
65 
66 #define UART2_GPIO_AF 0
67 #define UART2_GPIO_PORT_RX GPIO_BANK_USART2_RX
68 #define UART2_GPIO_RX GPIO_USART2_RX
69 #define UART2_GPIO_PORT_TX GPIO_BANK_USART2_TX
70 #define UART2_GPIO_TX GPIO_USART2_TX
71 
72 #define UART3_GPIO_AF AFIO_MAPR_USART3_REMAP_PARTIAL_REMAP
73 #define UART3_GPIO_PORT_RX GPIO_BANK_USART3_PR_RX
74 #define UART3_GPIO_RX GPIO_USART3_PR_RX
75 #define UART3_GPIO_PORT_TX GPIO_BANK_USART3_PR_TX
76 #define UART3_GPIO_TX GPIO_USART3_PR_TX
77 
78 #define UART5_GPIO_AF 0
79 #define UART5_GPIO_PORT_RX GPIO_BANK_UART5_RX
80 #define UART5_GPIO_RX GPIO_UART5_RX
81 #define UART5_GPIO_PORT_TX GPIO_BANK_UART5_TX
82 #define UART5_GPIO_TX GPIO_UART5_TX
83 
84 
85 /*
86  * Spektrum
87  */
88 /* The line that is pulled low at power up to initiate the bind process */
89 #define SPEKTRUM_BIND_PIN GPIO3
90 #define SPEKTRUM_BIND_PIN_PORT GPIOC
91 
92 #define SPEKTRUM_UART1_RCC_REG &RCC_APB2ENR
93 #define SPEKTRUM_UART1_RCC_DEV RCC_APB2ENR_USART1EN
94 #define SPEKTRUM_UART1_BANK GPIO_BANK_USART1_RX
95 #define SPEKTRUM_UART1_PIN GPIO_USART1_RX
96 #define SPEKTRUM_UART1_AF 0
97 #define SPEKTRUM_UART1_IRQ NVIC_USART1_IRQ
98 #define SPEKTRUM_UART1_ISR usart1_isr
99 #define SPEKTRUM_UART1_DEV USART1
100 
101 #define SPEKTRUM_UART3_RCC_REG &RCC_APB1ENR
102 #define SPEKTRUM_UART3_RCC_DEV RCC_APB1ENR_USART3EN
103 #define SPEKTRUM_UART3_BANK GPIO_BANK_USART3_PR_RX
104 #define SPEKTRUM_UART3_PIN GPIO_USART3_PR_RX
105 #define SPEKTRUM_UART3_AF AFIO_MAPR_USART3_REMAP_PARTIAL_REMAP
106 #define SPEKTRUM_UART3_IRQ NVIC_USART3_IRQ
107 #define SPEKTRUM_UART3_ISR usart3_isr
108 #define SPEKTRUM_UART3_DEV USART3
109 
110 #define SPEKTRUM_UART5_RCC_REG &RCC_APB1ENR
111 #define SPEKTRUM_UART5_RCC_DEV RCC_APB1ENR_UART5EN
112 #define SPEKTRUM_UART5_BANK GPIO_BANK_UART5_RX
113 #define SPEKTRUM_UART5_PIN GPIO_UART5_RX
114 #define SPEKTRUM_UART5_AF 0
115 #define SPEKTRUM_UART5_IRQ NVIC_UART5_IRQ
116 #define SPEKTRUM_UART5_ISR uart5_isr
117 #define SPEKTRUM_UART5_DEV UART5
118 
119 
120 /*
121  * PPM input
122  */
123 #define USE_PPM_TIM2 1
124 #define PPM_CHANNEL TIM_IC2
125 #define PPM_TIMER_INPUT TIM_IC_IN_TI2
126 #define PPM_IRQ NVIC_TIM2_IRQ
127 // Capture/Compare InteruptEnable and InterruptFlag
128 #define PPM_CC_IE TIM_DIER_CC2IE
129 #define PPM_CC_IF TIM_SR_CC2IF
130 #define PPM_GPIO_PORT GPIOA
131 #define PPM_GPIO_PIN GPIO1
132 #define PPM_GPIO_AF 0
133 
134 
135 /* ADC */
136 // active ADC
137 #define USE_AD1 1
138 #define USE_AD1_1 1
139 #define USE_AD1_2 1
140 #define USE_AD1_3 1
141 #define USE_AD1_4 1
142 
143 #define USE_AD_TIM1 1
144 
145 /* PA0 - ADC0 */
146 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
147 #ifndef ADC_CHANNEL_VSUPPLY
148 #define ADC_CHANNEL_VSUPPLY 2
149 #endif
150 #define DefaultVoltageOfAdc(adc) (0.0059*adc)
151 /* Onboard ADCs */
152 #define BOARD_ADC_CHANNEL_1 8
153 #define BOARD_ADC_CHANNEL_2 9
154 // FIXME - removed for now and used for battery monitoring
155 //#define BOARD_ADC_CHANNEL_3 13
156 #define BOARD_ADC_CHANNEL_3 0
157 #define BOARD_ADC_CHANNEL_4 15
158 
159 #define BOARD_HAS_BARO 1
160 
161 
162 /* Default actuators driver */
163 #define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
164 #define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
165 #define ActuatorsDefaultInit() ActuatorsPwmInit()
166 #define ActuatorsDefaultCommit() ActuatorsPwmCommit()
167 
168 /*
169  * PWM
170  *
171  */
172 #define PWM_USE_TIM3 1
173 #define PWM_USE_TIM4 1
174 
175 #define USE_PWM1 1
176 #define USE_PWM2 1
177 #define USE_PWM3 1
178 #define USE_PWM4 1
179 #define USE_PWM5 1
180 #define USE_PWM6 1
181 
182 #define ACTUATORS_PWM_NB 6
183 
184 // PWM_SERVO_x is the index of the servo in the actuators_pwm_values array
185 #if USE_PWM1
186 #define PWM_SERVO_1 0
187 #define PWM_SERVO_1_TIMER TIM3
188 #define PWM_SERVO_1_RCC_IOP RCC_APB2ENR_IOPCEN
189 #define PWM_SERVO_1_GPIO GPIOC
190 #define PWM_SERVO_1_PIN GPIO6
191 #define PWM_SERVO_1_AF 0
192 #define PWM_SERVO_1_OC TIM_OC1
193 #define PWM_SERVO_1_OC_BIT (1<<0)
194 #else
195 #define PWM_SERVO_1_OC_BIT 0
196 #endif
197 
198 #if USE_PWM2
199 #define PWM_SERVO_2 1
200 #define PWM_SERVO_2_TIMER TIM3
201 #define PWM_SERVO_2_RCC_IOP RCC_APB2ENR_IOPCEN
202 #define PWM_SERVO_2_GPIO GPIOC
203 #define PWM_SERVO_2_PIN GPIO7
204 #define PWM_SERVO_2_AF 0
205 #define PWM_SERVO_2_OC TIM_OC2
206 #define PWM_SERVO_2_OC_BIT (1<<1)
207 #else
208 #define PWM_SERVO_2_OC_BIT 0
209 #endif
210 
211 #if USE_PWM3
212 #define PWM_SERVO_3 2
213 #define PWM_SERVO_3_TIMER TIM3
214 #define PWM_SERVO_3_RCC_IOP RCC_APB2ENR_IOPCEN
215 #define PWM_SERVO_3_GPIO GPIOC
216 #define PWM_SERVO_3_PIN GPIO8
217 #define PWM_SERVO_3_AF 0
218 #define PWM_SERVO_3_OC TIM_OC3
219 #define PWM_SERVO_3_OC_BIT (1<<2)
220 #else
221 #define PWM_SERVO_3_OC_BIT 0
222 #endif
223 
224 #if USE_PWM4
225 #define PWM_SERVO_4 3
226 #define PWM_SERVO_4_TIMER TIM3
227 #define PWM_SERVO_4_RCC_IOP RCC_APB2ENR_IOPCEN
228 #define PWM_SERVO_4_GPIO GPIOC
229 #define PWM_SERVO_4_PIN GPIO9
230 #define PWM_SERVO_4_AF 0
231 #define PWM_SERVO_4_OC TIM_OC4
232 #define PWM_SERVO_4_OC_BIT (1<<3)
233 #else
234 #define PWM_SERVO_4_OC_BIT 0
235 #endif
236 
237 #if USE_PWM5
238 #define PWM_SERVO_5 4
239 #define PWM_SERVO_5_TIMER TIM4
240 #define PWM_SERVO_5_RCC_IOP RCC_APB2ENR_IOPBEN
241 #define PWM_SERVO_5_GPIO GPIOB
242 #define PWM_SERVO_5_PIN GPIO8
243 #define PWM_SERVO_5_AF 0
244 #define PWM_SERVO_5_OC TIM_OC3
245 #define PWM_SERVO_5_OC_BIT (1<<2)
246 #else
247 #define PWM_SERVO_5_OC_BIT 0
248 #endif
249 
250 #if USE_PWM6
251 #define PWM_SERVO_6 5
252 #define PWM_SERVO_6_TIMER TIM4
253 #define PWM_SERVO_6_RCC_IOP RCC_APB2ENR_IOPBEN
254 #define PWM_SERVO_6_GPIO GPIOB
255 #define PWM_SERVO_6_PIN GPIO9
256 #define PWM_SERVO_6_AF 0
257 #define PWM_SERVO_6_OC TIM_OC4
258 #define PWM_SERVO_6_OC_BIT (1<<3)
259 #else
260 #define PWM_SERVO_6_OC_BIT 0
261 #endif
262 
263 /* servos 1-4 on TIM3 */
264 #define PWM_TIM3_CHAN_MASK (PWM_SERVO_1_OC_BIT|PWM_SERVO_2_OC_BIT|PWM_SERVO_3_OC_BIT|PWM_SERVO_4_OC_BIT)
265 /* servos 5-6 on TIM4 */
266 #define PWM_TIM4_CHAN_MASK (PWM_SERVO_5_OC_BIT|PWM_SERVO_6_OC_BIT)
267 
268 #endif /* CONFIG_LISA_L_1_0_H */