From 8c6fee3e400a1be9b9a287dd7713f8635907d940 Mon Sep 17 00:00:00 2001 From: Andrew Yong Date: Sat, 29 Mar 2025 14:30:04 +0800 Subject: [PATCH] Updated API HardwareSerial Rx/Tx/Data Invert docs Update documentation to support [stm32duino/Arduino_Core_STM32#2701](https://github.com/stm32duino/Arduino_Core_STM32/pull/2701) Signed-off-by: Andrew Yong --- API.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/API.md b/API.md index 434f14e..b12aa70 100644 --- a/API.md +++ b/API.md @@ -335,6 +335,19 @@ serial.setRtsCts(PA12, PA11); serial.begin(460800); ``` +#### Enable Tx, Rx Pin Active Level and/or Data Inversion + +Available in core version greater than **2.10.1** + +The U(S)ART Tx and Rx pin signal values can be inverted (VDD = 0/mark, Gnd = 1/idle), and the U(S)ART can send and receive data in negative/inverse logic (1 = L, 0 = H); the +parity bit is also inverted. + +* Enable Tx and Rx active level inversion on `HardwareSerial` instances, respectively: + * `void setTxInvert(void)` + * `void setRxInvert(void)` +* Enable data inversion on `HardwareSerial` instances: + * `void setDataInvert(void)` + ## [[HardwareTimer library]]