|
struct uart * | uart_init (uint8_t port, uint32_t baudrate) |
|
int32_t | uart_deinit (struct uart *uart) |
|
char | uart_getc (struct uart *uart, TickType_t waittime) |
|
int32_t | uart_putc (struct uart *uart, char c, TickType_t waittime) |
|
int32_t | uart_read (struct uart *uart, uint8_t *data, size_t length, TickType_t waittime) |
|
int32_t | uart_write (struct uart *uart, uint8_t *data, size_t length, TickType_t waittime) |
|
int32_t | uart_puts (struct uart *uart, char *s, TickType_t waittime) |
|
char | uart_getcISR (struct uart *uart) |
|
int32_t | uart_putcISR (struct uart *uart, char c) |
|
int32_t | uart_readISR (struct uart *uart, uint8_t *data, size_t length) |
|
int32_t | uart_writeISR (struct uart *uart, uint8_t *data, size_t length) |
|
int32_t | uart_putsISR (struct uart *uart, char *s) |
|
This is the UART Subsystem for controlling UART of a SOC.
◆ uart_deinit()
int32_t uart_deinit |
( |
struct uart * |
uart | ) |
|
Deinit UART Instance
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ uart_getc()
char uart_getc |
( |
struct uart * |
uart, |
|
|
TickType_t |
waittime |
|
) |
| |
reads the next character from UART
- Parameters
-
uart | UART Instance |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- character
◆ uart_getcISR()
char uart_getcISR |
( |
struct uart * |
uart | ) |
|
reads the next character from UART in ISR
- Parameters
-
- Returns
- character
◆ uart_init()
struct uart* uart_init |
( |
uint8_t |
port, |
|
|
uint32_t |
baudrate |
|
) |
| |
Init UART Instance
- Parameters
-
port | Index of UART |
baudrate | UART Baudrate if baudrate == 0 only get Instance |
- Returns
- UART Instance NULL on error
◆ uart_putc()
int32_t uart_putc |
( |
struct uart * |
uart, |
|
|
char |
c, |
|
|
TickType_t |
waittime |
|
) |
| |
wirte character on UART
- Parameters
-
uart | UART Instance |
c | character |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error 0 on ok
◆ uart_putcISR()
int32_t uart_putcISR |
( |
struct uart * |
uart, |
|
|
char |
c |
|
) |
| |
wirte character on UART in ISR
- Parameters
-
uart | UART Instance |
c | character |
- Returns
- -1 on error 0 on ok
◆ uart_puts()
int32_t uart_puts |
( |
struct uart * |
uart, |
|
|
char * |
s, |
|
|
TickType_t |
waittime |
|
) |
| |
Write String on UART and a trailing newline
- Parameters
-
uart | UART Instance |
s | String |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error >= 0 length write on UART
◆ uart_putsISR()
int32_t uart_putsISR |
( |
struct uart * |
uart, |
|
|
char * |
s |
|
) |
| |
Write String on UART and a trailing newline in ISR
- Parameters
-
uart | UART Instance |
s | String |
- Returns
- -1 on error >= 0 length write on UART
◆ uart_read()
int32_t uart_read |
( |
struct uart * |
uart, |
|
|
uint8_t * |
data, |
|
|
size_t |
length, |
|
|
TickType_t |
waittime |
|
) |
| |
Read Data form UART
- Parameters
-
uart | UART Instance |
data | Data |
length | Length of Data |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error >= 0 length read from UART
◆ uart_readISR()
int32_t uart_readISR |
( |
struct uart * |
uart, |
|
|
uint8_t * |
data, |
|
|
size_t |
length |
|
) |
| |
Read Data form UART in ISR
- Parameters
-
uart | UART Instance |
data | Data |
length | Length of Data |
- Returns
- -1 on error >= 0 length read from UART
◆ uart_write()
int32_t uart_write |
( |
struct uart * |
uart, |
|
|
uint8_t * |
data, |
|
|
size_t |
length, |
|
|
TickType_t |
waittime |
|
) |
| |
Write Data on UART
- Parameters
-
uart | UART Instance |
data | Data |
length | Length of Data |
waittime | max waittime in mutex or isr lock see xSemaphoreTake() |
- Returns
- -1 on error >= 0 length write on UART
◆ uart_writeISR()
int32_t uart_writeISR |
( |
struct uart * |
uart, |
|
|
uint8_t * |
data, |
|
|
size_t |
length |
|
) |
| |
Write Data on UART in ISR
- Parameters
-
uart | UART Instance |
data | Data |
length | Length of Data |
- Returns
- -1 on error >= 0 length write on UART