28 #ifdef CONFIG_UART_MULTI
33 struct uart *(*uart_init)(uint8_t port, uint32_t baudrate);
37 # ifndef CONFIG_UART_GENERIC_BYTE
38 int32_t (*
uart_read)(
struct uart *
uart, uint8_t *data,
size_t length, TickType_t waittime);
39 int32_t (*
uart_write)(
struct uart *
uart, uint8_t *data,
size_t length, TickType_t waittime);
41 # ifndef CONFIG_UART_GENERIC_STRING
47 # ifndef CONFIG_UART_GENERIC_BYTE
51 # ifndef CONFIG_UART_GENERIC_STRING
66 #ifdef CONFIG_INSTANCE_NAME
72 #ifdef CONFIG_UART_THREAD_SAVE
78 #ifdef CONFIG_UART_MULTI
82 const struct uart_ops *ops;
85 #ifndef CONFIG_UART_MULTI
178 inline struct uart *
uart_init(uint8_t port, uint32_t baudrate) {
184 return uart->ops->uart_init(port, baudrate);
188 return u->ops->uart_deinit(
uart);
192 return u->ops->uart_getc(
uart, waittime);
196 return u->ops->uart_putc(
uart, c, waittime);
198 # ifndef CONFIG_UART_GENERIC_BYTE
199 inline int32_t
uart_read(
struct uart *
uart, uint8_t *data,
size_t length, TickType_t waittime) {
201 return u->ops->uart_read(
uart, data, length, waittime);
203 inline int32_t
uart_write(
struct uart *
uart, uint8_t *data,
size_t length, TickType_t waittime) {
205 return u->ops->uart_write(
uart, data, length, waittime);
208 int32_t
uart_read(
struct uart *
uart, uint8_t *data,
size_t length, TickType_t waittime);
209 int32_t
uart_write(
struct uart *
uart, uint8_t *data,
size_t length, TickType_t waittime);
211 # ifndef CONFIG_UART_GENERIC_STRING
214 return u->ops->uart_puts(
uart, s, waittime);
221 return u->ops->uart_getcISR(
uart);
225 return u->ops->uart_putcISR(
uart, c);
227 # ifndef CONFIG_UART_GENERIC_BYTE
230 return u->ops->uart_readISR(
uart, data, length);
234 return u->ops->uart_writeISR(
uart, data, length);
237 # ifndef CONFIG_UART_GENERIC_STRING
240 return u->ops->uart_putsISR(
uart, s);