32 #include <pios_config.h>
39 #if defined(PIOS_INCLUDE_ANNUNC)
47 .GPIO_Pin = GPIO_Pin_0,
48 .GPIO_Mode = GPIO_Mode_OUT,
49 .GPIO_Speed = GPIO_Speed_50MHz,
50 .GPIO_OType = GPIO_OType_PP,
58 .num_annunciators =
NELEMENTS(pios_annuncs),
61 const struct pios_annunc_cfg * PIOS_BOARD_HW_DEFS_GetLedCfg (uint32_t
board_revision)
63 return &pios_annunc_cfg;
68 #if defined(PIOS_INCLUDE_SPISLAVE)
87 .SPI_Mode = SPI_Mode_Slave,
88 .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
89 .SPI_DataSize = SPI_DataSize_8b,
90 .SPI_NSS = SPI_NSS_Hard,
91 .SPI_FirstBit = SPI_FirstBit_MSB,
92 .SPI_CPOL = SPI_CPOL_Low,
93 .SPI_CPHA = SPI_CPHA_1Edge,
95 .SPI_CRCPolynomial = 7,
96 .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_2,
101 .GPIO_Pin = GPIO_Pin_3,
102 .GPIO_Speed = GPIO_Speed_50MHz,
103 .GPIO_Mode = GPIO_Mode_AF,
104 .GPIO_OType = GPIO_OType_PP,
105 .GPIO_PuPd = GPIO_PuPd_NOPULL
111 .GPIO_Pin = GPIO_Pin_4,
112 .GPIO_Speed = GPIO_Speed_50MHz,
113 .GPIO_Mode = GPIO_Mode_AF,
114 .GPIO_OType = GPIO_OType_PP,
115 .GPIO_PuPd = GPIO_PuPd_NOPULL
121 .GPIO_Pin = GPIO_Pin_5,
122 .GPIO_Speed = GPIO_Speed_50MHz,
123 .GPIO_Mode = GPIO_Mode_AF,
124 .GPIO_OType = GPIO_OType_PP,
125 .GPIO_PuPd = GPIO_PuPd_NOPULL
131 .GPIO_Pin = GPIO_Pin_4,
132 .GPIO_Speed = GPIO_Speed_50MHz,
133 .GPIO_Mode = GPIO_Mode_AF,
134 .GPIO_OType = GPIO_OType_PP,
135 .GPIO_PuPd = GPIO_PuPd_UP
141 .DMA_PeripheralBaseAddr = (uint32_t) &(SPI1->DR),
142 .DMA_PeripheralInc = DMA_PeripheralInc_Disable,
143 .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte,
144 .DMA_MemoryBaseAddr = (uint32_t) &tx_buf,
145 .DMA_MemoryInc = DMA_MemoryInc_Enable,
146 .DMA_MemoryDataSize = DMA_MemoryDataSize_Byte,
147 .DMA_DIR = DMA_DIR_PeripheralDST,
148 .DMA_Priority = DMA_Priority_High,
149 .DMA_Mode = DMA_Mode_Normal,
150 .DMA_M2M = DMA_M2M_Disable,
152 .channel = DMA1_Channel3,
156 .DMA_PeripheralBaseAddr = (uint32_t) &(SPI1->DR),
157 .DMA_PeripheralInc = DMA_PeripheralInc_Disable,
158 .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte,
159 .DMA_MemoryBaseAddr = (uint32_t) &rx_buf,
160 .DMA_MemoryInc = DMA_MemoryInc_Enable,
161 .DMA_MemoryDataSize = DMA_MemoryDataSize_Byte,
162 .DMA_DIR = DMA_DIR_PeripheralSRC,
163 .DMA_Priority = DMA_Priority_High,
164 .DMA_Mode = DMA_Mode_Normal,
165 .DMA_M2M = DMA_M2M_Disable,
167 .channel = DMA1_Channel2,
174 #ifdef PIOS_INCLUDE_ADC
185 {GPIOA, GPIO_Pin_0, ADC_Channel_0 },
186 {GPIOA, GPIO_Pin_1, ADC_Channel_1 },
187 {NULL, 0, ADC_Channel_Vrefint },
188 {NULL, 0, ADC_Channel_TempSensor },
199 .TIM_ClockDivision = TIM_CKD_DIV1,
200 .TIM_CounterMode = TIM_CounterMode_Up,
202 .TIM_RepetitionCounter = 0x0000,
210 .NVIC_IRQChannel = TIM1_CC_IRQn,
211 .NVIC_IRQChannelCmd = ENABLE,
221 .NVIC_IRQChannel = TIM3_IRQn,
222 .NVIC_IRQChannelCmd = ENABLE,
233 .NVIC_IRQChannel = TIM14_IRQn,
234 .NVIC_IRQChannelCmd = ENABLE,
253 .timer_chan = TIM_Channel_1,
258 .GPIO_Pin = GPIO_Pin_1,
259 .GPIO_Mode = GPIO_Mode_AF,
260 .GPIO_PuPd = GPIO_PuPd_UP,
261 .GPIO_OType = GPIO_OType_PP,
262 .GPIO_Speed = GPIO_Speed_2MHz,
264 .pin_source = GPIO_PinSource1,
271 .timer_chan = TIM_Channel_2,
276 .GPIO_Pin = GPIO_Pin_7,
277 .GPIO_Mode = GPIO_Mode_AF,
278 .GPIO_PuPd = GPIO_PuPd_UP,
279 .GPIO_OType = GPIO_OType_PP,
280 .GPIO_Speed = GPIO_Speed_50MHz,
282 .pin_source = GPIO_PinSource7,
287 .timer_chan = TIM_Channel_1,
292 .GPIO_Pin = GPIO_Pin_6,
293 .GPIO_Mode = GPIO_Mode_AF,
294 .GPIO_PuPd = GPIO_PuPd_UP,
295 .GPIO_OType = GPIO_OType_PP,
296 .GPIO_Speed = GPIO_Speed_50MHz,
298 .pin_source = GPIO_PinSource6,
303 .timer_chan = TIM_Channel_4,
308 .GPIO_Pin = GPIO_Pin_11,
309 .GPIO_Mode = GPIO_Mode_AF,
310 .GPIO_PuPd = GPIO_PuPd_UP,
311 .GPIO_OType = GPIO_OType_PP,
312 .GPIO_Speed = GPIO_Speed_50MHz,
314 .pin_source = GPIO_PinSource11,
319 .timer_chan = TIM_Channel_3,
324 .GPIO_Pin = GPIO_Pin_10,
325 .GPIO_Mode = GPIO_Mode_AF,
326 .GPIO_PuPd = GPIO_PuPd_UP,
327 .GPIO_OType = GPIO_OType_PP,
328 .GPIO_Speed = GPIO_Speed_50MHz,
330 .pin_source = GPIO_PinSource10,
335 .timer_chan = TIM_Channel_2,
340 .GPIO_Pin = GPIO_Pin_9,
341 .GPIO_Mode = GPIO_Mode_AF,
342 .GPIO_PuPd = GPIO_PuPd_UP,
343 .GPIO_OType = GPIO_OType_PP,
344 .GPIO_Speed = GPIO_Speed_50MHz,
346 .pin_source = GPIO_PinSource9,
351 .timer_chan = TIM_Channel_1,
356 .GPIO_Pin = GPIO_Pin_8,
357 .GPIO_Mode = GPIO_Mode_AF,
358 .GPIO_PuPd = GPIO_PuPd_UP,
359 .GPIO_OType = GPIO_OType_PP,
360 .GPIO_Speed = GPIO_Speed_50MHz,
362 .pin_source = GPIO_PinSource8,
367 #if defined(PIOS_INCLUDE_USART)
375 .NVIC_IRQChannel = USART1_IRQn,
376 .NVIC_IRQChannelCmd = ENABLE,
382 .GPIO_Pin = GPIO_Pin_7,
383 .GPIO_Mode = GPIO_Mode_AF,
384 .GPIO_PuPd = GPIO_PuPd_UP,
385 .GPIO_OType = GPIO_OType_PP,
386 .GPIO_Speed = GPIO_Speed_50MHz,
392 .GPIO_Pin = GPIO_Pin_6,
393 .GPIO_Mode = GPIO_Mode_AF,
394 .GPIO_PuPd = GPIO_PuPd_UP,
395 .GPIO_OType = GPIO_OType_PP,
396 .GPIO_Speed = GPIO_Speed_50MHz,
401 #if defined(PIOS_INCLUDE_DSM)
408 .GPIO_Pin = GPIO_Pin_7,
409 .GPIO_Speed = GPIO_Speed_50MHz,
410 .GPIO_PuPd = GPIO_PuPd_UP,
411 .GPIO_OType = GPIO_OType_PP,
412 .GPIO_Speed = GPIO_Speed_50MHz,
420 #if defined(PIOS_INCLUDE_COM)
426 #if defined(PIOS_INCLUDE_RTC)
431 #include <pios_rtc_priv.h>
433 void PIOS_RTC_IRQ_Handler (
void);
436 .
clksrc = RCC_RTCCLKSource_HSE_Div32,
440 .NVIC_IRQChannel = RTC_IRQn,
441 .NVIC_IRQChannelCmd = ENABLE,
446 void PIOS_RTC_IRQ_Handler (
void)
453 #if defined(PIOS_INCLUDE_SERVO) && defined(PIOS_INCLUDE_TIM)
461 .TIM_OCMode = TIM_OCMode_PWM1,
462 .TIM_OutputState = TIM_OutputState_Enable,
463 .TIM_OutputNState = TIM_OutputNState_Disable,
465 .TIM_OCPolarity = TIM_OCPolarity_High,
466 .TIM_OCNPolarity = TIM_OCPolarity_High,
467 .TIM_OCIdleState = TIM_OCIdleState_Reset,
468 .TIM_OCNIdleState = TIM_OCNIdleState_Reset,
471 .num_channels =
NELEMENTS(pios_tim_servoport_pins),
479 #if defined(PIOS_INCLUDE_PPM)
484 .TIM_ICPolarity = TIM_ICPolarity_Rising,
485 .TIM_ICSelection = TIM_ICSelection_DirectTI,
486 .TIM_ICPrescaler = TIM_ICPSC_DIV1,
496 #if defined(PIOS_INCLUDE_RCVR)
static const TIM_TimeBaseInitTypeDef tim_time_base
static const struct pios_tim_clock_cfg tim_1_cfg
static const struct pios_tim_clock_cfg tim_3_cfg
#define PIOS_SERVOS_INITIAL_POSITION
#define RTC_WKUP_IRQHandler
USART private definitions.
Spektrum/JR DSMx satellite receiver private structures.
#define PIOS_SERVO_UPDATE_HZ
static const struct pios_tim_channel pios_tim_servoport_pins[]
const struct pios_annunc * annunciators
TIM_OCInitTypeDef tim_oc_init
const struct pios_sbus_cfg * get_sbus_cfg(enum board_revision board_rev)
Servo private structures.
TIM_ICInitTypeDef tim_ic_init
static const struct pios_tim_clock_cfg tim_14_cfg
void PIOS_RTC_irq_handler(void)
static void process_pio_message(void *ctx, int len, int *resp_len)
static const struct pios_tim_channel pios_tim_rcvrport_pin
USART private definitions.
#define PIOS_LED_HEARTBEAT