arch/arm/src/stm32/: In HCI UART, sense of RTS and CTS are inverted. When we speak of asserting RTS we mean setting nRTS to zero.

This commit is contained in:
Gregory Nutt
2018-04-16 17:14:51 -06:00
parent 603efe6fb5
commit 862ff9cae3
3 changed files with 18 additions and 14 deletions
+15 -12
View File
@@ -941,9 +941,11 @@ static uint16_t hciuart_rxinuse(const struct hciuart_config_s *config)
* Name: hciuart_rxflow_enable * Name: hciuart_rxflow_enable
* *
* Description: * Description:
* Enable software Rx flow control, i.e., clear the RTS output. This will * Enable software Rx flow control, i.e., deassert the RTS output. This
* be seen as CTS on the other end of the cable and the HCI UART device * will be seen as CTS on the other end of the cable and the HCI UART
* must stop sending data. * device must stop sending data.
*
* NOTE: RTS is logic low
* *
****************************************************************************/ ****************************************************************************/
@@ -965,7 +967,7 @@ static void hciuart_rxflow_enable(const struct hciuart_config_s *config)
{ {
wlinfo("Enable RTS flow control\n"); wlinfo("Enable RTS flow control\n");
stm32_gpiowrite(config->rts_gpio, false); stm32_gpiowrite(config->rts_gpio, true);
state->rxflow = true; state->rxflow = true;
} }
} }
@@ -976,9 +978,11 @@ static void hciuart_rxflow_enable(const struct hciuart_config_s *config)
* Name: hciuart_rxflow_disable * Name: hciuart_rxflow_disable
* *
* Description: * Description:
* Disable software Rx flow control, i.e., set the RTS output. This will * Disable software Rx flow control, i.e., assert the RTS output. This
* be seen as CTS on the other end of the cable and the HCI UART device * will be seen as CTS on the other end of the cable and the HCI UART
* can resume sending data. * device can resume sending data.
*
* NOTE: RTS is logic low
* *
****************************************************************************/ ****************************************************************************/
@@ -998,7 +1002,7 @@ static void hciuart_rxflow_disable(const struct hciuart_config_s *config)
{ {
wlinfo("Disable RTS flow control\n"); wlinfo("Disable RTS flow control\n");
stm32_gpiowrite(config->rts_gpio, true); stm32_gpiowrite(config->rts_gpio, false);
state->rxflow = false; state->rxflow = false;
} }
} }
@@ -1581,13 +1585,12 @@ static int hciuart_configure(const struct hciuart_config_s *config)
* based management of RTS. * based management of RTS.
* *
* Convert the RTS alternate function pin to a push-pull output with * Convert the RTS alternate function pin to a push-pull output with
* initial output value of zero, i.e., rx flow control enabled. The HCI * initial output value of one, i.e., rx flow control enabled. The HCI
* UART device should not send data until we assert RTS. * UART device should not send data until we assert RTS.
*/ */
regval = GPIO_MODE_MASK | GPIO_PUPD_MASK | GPIO_OPENDRAIN | regval = GPIO_MODE_MASK | GPIO_PUPD_MASK | GPIO_OPENDRAIN | GPIO_EXTI;
GPIO_OUTPUT_SET | GPIO_EXTI; pinset = (config & ~regval) | GPIO_OUTPUT | GPIO_OUTPUT_SET;
pinset = (config & ~regval) | GPIO_OUTPUT;
#endif #endif
stm32_configgpio(pinset); stm32_configgpio(pinset);
@@ -74,6 +74,7 @@ CONFIG_START_MONTH=9
CONFIG_START_YEAR=2014 CONFIG_START_YEAR=2014
CONFIG_STM32_DMA2=y CONFIG_STM32_DMA2=y
CONFIG_STM32_DMACAPABLE=y CONFIG_STM32_DMACAPABLE=y
CONFIG_STM32_HCIUART3_BAUD=9600
CONFIG_STM32_JTAG_SW_ENABLE=y CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_PWR=y CONFIG_STM32_PWR=y
CONFIG_STM32_SDIO=y CONFIG_STM32_SDIO=y
+2 -2
View File
@@ -868,7 +868,7 @@ static int hci_tx_kthread(int argc, FAR char *argv[])
wlinfo("started\n"); wlinfo("started\n");
while (1) for (; ; )
{ {
FAR struct bt_buf_s *buf; FAR struct bt_buf_s *buf;
@@ -918,7 +918,7 @@ static int hci_rx_kthread(int argc, FAR char *argv[])
wlinfo("started\n"); wlinfo("started\n");
while (1) for (; ; )
{ {
ret = bt_queue_receive(g_btdev.rx_queue, &buf); ret = bt_queue_receive(g_btdev.rx_queue, &buf);
if (ret < 0) if (ret < 0)