device/class/uart.h header reference
[Devices support library module]
The source code of this header can be browsed online.
Description
UART class only defines configuration parameters for UART devices. Data path of UART devices goes through the Character device class.
Parameters addresed by this class are:
Baud rate,
Character bit size,
Character framing (Start, stop bits, parity),
Line control (flow control)
See also DRIVER_CLASS_UART.
Members
Types
- struct dev_uart_config_s
- typedef error_t (dev_uart_config_t)(struct device_uart_s *accessor, struct dev_uart_config_s *cfg)
- enum dev_uart_parity_e
- struct device_uart_s
- struct driver_uart_s
Functions
- error_t dev_uart_config(struct device_uart_s *accessor, struct dev_uart_config_s *cfg)
- error_t device_get_res_uart(const struct device_s *dev, struct dev_uart_config_s *cfg)
- error_t device_res_add_uart(struct device_s *dev, const struct dev_uart_config_s *cfg)
- struct device_accessor_s * device_uart_s_base(struct device_uart_s *x)
- struct device_uart_s * device_uart_s_cast(struct device_accessor_s *x)
Constant
- const char dev_uart_parity_e[]
Macros
Members detail
This macro is declared in device/class/uart.h source file, line 154.
This macro specifies an UART configuration resource entry in a static device resources table declaration.
See also DEV_RES_UART and DEV_DECLARE_STATIC.
This macro is declared in device/class/uart.h source file, line 85.
See also dev_uart_config_t.
This macro is declared in device/class/uart.h source file, line 96.
See also struct driver_uart_s.
This macro is declared in device/class/uart.h source file, line 42.
error_t dev_uart_config(struct device_uart_s *accessor, struct dev_uart_config_s *cfg)
This function is declared in device/class/uart.h source file, line 108.
This function is a wrapper for the dev_uart_config_t function
This struct is declared in device/class/uart.h source file, line 64.
This struct structure describes the configuration of a UART device.
typedef error_t (dev_uart_config_t)(struct device_uart_s *accessor, struct dev_uart_config_s *cfg)
This typedef is declared in device/class/uart.h source file, line 90.
This typedef configures the uart device with the given configuration.
This declaration involves expansion of the DEV_UART_CONFIG macro.
This variable is declared in ENUM_DESCRIPTOR function like macro expansion, line 1 in device/class/uart.h source file, line 52.
Alternate declarations with same identifier: [1], [2].
This enum is declared in device/class/uart.h source file, line 56.
UART parity.
Alternate declarations with same identifier: [1], [2].
Identifier | Description |
---|---|
DEV_UART_PARITY_NONE | |
DEV_UART_PARITY_ODD | |
DEV_UART_PARITY_EVEN |
error_t device_get_res_uart(const struct device_s *dev, struct dev_uart_config_s *cfg)
This function is declared in device/class/uart.h source file, line 136.
error_t device_res_add_uart(struct device_s *dev, const struct dev_uart_config_s *cfg)
This function is declared in device/class/uart.h source file, line 132.
This function appends a UART resource entry to the device tree.
This is available when CONFIG_DEVICE_UART and CONFIG_DEVICE_RESOURCE_ALLOC are both defined.
See also DEV_RES_UART.
This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 18 in device/class/uart.h source file, line 94.
This struct is the device accessor object type for the uart device class. This accessor must be initialized by calling the device_get_accessor function.
See also DRIVER_CLASS_UART, struct device_accessor_s and Device accessor.
Field | Description |
---|---|
union <anonymous> { | |
struct device_accessor_s base; | |
struct <anonymous> { | |
struct device_s * dev; | |
struct driver_uart_s * api; | |
uint_fast8_t number; | |
}; | |
}; |
struct device_accessor_s * device_uart_s_base(struct device_uart_s *x)
This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 39 in device/class/uart.h source file, line 94.
This function casts a uart device accessor to a generic device accessor
struct device_uart_s * device_uart_s_cast(struct device_accessor_s *x)
This function is declared in DRIVER_CLASS_TYPES function like macro expansion, line 32 in device/class/uart.h source file, line 94.
This function casts a generic device accessor to a uart device accessor
This struct is declared in DRIVER_CLASS_TYPES function like macro expansion, line 5 in device/class/uart.h source file, line 94.
This struct is the driver API descriptor for the uart device class.
See also DRIVER_CLASS_UART and struct driver_class_s.
Field | Description |
---|---|
uint16_t class_; | |
uint16_t ctx_offset; | |
dev_uart_config_t * f_config; |