23#ifndef PROTOCORE_UART_H
24#define PROTOCORE_UART_H
33#ifndef PROTOCORE_UART_TIMEOUT_MS
34#define PROTOCORE_UART_TIMEOUT_MS 20u
42 return protocore_platform_uart_begin(unit, baud, rx_pin, tx_pin) != 0;
48 return protocore_platform_uart_write(unit, buf, (
int)len) == (int)len;
57 int n = protocore_platform_uart_read(unit, buf, (uint32_t)len, ms);
58 return n > 0 ? (size_t)n : 0u;
64 return (
size_t)protocore_platform_uart_available(unit);
#define PROTOCORE_INLINE
Linkage for a leaf primitive whose body is cheaper than the call that reaches it.
#define PROTO_FALSE
the false value
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTO_TRUE
the true value, spelled so a caller never writes a bare 1
#define PROTOCORE_END_DECLS
PROTOCORE_INLINE size_t protocore_uart_available(uint8_t unit)
PROTOCORE_INLINE proto_bool protocore_uart_begin(uint8_t unit, uint32_t baud, int rx_pin, int tx_pin)
PROTOCORE_INLINE proto_bool protocore_uart_read_byte(uint8_t unit, uint8_t *out)
PROTOCORE_INLINE size_t protocore_uart_read(uint8_t unit, uint8_t *buf, size_t len, uint32_t ms)
PROTOCORE_INLINE proto_bool protocore_uart_write(uint8_t unit, const uint8_t *buf, size_t len)