mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
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:
@@ -941,9 +941,11 @@ static uint16_t hciuart_rxinuse(const struct hciuart_config_s *config)
|
||||
* Name: hciuart_rxflow_enable
|
||||
*
|
||||
* Description:
|
||||
* Enable software Rx flow control, i.e., clear the RTS output. This will
|
||||
* be seen as CTS on the other end of the cable and the HCI UART device
|
||||
* must stop sending data.
|
||||
* Enable software Rx flow control, i.e., deassert the RTS output. This
|
||||
* will be seen as CTS on the other end of the cable and the HCI UART
|
||||
* 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");
|
||||
|
||||
stm32_gpiowrite(config->rts_gpio, false);
|
||||
stm32_gpiowrite(config->rts_gpio, true);
|
||||
state->rxflow = true;
|
||||
}
|
||||
}
|
||||
@@ -976,9 +978,11 @@ static void hciuart_rxflow_enable(const struct hciuart_config_s *config)
|
||||
* Name: hciuart_rxflow_disable
|
||||
*
|
||||
* Description:
|
||||
* Disable software Rx flow control, i.e., set the RTS output. This will
|
||||
* be seen as CTS on the other end of the cable and the HCI UART device
|
||||
* can resume sending data.
|
||||
* Disable software Rx flow control, i.e., assert the RTS output. This
|
||||
* will be seen as CTS on the other end of the cable and the HCI UART
|
||||
* 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");
|
||||
|
||||
stm32_gpiowrite(config->rts_gpio, true);
|
||||
stm32_gpiowrite(config->rts_gpio, false);
|
||||
state->rxflow = false;
|
||||
}
|
||||
}
|
||||
@@ -1581,13 +1585,12 @@ static int hciuart_configure(const struct hciuart_config_s *config)
|
||||
* based management of RTS.
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
regval = GPIO_MODE_MASK | GPIO_PUPD_MASK | GPIO_OPENDRAIN |
|
||||
GPIO_OUTPUT_SET | GPIO_EXTI;
|
||||
pinset = (config & ~regval) | GPIO_OUTPUT;
|
||||
regval = GPIO_MODE_MASK | GPIO_PUPD_MASK | GPIO_OPENDRAIN | GPIO_EXTI;
|
||||
pinset = (config & ~regval) | GPIO_OUTPUT | GPIO_OUTPUT_SET;
|
||||
#endif
|
||||
stm32_configgpio(pinset);
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ CONFIG_START_MONTH=9
|
||||
CONFIG_START_YEAR=2014
|
||||
CONFIG_STM32_DMA2=y
|
||||
CONFIG_STM32_DMACAPABLE=y
|
||||
CONFIG_STM32_HCIUART3_BAUD=9600
|
||||
CONFIG_STM32_JTAG_SW_ENABLE=y
|
||||
CONFIG_STM32_PWR=y
|
||||
CONFIG_STM32_SDIO=y
|
||||
|
||||
@@ -868,7 +868,7 @@ static int hci_tx_kthread(int argc, FAR char *argv[])
|
||||
|
||||
wlinfo("started\n");
|
||||
|
||||
while (1)
|
||||
for (; ; )
|
||||
{
|
||||
FAR struct bt_buf_s *buf;
|
||||
|
||||
@@ -918,7 +918,7 @@ static int hci_rx_kthread(int argc, FAR char *argv[])
|
||||
|
||||
wlinfo("started\n");
|
||||
|
||||
while (1)
|
||||
for (; ; )
|
||||
{
|
||||
ret = bt_queue_receive(g_btdev.rx_queue, &buf);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user