12#ifndef ZEPHYR_INCLUDE_DRIVERS_UART_MUX_H_
13#define ZEPHYR_INCLUDE_DRIVERS_UART_MUX_H_
44 bool connected,
void *user_data);
84 return api->
attach(mux, uart, dlci_address, cb, user_data);
120 int dlci_address,
void *user_data);
154#include <syscalls/uart_mux.h>
Public APIs for UART drivers.
void uart_mux_disable(const struct device *dev)
Disable the mux.
const struct device * uart_mux_find(int dlci_address)
Get UART related to a specific DLCI channel.
const struct device * uart_mux_alloc(void)
Allocate muxing UART device.
static int uart_mux_attach(const struct device *mux, const struct device *uart, int dlci_address, uart_mux_attach_cb_t cb, void *user_data)
Attach physical/real UART to UART muxing device.
Definition: uart_mux.h:76
void(* uart_mux_attach_cb_t)(const struct device *mux, int dlci_address, bool connected, void *user_data)
Define the user callback function which is called when the UART mux is attached properly.
Definition: uart_mux.h:42
void uart_mux_enable(const struct device *dev)
Enable the mux.
void(* uart_mux_cb_t)(const struct device *uart, const struct device *dev, int dlci_address, void *user_data)
Callback used while iterating over UART muxes.
Definition: uart_mux.h:118
void uart_mux_foreach(uart_mux_cb_t cb, void *user_data)
Go through all the UART muxes and call callback for each of them.
Runtime device structure (in ROM) per driver instance.
Definition: device.h:399
const void * api
Address of the API structure exposed by the device instance.
Definition: device.h:405
UART mux driver API structure.
Definition: uart_mux.h:47
int(* attach)(const struct device *mux, const struct device *uart, int dlci_address, uart_mux_attach_cb_t cb, void *user_data)
Attach the mux to this UART.
Definition: uart_mux.h:59
struct uart_driver_api uart_api
The uart_driver_api must be placed in first position in this struct so that we are compatible with ua...
Definition: uart_mux.h:53