I have a similar issue. I want to use the ESP32 with RS485. I have used the Arduino and this works well assigning pins, but it seems not to allow full use of the UART.
I see the new uarts in the ESP32 can support the direction control (RTS) of the direction pin and there is actually a hardware RS485 mode. See the repository that the board package is based on: https://github.com/espressif/arduino-esp32
This shows we can actually have full hardware flow control, so no more guessing delays for controlling the DIR lines or getting interrupts when the send buffer is empty in order to know when to switch back to receive.
I found using board manager this did not all get installed, so I followed some tutorials on how to install it manually. The board either doesn't appear at all, or I can't reference "uart.h".
Any ideas or examples? Thanks, Mark