This optional macro must be defined before including the driver:
#define USART_RX_BUF_N <fill-with-buffer-size>
The default size is 32
bytes.
#include "usart.ceu"
Initializes the USART.
code/await USART_Init (var int bps) -> NEVER;
Parameters:
int
: transmission speed inbps
Return:
NEVER
: never returns
Transmits a given buffer.
code/await USART_Tx (var&[] byte buf) -> none;
Parameters:
&[] byte
: reference to buffer to transmit
Return:
none
: as soon as the transmission terminates
The given buffer is copied to the driver buffer, which transmits the bytes in the background.
Receives incoming bytes to a given buffer.
code/await USART_Rx (var&[] byte buf, var usize? n) -> none;
Parameters:
&[] byte
: reference to buffer to receiveusize?
: minimum number of bytes to receive (default: as soon as something is received)
Return:
none
: as soon as the requested number of bytes is received
TODO