From 48231efb20432509a7049cff8becc31d8dfc462a Mon Sep 17 00:00:00 2001 From: Dylan Laduranty Date: Tue, 10 Mar 2020 14:19:53 +0100 Subject: [PATCH] boards/cc26xx_cc13xx: use generic hw fc module --- boards/cc1312-launchpad/include/periph_conf.h | 7 ++-- boards/cc1352-launchpad/include/periph_conf.h | 33 +++++++++++-------- boards/cc2650-launchpad/include/periph_conf.h | 24 +++++++------- boards/cc2650stk/include/periph_conf.h | 19 ++++++----- 4 files changed, 47 insertions(+), 36 deletions(-) diff --git a/boards/cc1312-launchpad/include/periph_conf.h b/boards/cc1312-launchpad/include/periph_conf.h index 081dfbd3a8..0bd76b1da7 100644 --- a/boards/cc1312-launchpad/include/periph_conf.h +++ b/boards/cc1312-launchpad/include/periph_conf.h @@ -85,9 +85,10 @@ static const uart_conf_t uart_config[] = { .regs = UART0, .tx_pin = 3, .rx_pin = 2, - .rts_pin = 18, /* ignored when flow_control is 0 */ - .cts_pin = 19, /* ignored when flow_control is 0 */ - .flow_control = 0, +#ifdef MODULE_PERIPH_UART_HW_FC + .rts_pin = 18, + .cts_pin = 19, +#endif .intn = UART0_IRQN } }; diff --git a/boards/cc1352-launchpad/include/periph_conf.h b/boards/cc1352-launchpad/include/periph_conf.h index b4f5c82b80..fa378737ba 100644 --- a/boards/cc1352-launchpad/include/periph_conf.h +++ b/boards/cc1352-launchpad/include/periph_conf.h @@ -71,23 +71,30 @@ static const timer_conf_t timer_config[] = { * The TI CC1352 LaunchPad board only has access to a single UART device through * the debugger, so all we need to configure are the RX and TX pins. * -* Optionally we can enable hardware flow control, by setting UART_HW_FLOW_CTRL -* to 1 and defining pins for cts_pin and rts_pin. -* -* Add a second UART configuration if using external pins. +* Optionally we can enable hardware flow control, by using periph_uart_hw_fc +* module (USEMODULE += periph_uart_hw_fc) and defining pins for cts_pin and +* rts_pin. * @{ */ +/** + * @name UART configuration + * + * + * Add a second UART configuration if using external pins. + * @{ + */ static const uart_conf_t uart_config[] = { - { - .regs = UART0, - .tx_pin = 13, - .rx_pin = 12, - .rts_pin = 0, /* ignored when flow_control is 0 */ - .cts_pin = 0, /* ignored when flow_control is 0 */ - .flow_control = 0, - .intn = UART0_IRQN - } + { + .regs = UART0, + .tx_pin = 13, + .rx_pin = 12, +#ifdef MODULE_PERIPH_UART_HW_FC + .rts_pin = GPIO_UNDEF, + .cts_pin = GPIO_UNDEF, +#endif + .intn = UART0_IRQN + } }; #define UART_NUMOF ARRAY_SIZE(uart_config) /** @} */ diff --git a/boards/cc2650-launchpad/include/periph_conf.h b/boards/cc2650-launchpad/include/periph_conf.h index 861f30317c..dc8d2d48d4 100644 --- a/boards/cc2650-launchpad/include/periph_conf.h +++ b/boards/cc2650-launchpad/include/periph_conf.h @@ -71,21 +71,23 @@ static const timer_conf_t timer_config[] = { * The used CC26x0 CPU only supports a single UART device, so all we need to * configure are the RX and TX pins. * -* Optionally we can enable hardware flow control, by setting flow_control -* to 1 and defining pins for cts_pin and rts_pin. +* Optionally we can enable hardware flow control, by using periph_uart_hw_fc +* module (USEMODULE += periph_uart_hw_fc) and defining pins for cts_pin and +* rts_pin. * @{ */ static const uart_conf_t uart_config[] = { - { - .regs = UART0, - .tx_pin = 3, - .rx_pin = 2, - .rts_pin = 0, /* ignored when flow_control is 0 */ - .cts_pin = 0, /* ignored when flow_control is 0 */ - .flow_control = 0, - .intn = UART0_IRQN - } + { + .regs = UART0, + .tx_pin = 3, + .rx_pin = 2, +#ifdef MODULE_PERIPH_UART_HW_FC + .rts_pin = GPIO_UNDEF, + .cts_pin = GPIO_UNDEF, +#endif + .intn = UART0_IRQN + } }; #define UART_NUMOF ARRAY_SIZE(uart_config) /** @} */ diff --git a/boards/cc2650stk/include/periph_conf.h b/boards/cc2650stk/include/periph_conf.h index fcf4bdc2f4..9d0625be5e 100644 --- a/boards/cc2650stk/include/periph_conf.h +++ b/boards/cc2650stk/include/periph_conf.h @@ -75,15 +75,16 @@ static const timer_conf_t timer_config[] = { */ static const uart_conf_t uart_config[] = { - { - .regs = UART0, - .tx_pin = 29, - .rx_pin = 28, - .rts_pin = 0, /* ignored when flow_control is 0 */ - .cts_pin = 0, /* ignored when flow_control is 0 */ - .flow_control = 0, - .intn = UART0_IRQN - } + { + .regs = UART0, + .tx_pin = 29, + .rx_pin = 28, +#ifdef MODULE_PERIPH_UART_HW_FC + .rts_pin = GPIO_UNDEF, + .cts_pin = GPIO_UNDEF, +#endif + .intn = UART0_IRQN + } }; #define UART_NUMOF ARRAY_SIZE(uart_config) /** @} */