Skip to content
Snippets Groups Projects
Commit b6d01c36 authored by David Sidrane's avatar David Sidrane Committed by Lorenz Meier
Browse files

px4fmu-v5:Support RX TX swap

parent 8076b103
No related branches found
No related tags found
No related merge requests found
......@@ -521,7 +521,10 @@
#define RC_UXART_BASE STM32_USART6_BASE
#define RC_SERIAL_PORT "/dev/ttyS4"
#define RC_SERIAL_PORT_IS_FULL_DUPLEX false
#define BOARD_HAS_SINGLE_WIRE 1 /* HW is capable of Single Wire */
#define BOARD_HAS_SINGLE_WIRE_ON_TX 1 /* HW default is wired as Single Wire On TX pin */
#define BOARD_HAS_RX_TX_SWAP 1 /* HW Can swap TX and RX */
#define RC_SERIAL_PORT_IS_SWAPED 0 /* Board wired with RC's TX is on cpu RX */
#define GPS_DEFAULT_UART_PORT "/dev/ttyS0" /* UART1 on FMUv5 */
......
......@@ -130,7 +130,14 @@ __EXPORT void board_rc_input(bool invert_on, uint32_t uxart_base)
putreg32(regval, STM32_USART_CR1_OFFSET + uxart_base);
if (invert_on) {
#if defined(BOARD_HAS_RX_TX_SWAP) && RC_SERIAL_PORT_IS_SWAPED == 1
/* This is only tuned on */
cr2 |= (USART_CR2_RXINV | USART_CR2_TXINV | USART_CR2_SWAP);
#else
cr2 |= (USART_CR2_RXINV | USART_CR2_TXINV);
#endif
} else {
cr2 &= ~(USART_CR2_RXINV | USART_CR2_TXINV);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment