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  

Functions  

Constant  

Macros  

Members detail  

#define DEV_STATIC_RES_UART(__baudrate, __data, __parity, __stop, __flow)  

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.

#define DEV_UART_CONFIG(n)  

This macro is declared in device/class/uart.h source file, line 85.

See also dev_uart_config_t.

#define DRIVER_UART_METHODS(prefix)  

This macro is declared in device/class/uart.h source file, line 96.

See also struct driver_uart_s.

#define __DEVICE_UART_H__  

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

struct dev_uart_config_s  

This struct is declared in device/class/uart.h source file, line 64.

This struct structure describes the configuration of a UART device.

FieldDescription
uint32_t baudrate:22;baud rate in bps.
uint32_t data_bits:5;data bits.
uint32_t stop_bits:2;stop bits.
uint32_t flow_ctrl:1;flow control.
enum dev_uart_parity_e parity:2;parity.

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.

const char dev_uart_parity_e[]  

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].

enum dev_uart_parity_e  

This enum is declared in device/class/uart.h source file, line 56.

UART parity.

Alternate declarations with same identifier: [1], [2].

IdentifierDescription
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.

struct device_uart_s  

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.

FieldDescription
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

struct driver_uart_s  

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.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Apr 18 16:57:35 2018 using MkDoc