Simple UART driver.
More...
|
uint8_t | simple_uart_get (void) |
| Function for reading a character from UART. Execution is blocked until UART peripheral detects character has been received. More...
|
|
bool | simple_uart_get_with_timeout (int32_t timeout_ms, uint8_t *rx_data) |
| Function for reading a character from UART with timeout on how long to wait for the byte to be received. Execution is blocked until UART peripheral detects character has been received or until the timeout expires, which even occurs first. More...
|
|
void | simple_uart_put (uint8_t cr) |
| Function for sending a character to UART. Execution is blocked until UART peripheral reports character to have been send. More...
|
|
void | simple_uart_putstring (const uint8_t *str) |
| Function for sending a string to UART. Execution is blocked until UART peripheral reports all characters to have been send. Maximum string length is 254 characters including null character in the end. More...
|
|
void | simple_uart_config (uint8_t rts_pin_number, uint8_t txd_pin_number, uint8_t cts_pin_number, uint8_t rxd_pin_number, bool hwfc) |
| Function for configuring UART to use 38400 baud rate. More...
|
|
uint8_t simple_uart_get |
( |
void |
| ) |
|
- Returns
- cr Received character.
bool simple_uart_get_with_timeout |
( |
int32_t |
timeout_ms, |
|
|
uint8_t * |
rx_data |
|
) |
| |
- Returns
- bool True, if byte is received before timeout, else returns False.
- Parameters
-
timeout_ms | maximum time to wait for the data. |
rx_data | pointer to the memory where the received data is stored. |
void simple_uart_put |
( |
uint8_t |
cr | ) |
|
void simple_uart_putstring |
( |
const uint8_t * |
str | ) |
|
- Parameters
-
str | Null terminated string to send. |
void simple_uart_config |
( |
uint8_t |
rts_pin_number, |
|
|
uint8_t |
txd_pin_number, |
|
|
uint8_t |
cts_pin_number, |
|
|
uint8_t |
rxd_pin_number, |
|
|
bool |
hwfc |
|
) |
| |
- Parameters
-
rts_pin_number | Chip pin number to be used for UART RTS |
txd_pin_number | Chip pin number to be used for UART TXD |
cts_pin_number | Chip pin number to be used for UART CTS |
rxd_pin_number | Chip pin number to be used for UART RXD |
hwfc | Enable hardware flow control |