samd/machine_uart: Add the machine.UART class.

All board pins that have UART's assigned can be used.  Baud rate range is
75 Baud to ~2 MBaud.

No flow control yet, and only RX is buffered.  TX buffer and flow control
may be added later for SAMD51 with its larger RAM and Flash.
This commit is contained in:
robert-hh
2022-06-05 15:03:52 +02:00
committed by Damien George
parent 7d281f6165
commit b33f204529
7 changed files with 484 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ extern uint8_t _sstack, _estack, _sheap, _eheap;
extern void adc_deinit_all(void);
extern void pin_irq_deinit_all(void);
extern void pwm_deinit_all(void);
extern void uart_deinit_all(void);
void samd_main(void) {
mp_stack_set_top(&_estack);
@@ -68,6 +69,7 @@ void samd_main(void) {
adc_deinit_all();
pin_irq_deinit_all();
pwm_deinit_all();
uart_deinit_all();
gc_sweep_all();
mp_deinit();
}