# ESP32 RMT UART for ESP-IDF v5.x
Component for Espressif ESP32 ESP-IDF framework.
This components uses ESP32's RMT peripheral as an UART port. It can send and receive UART frames as well.
## Supported versions of frameworks and devices
| Chip | Framework | Versions | Number of UART
|----------|--------------------|----------|-----------------
| ESP32-S2 | ESP-IDF | v5.x | 2
| ESP32-S3 | ESP-IDF | v5.x | 4
| ESP32-C3 | ESP-IDF | v5.x | 2
| ESP32-C6 | ESP-IDF | v5.x | 2
## How to Use
Clone this repository to your project components directory.
## Configuration
```c
typedef struct {
int baud_rate; /*!< UART baud rate*/
rmt_uart_mode_t mode; /*!< UART mode*/
rmt_uart_word_length_t data_bits; /*!< UART byte size*/
rmt_uart_parity_t parity; /*!< UART parity mode*/
rmt_uart_stop_bits_t stop_bits; /*!< UART stop bits*/
gpio_num_t tx_io_num;
gpio_num_t rx_io_num;
size_t buffer_size;
} rmt_uart_config_t;
```
Mode can be TX only, RX only or both TX and RX.
Buffer size must be 20 times of the length of transmit/receive data.
If you want to send 10 bytes maximum then buffer_size = 200.
## Restrictions
Due to hardware limitations ESP32-S2 can only receive 12 bytes at once. In RX only mode this limit is 24 bytes. Transmit has no restriction.
To create a project from this example, run:
idf.py create-project-from-example "brmmm3/esp32_rmt_uart_v5=1.0.1:2components"