Bridle API 4.1.99
A Zephyr based application framework
Loading...
Searching...
No Matches
SC16IS75x UART Driver

UART part of an SC16IS75x bridge. More...

Data Structures

struct  uart_sc16is75x_config
 
struct  uart_sc16is75x_data
 

Macros

#define UART_SC16IS75X_DEFINE(inst)
 

Functions

static bool uart_sc16is75x_rx_available (const struct device *dev)
 
static bool uart_sc16is75x_tx_possible (const struct device *dev)
 
static int uart_sc16is75x_enable_fifo (const struct device *dev, bool enable)
 
static int uart_sc16is75x_reset_fifos (const struct device *dev)
 
static int uart_sc16is75x_poll_in (const struct device *dev, unsigned char *p_char)
 
static void uart_sc16is75x_poll_out (const struct device *dev, unsigned char out_char)
 
static int uart_sc16is75x_err_check (const struct device *dev)
 
static int uart_sc16is75x_set_baudrate (const struct device *dev, uint32_t baudrate)
 
static int uart_sc16is75x_set_hw_flow_ctrl (const struct device *dev, bool enable)
 
static int uart_sc16is75x_use_modem_pins (const struct device *dev, bool enable)
 
static int uart_sc16is75x_set_rs485_flow_ctrl (const struct device *dev, bool enable)
 
static int uart_sc16is75x_configure (const struct device *dev, const struct uart_config *cfg)
 
static int uart_sc16is75x_callback_set (const struct device *dev, uart_callback_t callback, void *user_data)
 
static int uart_sc16is75x_drv_cmd (const struct device *dev, uint32_t cmd, uint32_t p)
 
static int uart_sc16is75x_pm_device_pm_action (const struct device *const dev, enum pm_device_action action)
 
static int uart_sc16is75x_init (const struct device *dev)
 
 DT_INST_FOREACH_STATUS_OKAY (UART_SC16IS75X_DEFINE)
 

Variables

static const struct uart_driver_api uart_sc16is75x_api
 

Detailed Description

UART part of an SC16IS75x bridge.

Since
3.7
Version
1.0.0

The UART driver part based on the MFD interface to the SC16IS75x SPI/I2C to UART and GPIO controller bridge.

Macro Definition Documentation

◆ UART_SC16IS75X_DEFINE

#define UART_SC16IS75X_DEFINE (   inst)

#include <drivers/serial/uart_sc16is75x.c>

