samd/machine_uart: Add support for UART hardware flow control.

By specifying rts=pin(x) and/or cts=Pin(x) in the constructor.  The pad
numbers for the UART pins are fix in this case: TX must be at pad 0, RX at
pad 1, RTS at pad 2 and CTS at pad 3.

repr(uart) shows the pin names for rts and cts, if set.  In case of a RX
overflow, the rx interrupt will be disabled instead of just discarding the
data.  That allows RTS to act.

If RTS is inactive, still 2 bytes can be buffered in the FIFO.

Signed-off-by: robert-hh <robert@hammelrath.com>
This commit is contained in:
robert-hh
2023-04-04 16:12:45 +02:00
committed by Damien George
parent 2a38531d73
commit 20fd22edad
3 changed files with 73 additions and 10 deletions

View File

@@ -83,7 +83,9 @@ Examples for Adafruit ItsyBitsy M0 Express:
- uart 4 at pins D2/D5
- uart 5 at pins SCL/SDA
or other combinations.
or other combinations. For hardware flow control, tx must be at pad 0, rx at pad 1,
rts at pad 2 and cts at pad 3. This applies for instance to
UART 3 or UART 1 at the pins D13/D11/D10/D12 for rx/tx/rts/cts.
SAMD21 I2C assignments
``````````````````````
@@ -214,7 +216,9 @@ Examples for Adafruit ItsyBitsy 4 Express:
- uart 4 at pins SDA/SCL
- uart 5 at pins D12/D13
or other combinations.
or other combinations. For hardware flow control, tx must be at pad 0, rx at pad 1,
rts at pad 2 and cts at pad 3. This applies for instance to
UART 5 at the pins D12/D13/D10/D11 for rx/tx/rts/cts.
SAMD51 I2C assignments
``````````````````````