mirror of https://github.com/ARMmbed/mbed-os.git
Fix UART flow control CTS/RTS
Configure RTS pin outout to active low when RTS is disabled. This allows the peer to be able to send data if its CTS is still enabled.pull/9370/head
parent
3e94b86a78
commit
cf12140031
|
@ -361,10 +361,7 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
{
|
{
|
||||||
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
||||||
|
|
||||||
// First, disable flow control completely.
|
if (rxflow != NC) {
|
||||||
uart_base->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk);
|
|
||||||
|
|
||||||
if ((type == FlowControlRTS || type == FlowControlRTSCTS) && rxflow != NC) {
|
|
||||||
// Check if RTS pin matches.
|
// Check if RTS pin matches.
|
||||||
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
||||||
MBED_ASSERT(uart_rts == obj->serial.uart);
|
MBED_ASSERT(uart_rts == obj->serial.uart);
|
||||||
|
@ -378,14 +375,24 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
||||||
// NOTE: Added in M480/M2351. After configuring RTSACTLV, re-enable TX/RX.
|
// NOTE: Added in M480/M2351. After configuring RTSACTLV, re-enable TX/RX.
|
||||||
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
||||||
|
// Configure RTS trigger level to 8 bytes
|
||||||
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
||||||
|
|
||||||
// Enable RTS
|
if (type == FlowControlRTS || type == FlowControlRTSCTS) {
|
||||||
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
// Enable RTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable RTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATORTSEN_Msk;
|
||||||
|
/* Drive nRTS pin output to low-active. Allow the peer to be able to send data
|
||||||
|
* even though its CTS is still enabled. */
|
||||||
|
uart_base->MODEM &= ~UART_MODEM_RTS_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((type == FlowControlCTS || type == FlowControlRTSCTS) && txflow != NC) {
|
/* If CTS is disabled, we don't need to configure CTS. But to be consistent with
|
||||||
|
* RTS code above, we still configure CTS. */
|
||||||
|
if (txflow != NC) {
|
||||||
// Check if CTS pin matches.
|
// Check if CTS pin matches.
|
||||||
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
||||||
MBED_ASSERT(uart_cts == obj->serial.uart);
|
MBED_ASSERT(uart_cts == obj->serial.uart);
|
||||||
|
@ -400,8 +407,13 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
// NOTE: Added in M480/M2351. After configuring CTSACTLV, re-enable TX/RX.
|
// NOTE: Added in M480/M2351. After configuring CTSACTLV, re-enable TX/RX.
|
||||||
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
||||||
|
|
||||||
// Enable CTS
|
if (type == FlowControlCTS || type == FlowControlRTSCTS) {
|
||||||
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
// Enable CTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable CTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -314,10 +314,7 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
{
|
{
|
||||||
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
||||||
|
|
||||||
// First, disable flow control completely.
|
if (rxflow != NC) {
|
||||||
uart_base->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk);
|
|
||||||
|
|
||||||
if ((type == FlowControlRTS || type == FlowControlRTSCTS) && rxflow != NC) {
|
|
||||||
// Check if RTS pin matches.
|
// Check if RTS pin matches.
|
||||||
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
||||||
MBED_ASSERT(uart_rts == obj->serial.uart);
|
MBED_ASSERT(uart_rts == obj->serial.uart);
|
||||||
|
@ -325,12 +322,24 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
pinmap_pinout(rxflow, PinMap_UART_RTS);
|
pinmap_pinout(rxflow, PinMap_UART_RTS);
|
||||||
// nRTS pin output is low level active
|
// nRTS pin output is low level active
|
||||||
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
||||||
|
// Configure RTS trigger level to 8 bytes
|
||||||
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
||||||
// Enable RTS
|
|
||||||
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
if (type == FlowControlRTS || type == FlowControlRTSCTS) {
|
||||||
|
// Enable RTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable RTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATORTSEN_Msk;
|
||||||
|
/* Drive nRTS pin output to low-active. Allow the peer to be able to send data
|
||||||
|
* even though its CTS is still enabled. */
|
||||||
|
uart_base->MODEM &= ~UART_MODEM_RTS_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((type == FlowControlCTS || type == FlowControlRTSCTS) && txflow != NC) {
|
/* If CTS is disabled, we don't need to configure CTS. But to be consistent with
|
||||||
|
* RTS code above, we still configure CTS. */
|
||||||
|
if (txflow != NC) {
|
||||||
// Check if CTS pin matches.
|
// Check if CTS pin matches.
|
||||||
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
||||||
MBED_ASSERT(uart_cts == obj->serial.uart);
|
MBED_ASSERT(uart_cts == obj->serial.uart);
|
||||||
|
@ -338,8 +347,14 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
pinmap_pinout(txflow, PinMap_UART_CTS);
|
pinmap_pinout(txflow, PinMap_UART_CTS);
|
||||||
// nCTS pin input is low level active
|
// nCTS pin input is low level active
|
||||||
uart_base->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk;
|
uart_base->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk;
|
||||||
// Enable CTS
|
|
||||||
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
if (type == FlowControlCTS || type == FlowControlRTSCTS) {
|
||||||
|
// Enable CTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable CTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -348,10 +348,7 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
{
|
{
|
||||||
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
||||||
|
|
||||||
// First, disable flow control completely.
|
if (rxflow != NC) {
|
||||||
uart_base->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk);
|
|
||||||
|
|
||||||
if ((type == FlowControlRTS || type == FlowControlRTSCTS) && rxflow != NC) {
|
|
||||||
// Check if RTS pin matches.
|
// Check if RTS pin matches.
|
||||||
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
||||||
MBED_ASSERT(uart_rts == obj->serial.uart);
|
MBED_ASSERT(uart_rts == obj->serial.uart);
|
||||||
|
@ -365,14 +362,24 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
||||||
// NOTE: Added in M480. After configuring RTSACTLV, re-enable TX/RX.
|
// NOTE: Added in M480. After configuring RTSACTLV, re-enable TX/RX.
|
||||||
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
||||||
|
// Configure RTS trigger level to 8 bytes
|
||||||
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
||||||
|
|
||||||
// Enable RTS
|
if (type == FlowControlRTS || type == FlowControlRTSCTS) {
|
||||||
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
// Enable RTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable RTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATORTSEN_Msk;
|
||||||
|
/* Drive nRTS pin output to low-active. Allow the peer to be able to send data
|
||||||
|
* even though its CTS is still enabled. */
|
||||||
|
uart_base->MODEM &= ~UART_MODEM_RTS_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((type == FlowControlCTS || type == FlowControlRTSCTS) && txflow != NC) {
|
/* If CTS is disabled, we don't need to configure CTS. But to be consistent with
|
||||||
|
* RTS code above, we still configure CTS. */
|
||||||
|
if (txflow != NC) {
|
||||||
// Check if CTS pin matches.
|
// Check if CTS pin matches.
|
||||||
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
||||||
MBED_ASSERT(uart_cts == obj->serial.uart);
|
MBED_ASSERT(uart_cts == obj->serial.uart);
|
||||||
|
@ -387,8 +394,13 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
// NOTE: Added in M480. After configuring CTSACTLV, re-enable TX/RX.
|
// NOTE: Added in M480. After configuring CTSACTLV, re-enable TX/RX.
|
||||||
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
uart_base->FUNCSEL &= ~UART_FUNCSEL_TXRXDIS_Msk;
|
||||||
|
|
||||||
// Enable CTS
|
if (type == FlowControlCTS || type == FlowControlRTSCTS) {
|
||||||
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
// Enable CTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable CTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -275,10 +275,7 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
{
|
{
|
||||||
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
||||||
|
|
||||||
// First, disable flow control completely.
|
if (rxflow != NC) {
|
||||||
UART_DisableFlowCtrl(uart_base);
|
|
||||||
|
|
||||||
if ((type == FlowControlRTS || type == FlowControlRTSCTS) && rxflow != NC) {
|
|
||||||
// Check if RTS pin matches.
|
// Check if RTS pin matches.
|
||||||
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
||||||
MBED_ASSERT(uart_rts == obj->serial.uart);
|
MBED_ASSERT(uart_rts == obj->serial.uart);
|
||||||
|
@ -286,15 +283,26 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
pinmap_pinout(rxflow, PinMap_UART_RTS);
|
pinmap_pinout(rxflow, PinMap_UART_RTS);
|
||||||
// nRTS pin output is low level active
|
// nRTS pin output is low level active
|
||||||
uart_base->MCSR |= UART_MCSR_LEV_RTS_Msk;
|
uart_base->MCSR |= UART_MCSR_LEV_RTS_Msk;
|
||||||
// Set RTS Trigger Level as 8 bytes
|
// Configure RTS trigger level to 8 bytes
|
||||||
uart_base->TLCTL = (uart_base->TLCTL & ~UART_TLCTL_RTS_TRI_LEV_Msk) | UART_TLCTL_RTS_TRI_LEV_8BYTES;
|
uart_base->TLCTL = (uart_base->TLCTL & ~UART_TLCTL_RTS_TRI_LEV_Msk) | UART_TLCTL_RTS_TRI_LEV_8BYTES;
|
||||||
// Set RX Trigger Level as 8 bytes
|
// Configure RX Trigger Level to 8 bytes
|
||||||
uart_base->TLCTL = (uart_base->TLCTL & ~UART_TLCTL_RFITL_Msk) | UART_TLCTL_RFITL_8BYTES;
|
uart_base->TLCTL = (uart_base->TLCTL & ~UART_TLCTL_RFITL_Msk) | UART_TLCTL_RFITL_8BYTES;
|
||||||
// Enable RTS
|
|
||||||
uart_base->CTL |= UART_CTL_AUTO_RTS_EN_Msk;
|
if (type == FlowControlRTS || type == FlowControlRTSCTS) {
|
||||||
|
// Enable RTS
|
||||||
|
uart_base->CTL |= UART_CTL_AUTO_RTS_EN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable RTS
|
||||||
|
uart_base->CTL &= ~UART_CTL_AUTO_RTS_EN_Msk;
|
||||||
|
/* Drive nRTS pin output to low-active. Allow the peer to be able to send data
|
||||||
|
* even though its CTS is still enabled. */
|
||||||
|
/* NOTE: NOT SUPPORT on NANO130 */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((type == FlowControlCTS || type == FlowControlRTSCTS) && txflow != NC) {
|
/* If CTS is disabled, we don't need to configure CTS. But to be consistent with
|
||||||
|
* RTS code above, we still configure CTS. */
|
||||||
|
if (txflow != NC) {
|
||||||
// Check if CTS pin matches.
|
// Check if CTS pin matches.
|
||||||
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
||||||
MBED_ASSERT(uart_cts == obj->serial.uart);
|
MBED_ASSERT(uart_cts == obj->serial.uart);
|
||||||
|
@ -302,8 +310,14 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
pinmap_pinout(txflow, PinMap_UART_CTS);
|
pinmap_pinout(txflow, PinMap_UART_CTS);
|
||||||
// nCTS pin input is low level active
|
// nCTS pin input is low level active
|
||||||
uart_base->MCSR |= UART_MCSR_LEV_CTS_Msk;
|
uart_base->MCSR |= UART_MCSR_LEV_CTS_Msk;
|
||||||
// Enable CTS
|
|
||||||
uart_base->CTL |= UART_CTL_AUTO_CTS_EN_Msk;
|
if (type == FlowControlCTS || type == FlowControlRTSCTS) {
|
||||||
|
// Enable CTS
|
||||||
|
uart_base->CTL |= UART_CTL_AUTO_CTS_EN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable CTS
|
||||||
|
uart_base->CTL &= ~UART_CTL_AUTO_CTS_EN_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -344,10 +344,7 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
{
|
{
|
||||||
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
UART_T *uart_base = (UART_T *) NU_MODBASE(obj->serial.uart);
|
||||||
|
|
||||||
// First, disable flow control completely.
|
if (rxflow != NC) {
|
||||||
uart_base->INTEN &= ~(UART_INTEN_ATORTSEN_Msk | UART_INTEN_ATOCTSEN_Msk);
|
|
||||||
|
|
||||||
if ((type == FlowControlRTS || type == FlowControlRTSCTS) && rxflow != NC) {
|
|
||||||
// Check if RTS pin matches.
|
// Check if RTS pin matches.
|
||||||
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
uint32_t uart_rts = pinmap_peripheral(rxflow, PinMap_UART_RTS);
|
||||||
MBED_ASSERT(uart_rts == obj->serial.uart);
|
MBED_ASSERT(uart_rts == obj->serial.uart);
|
||||||
|
@ -355,14 +352,24 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
pinmap_pinout(rxflow, PinMap_UART_RTS);
|
pinmap_pinout(rxflow, PinMap_UART_RTS);
|
||||||
// nRTS pin output is low level active
|
// nRTS pin output is low level active
|
||||||
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
uart_base->MODEM |= UART_MODEM_RTSACTLV_Msk;
|
||||||
uart_base->MODEM &= ~UART_MODEM_RTS_Msk;
|
// Configure RTS trigger level to 8 bytes
|
||||||
|
|
||||||
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
uart_base->FIFO = (uart_base->FIFO & ~UART_FIFO_RTSTRGLV_Msk) | UART_FIFO_RTSTRGLV_8BYTES;
|
||||||
// Enable RTS
|
|
||||||
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
if (type == FlowControlRTS || type == FlowControlRTSCTS) {
|
||||||
|
// Enable RTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATORTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable RTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATORTSEN_Msk;
|
||||||
|
/* Drive nRTS pin output to low-active. Allow the peer to be able to send data
|
||||||
|
* even though its CTS is still enabled. */
|
||||||
|
uart_base->MODEM &= ~UART_MODEM_RTS_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((type == FlowControlCTS || type == FlowControlRTSCTS) && txflow != NC) {
|
/* If CTS is disabled, we don't need to configure CTS. But to be consistent with
|
||||||
|
* RTS code above, we still configure CTS. */
|
||||||
|
if (txflow != NC) {
|
||||||
// Check if CTS pin matches.
|
// Check if CTS pin matches.
|
||||||
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
uint32_t uart_cts = pinmap_peripheral(txflow, PinMap_UART_CTS);
|
||||||
MBED_ASSERT(uart_cts == obj->serial.uart);
|
MBED_ASSERT(uart_cts == obj->serial.uart);
|
||||||
|
@ -370,8 +377,14 @@ void serial_set_flow_control(serial_t *obj, FlowControl type, PinName rxflow, Pi
|
||||||
pinmap_pinout(txflow, PinMap_UART_CTS);
|
pinmap_pinout(txflow, PinMap_UART_CTS);
|
||||||
// nCTS pin input is low level active
|
// nCTS pin input is low level active
|
||||||
uart_base->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk;
|
uart_base->MODEMSTS |= UART_MODEMSTS_CTSACTLV_Msk;
|
||||||
// Enable CTS
|
|
||||||
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
if (type == FlowControlCTS || type == FlowControlRTSCTS) {
|
||||||
|
// Enable CTS
|
||||||
|
uart_base->INTEN |= UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
} else {
|
||||||
|
// Disable CTS
|
||||||
|
uart_base->INTEN &= ~UART_INTEN_ATOCTSEN_Msk;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue