bolderflight / sbus

Arduino and CMake library for communicating with SBUS receivers and servos.
MIT License
387 stars 136 forks source link

Inverted SBUS signal #25

Closed thetiana closed 3 years ago

thetiana commented 4 years ago

I am making tests with FrSky XSR and ESP32, it works with uninverted XSR hack.

Regarding ESP32 Documentation is possible UART ports to be inverted. This will avoid soldering additional wires on the receiver.

uart.h file section

/**
 * @brief Set UART line inverse mode
 *
 * @param uart_num  UART_NUM_0, UART_NUM_1 or UART_NUM_2
 * @param inverse_mask Choose the wires that need to be inverted.
 *        Inverse_mask should be chosen from 
 *        UART_INVERSE_RXD / UART_INVERSE_TXD / UART_INVERSE_RTS / UART_INVERSE_CTS,
 *        combined with OR operation.
 *
 * @return
 *     - ESP_OK   Success
 *     - ESP_FAIL Parameter error
 */
esp_err_t uart_set_line_inverse(uart_port_t uart_num, uint32_t inverse_mask);
TheDIYGuy999 commented 4 years ago

I have implemented this change in my fork of this library as well as selectable RX & TX pins