23#ifndef PROTOCORE_UART_H
24#define PROTOCORE_UART_H
35#ifndef PROTOCORE_UART_TIMEOUT_MS
36#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);
EMBED_INLINE embed_bool protocore_uart_read_byte(uint8_t unit, uint8_t *out)
EMBED_INLINE embed_bool protocore_uart_write(uint8_t unit, const uint8_t *buf, size_t len)
EMBED_INLINE size_t protocore_uart_read(uint8_t unit, uint8_t *buf, size_t len, uint32_t ms)
EMBED_INLINE size_t protocore_uart_available(uint8_t unit)
EMBED_BEGIN_DECLS EMBED_INLINE embed_bool protocore_uart_begin(uint8_t unit, uint32_t baud, int rx_pin, int tx_pin)