HAL_ChibiOS: added support for swapping UART pins
This commit is contained in:
parent
bed7939969
commit
013f1d55e8
@ -1117,6 +1117,13 @@ bool UARTDriver::set_options(uint8_t options)
|
||||
} else {
|
||||
cr2 &= ~USART_CR2_TXINV;
|
||||
}
|
||||
// F7 can also support swapping RX and TX pins
|
||||
if (options & OPTION_SWAP) {
|
||||
cr2 |= USART_CR2_SWAP;
|
||||
_cr2_options |= USART_CR2_SWAP;
|
||||
} else {
|
||||
cr2 &= ~USART_CR2_SWAP;
|
||||
}
|
||||
#else // STM32F4
|
||||
// F4 can do inversion by GPIO if enabled in hwdef.dat, using
|
||||
// TXINV and RXINV options
|
||||
@ -1134,6 +1141,9 @@ bool UARTDriver::set_options(uint8_t options)
|
||||
ret = false;
|
||||
}
|
||||
}
|
||||
if (options & OPTION_SWAP) {
|
||||
ret = false;
|
||||
}
|
||||
#endif // STM32xx
|
||||
|
||||
// both F4 and F7 can do half-duplex
|
||||
|
Loading…
Reference in New Issue
Block a user