Skip to content

Commit

Permalink
Flight: Lux target RX port definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jihlein authored and mlyle committed Apr 14, 2016
1 parent e20b4fa commit 5ad1de1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions flight/targets/lux/board-info/board_hw_defs.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,31 @@ static const struct pios_usart_cfg pios_main_usart_cfg = {
.pin_source = GPIO_PinSource10,
},
};

static const struct pios_usart_cfg pios_rcvr_usart_cfg = {
.regs = USART1,
.remap = GPIO_AF_7,
.irq = {
.init = {
.NVIC_IRQChannel = USART1_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
.rx = {
.gpio = GPIOC,
.init = {
.GPIO_Pin = GPIO_Pin_5,
.GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_OType = GPIO_OType_PP,
.GPIO_PuPd = GPIO_PuPd_UP
},
.pin_source = GPIO_PinSource5,
},
};

#endif /* PIOS_INCLUDE_USART */

#if defined(PIOS_INCLUDE_COM)
Expand Down
2 changes: 1 addition & 1 deletion flight/targets/lux/fw/pios_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void PIOS_Board_Init(void)
uint8_t hw_rcvrport;
HwLuxRcvrPortGet(&hw_rcvrport);
PIOS_HAL_ConfigurePort(hw_rcvrport, // port_type
NULL, // usart_port_cfg
&pios_rcvr_usart_cfg, // usart_port_cfg
&pios_usart_com_driver, // com_driver
NULL, // i2c_id
NULL, // i2c_cfg
Expand Down

0 comments on commit 5ad1de1

Please sign in to comment.