Value:
\
static struct uart_sc16is75x_config uart_sc16is75x_config_##inst = { \
.bus = DEVICE_DT_GET(DT_INST_BUS(inst)), \
.channel = DT_INST_REG_ADDR(inst), \
.clock_frequency = \
DT_PROP_BY_PHANDLE(DT_INST_PARENT(inst), clock, clock_frequency), \
}; \
BUILD_ASSERT(DT_INST_REG_ADDR(inst) < SC16IS75X_UART_CHANNELS_MAX, "Too many channels"); \
\
static struct uart_sc16is75x_data uart_sc16is75x_data_##inst = { \
.uart_config = { \
.baudrate = DT_INST_PROP_OR(inst, current_speed, 9600), \
.parity = DT_INST_ENUM_IDX_OR(inst, parity, UART_CFG_PARITY_EVEN), \
.stop_bits = DT_INST_ENUM_IDX_OR(inst, stop_bits, UART_CFG_STOP_BITS_2), \
.data_bits = DT_INST_ENUM_IDX_OR(inst, data_bits, UART_CFG_DATA_BITS_6), \
.flow_ctrl = COND_CODE_1(DT_INST_PROP_OR(inst, \
hw_flow_control, false), \
(UART_CFG_FLOW_CTRL_RTS_CTS), \
(UART_CFG_FLOW_CTRL_NONE)), \
}, \
}; \
\
PM_DEVICE_DT_INST_DEFINE(inst, uart_sc16is75x_pm_device_pm_action); \
\
DEVICE_DT_INST_DEFINE(inst, uart_sc16is75x_init, PM_DEVICE_DT_INST_GET(inst), \
&uart_sc16is75x_data_##inst, &uart_sc16is75x_config_##inst, \
POST_KERNEL, CONFIG_UART_SC16IS75X_INIT_PRIORITY, \
static const struct uart_driver_api uart_sc16is75x_api
Definition uart_sc16is75x.c:1008
static int uart_sc16is75x_pm_device_pm_action(const struct device *const dev, enum pm_device_action action)
Definition uart_sc16is75x.c:1066
static int uart_sc16is75x_init(const struct device *dev)
Definition uart_sc16is75x.c:1075
#define SC16IS75X_UART_CHANNELS_MAX
Maximum UART channels.
Definition sc16is75x.h:271
Definition uart_sc16is75x.c:38
uint32_t clock_frequency
Definition uart_sc16is75x.c:41
const struct device * bus
Definition uart_sc16is75x.c:39
Definition uart_sc16is75x.c:44

Function Documentation

◆ DT_INST_FOREACH_STATUS_OKAY()

DT_INST_FOREACH_STATUS_OKAY ( UART_SC16IS75X_DEFINE  )

◆ uart_sc16is75x_callback_set()

static int uart_sc16is75x_callback_set ( const struct device *  dev,
uart_callback_t  callback,
void *  user_data 
)
static

◆ uart_sc16is75x_configure()

static int uart_sc16is75x_configure ( const struct device *  dev,
const struct uart_config *  cfg 
)
static

◆ uart_sc16is75x_drv_cmd()

static int uart_sc16is75x_drv_cmd ( const struct device *  dev,
uint32_t  cmd,
uint32_t  p 
)
static

◆ uart_sc16is75x_enable_fifo()

static int uart_sc16is75x_enable_fifo ( const struct device *  dev,
bool  enable 
)
static

◆ uart_sc16is75x_err_check()

static int uart_sc16is75x_err_check ( const struct device *  dev)
static

◆ uart_sc16is75x_init()

static int uart_sc16is75x_init ( const struct device *  dev)
static

◆ uart_sc16is75x_pm_device_pm_action()

static int uart_sc16is75x_pm_device_pm_action ( const struct device *const  dev,
enum pm_device_action  action 
)
static

◆ uart_sc16is75x_poll_in()

static int uart_sc16is75x_poll_in ( const struct device *  dev,
unsigned char *  p_char 
)
static

◆ uart_sc16is75x_poll_out()

static void uart_sc16is75x_poll_out ( const struct device *  dev,
unsigned char  out_char 
)
static

◆ uart_sc16is75x_reset_fifos()

static int uart_sc16is75x_reset_fifos ( const struct device *  dev)
static

◆ uart_sc16is75x_rx_available()

static bool uart_sc16is75x_rx_available ( const struct device *  dev)
static

◆ uart_sc16is75x_set_baudrate()

static int uart_sc16is75x_set_baudrate ( const struct device *  dev,
uint32_t  baudrate 
)
static

◆ uart_sc16is75x_set_hw_flow_ctrl()

static int uart_sc16is75x_set_hw_flow_ctrl ( const struct device *  dev,
bool  enable 
)
static

◆ uart_sc16is75x_set_rs485_flow_ctrl()

static int uart_sc16is75x_set_rs485_flow_ctrl ( const struct device *  dev,
bool  enable 
)
static

◆ uart_sc16is75x_tx_possible()

static bool uart_sc16is75x_tx_possible ( const struct device *  dev)
static

◆ uart_sc16is75x_use_modem_pins()

static int uart_sc16is75x_use_modem_pins ( const struct device *  dev,
bool  enable 
)
static

Variable Documentation

◆ uart_sc16is75x_api

const struct uart_driver_api uart_sc16is75x_api
static

#include <drivers/serial/uart_sc16is75x.c>

Initial value:
= {
.callback_set = uart_sc16is75x_callback_set,
.tx = NULL,
.tx_abort = NULL,
.rx_enable = NULL,
.rx_buf_rsp = NULL,
.rx_disable = NULL,
.uart_sc16is75x_drv_cmd = uart_sc16is75x_drv_cmd,
}
static int uart_sc16is75x_poll_in(const struct device *dev, unsigned char *p_char)
Definition uart_sc16is75x.c:136
static int uart_sc16is75x_callback_set(const struct device *dev, uart_callback_t callback, void *user_data)
Definition uart_sc16is75x.c:983
static void uart_sc16is75x_poll_out(const struct device *dev, unsigned char out_char)
Definition uart_sc16is75x.c:147
static int uart_sc16is75x_drv_cmd(const struct device *dev, uint32_t cmd, uint32_t p)
Definition uart_sc16is75x.c:997
static int uart_sc16is75x_err_check(const struct device *dev)
Definition uart_sc16is75x.c:220