AtomVM icon indicating copy to clipboard operation
AtomVM copied to clipboard

Review UART API

Open bettio opened this issue 2 years ago • 2 comments

UART driver has the following API right now:

Following general UART options are available:

name: string() speed: integer() data_bits: integer() stop_bits: integer() flow_control: [none, hardware, software] parity: [none, even, odd]

In addition UART pins can be configured:

rx_pin: integer() tx_pin: integer() rts_pin: integer() cts_pin: integer()

The following ESP32 specific option is exposed:

event_queue_len: integer()

The API should be reviewed and discussed before next release.

bettio avatar Jul 28 '23 20:07 bettio

Proposal 1: rx_pin -> rx tx_pin -> tx rts_pin -> rts cts_pin -> cts

This follows the same approach that we are discussing for #707 and #651.

bettio avatar Jul 29 '23 13:07 bettio

Proposal 2: Keys such as event_queue_len should be moved to opts, so we can use opts for any platform / implementation specific detail.

bettio avatar Jul 29 '23 14:07 bettio