123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- #ifndef ZEPHYR_INCLUDE_DRIVERS_UART_MUX_H_
- #define ZEPHYR_INCLUDE_DRIVERS_UART_MUX_H_
- #include <device.h>
- #include <drivers/uart.h>
- #ifdef __cplusplus
- extern "C" {
- #endif
- struct gsm_dlci;
- typedef void (*uart_mux_attach_cb_t)(const struct device *mux,
- int dlci_address,
- bool connected, void *user_data);
- __subsystem struct uart_mux_driver_api {
-
- struct uart_driver_api uart_api;
-
- int (*attach)(const struct device *mux, const struct device *uart,
- int dlci_address, uart_mux_attach_cb_t cb,
- void *user_data);
- };
- static inline int uart_mux_attach(const struct device *mux,
- const struct device *uart,
- int dlci_address, uart_mux_attach_cb_t cb,
- void *user_data)
- {
- const struct uart_mux_driver_api *api =
- (const struct uart_mux_driver_api *)mux->api;
- return api->attach(mux, uart, dlci_address, cb, user_data);
- }
- __syscall const struct device *uart_mux_find(int dlci_address);
- const struct device *uart_mux_alloc(void);
- typedef void (*uart_mux_cb_t)(const struct device *uart,
- const struct device *dev,
- int dlci_address, void *user_data);
- void uart_mux_foreach(uart_mux_cb_t cb, void *user_data);
- void uart_mux_disable(const struct device *dev);
- void uart_mux_enable(const struct device *dev);
- #ifdef __cplusplus
- }
- #endif
- #include <syscalls/uart_mux.h>
- #endif
|