1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/cc2538: use generic hw fc module

This commit is contained in:
Dylan Laduranty 2020-03-10 14:16:51 +01:00
parent 88bb019438
commit 077a15f254
2 changed files with 4 additions and 0 deletions

View File

@ -167,8 +167,10 @@ typedef struct {
cc2538_uart_t *dev; /**< pointer to the used UART device */
gpio_t rx_pin; /**< pin used for RX */
gpio_t tx_pin; /**< pin used for TX */
#ifdef MODULE_PERIPH_UART_HW_FC
gpio_t cts_pin; /**< CTS pin - set to GPIO_UNDEF when not using */
gpio_t rts_pin; /**< RTS pin - set to GPIO_UNDEF when not using */
#endif
} uart_conf_t;
/** @} */

View File

@ -99,6 +99,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
u->CC = 0;
/* On the CC2538, hardware flow control is supported only on UART1 */
#ifdef MODULE_PERIPH_UART_HW_FC
if (uart_config[uart].rts_pin != GPIO_UNDEF) {
assert(u != UART0_BASEADDR);
gpio_init_af(uart_config[uart].rts_pin, UART1_RTS, GPIO_OUT);
@ -110,6 +111,7 @@ int uart_init(uart_t uart, uint32_t baudrate, uart_rx_cb_t rx_cb, void *arg)
gpio_init_af(uart_config[uart].cts_pin, UART1_CTS, GPIO_IN);
u->cc2538_uart_ctl.CTLbits.CTSEN = 1;
}
#endif
/*
* UART Interrupt Setup: