Skip to content

Commit 268f282

Browse files
authored
feat(uart): Add UART signal inversion functions
Added functions for UART signal inversion and updated existing function signatures.
1 parent 119082f commit 268f282

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

cores/esp32/esp32-hal-uart.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,14 @@ void uartFlushTxOnly(uart_t *uart, bool txOnly);
6161
bool uartSetBaudRate(uart_t *uart, uint32_t baud_rate);
6262
uint32_t uartGetBaudRate(uart_t *uart);
6363

64-
void uartSetRxInvert(uart_t *uart, bool invert);
65-
void uartSetTxInvert(uart_t *uart, bool invert);
64+
// Helper generic function that takes a uart_sigenl_inv_t mask to be properly applied to the designated uart pin
65+
// invMask can be UART_SIGNAL_RXD_INV, UART_SIGNAL_TXD_INV, UART_SIGNAL_RTS_INV, UART_SIGNAL_CTS_INV
66+
// returns the operation success status
67+
bool uartPinSignalInversion(uart_t *uart, uint32_t invMask, bool inverted);
68+
bool uartSetRxInvert(uart_t *uart, bool invert);
69+
bool uartSetTxInvert(uart_t *uart, bool invert);
70+
bool uartSetCtsInvert(uart_t *uart, bool invert);
71+
bool uartSetRtsInvert(uart_t *uart, bool invert);
6672
bool uartSetRxTimeout(uart_t *uart, uint8_t numSymbTimeout);
6773
bool uartSetRxFIFOFull(uart_t *uart, uint8_t numBytesFIFOFull);
6874
void uartSetFastReading(uart_t *uart);

0 commit comments

Comments
 (0)