|
Zephyr Project API 4.4.99
A Scalable Open Source RTOS
|
Public APIs for the I2C target library. More...
Go to the source code of this file.
Data Structures | |
| struct | regset_target_lib_data |
| Register set library config. More... | |
| struct | regset_target_lib_config |
| Register set library data. More... | |
Macros | |
| #define | REGSET_TARGET_LIB_STRUCT_CHECK(config, data) |
| Validate the offset of the regset data structures. | |
| #define | REGSET_TARGET_LIB_DT_BUILD_ASSERT(node_id) |
| Validate the node properties from devicetree. | |
| #define | REGSET_TARGET_LIB_DT_INST_BUILD_ASSERT(inst) |
| Validate the node properties from a devicetree instance. | |
| #define | REGSET_TARGET_LIB_DT_CONFIG_INIT(node_id) |
| Define the common data structure from devicetree. | |
| #define | REGSET_TARGET_LIB_DT_INST_CONFIG_INIT(inst) |
| Define the common data structure from a devicetree instance. | |
Typedefs | |
| typedef void(* | regset_target_lib_changed_handler_t) (const struct device *dev, void *user_data) |
| Define the application callback handler function signature. | |
Functions | |
| void | regset_target_lib_set_changed_callback (const struct device *dev, regset_target_lib_changed_handler_t handler, void *user_data) |
| Set the regset changed callback handler. | |
| size_t | regset_target_lib_get_size (const struct device *dev) |
| Get size of the register set. | |
| int | regset_target_lib_read_data (const struct device *dev, off_t offset, void *data, size_t len) |
| Read data from the register set. | |
| int | regset_target_lib_write_data (const struct device *dev, off_t offset, const void *data, size_t len) |
| Write data to the register set. | |
| int | regset_target_lib_set_addr (const struct device *dev, uint8_t addr) |
| Change the address of register set target at runtime. | |
| int | regset_target_lib_init (const struct device *dev) |
| Initialize the register set data structures. | |
Variables | |
| const struct i2c_target_driver_api | regset_target_api |
| Generig register set library i2c target API. | |
Public APIs for the I2C target library.
| #define REGSET_TARGET_LIB_DT_BUILD_ASSERT | ( | node_id | ) |
Validate the node properties from devicetree.
| #define REGSET_TARGET_LIB_DT_CONFIG_INIT | ( | node_id | ) |
Define the common data structure from devicetree.
| #define REGSET_TARGET_LIB_DT_INST_BUILD_ASSERT | ( | inst | ) |
Validate the node properties from a devicetree instance.
| #define REGSET_TARGET_LIB_DT_INST_CONFIG_INIT | ( | inst | ) |
Define the common data structure from a devicetree instance.
| #define REGSET_TARGET_LIB_STRUCT_CHECK | ( | config, | |
| data ) |
Validate the offset of the regset data structures.
| config | Name of the config structure. |
| data | Name of the data structure. |
| typedef void(* regset_target_lib_changed_handler_t) (const struct device *dev, void *user_data) |
Define the application callback handler function signature.
| dev | Pointer to the device structure for the driver instance. |
| user_data | Optional user data provided when callback is set. |
| size_t regset_target_lib_get_size | ( | const struct device * | dev | ) |
Get size of the register set.
| dev | Pointer to the device structure for the driver instance. |
| int regset_target_lib_init | ( | const struct device * | dev | ) |
Initialize the register set data structures.
| dev | Pointer to the device structure for the driver instance. |
| int regset_target_lib_read_data | ( | const struct device * | dev, |
| off_t | offset, | ||
| void * | data, | ||
| size_t | len ) |
Read data from the register set.
| dev | Pointer to the device structure for the driver instance. |
| offset | Address offset to read from. |
| data | Buffer to store read data. |
| len | Number of bytes to read. |
Change the address of register set target at runtime.
| dev | Pointer to the device structure for the driver instance. |
| addr | New address to assign to the register set target device |
| 0 | Is successful |
| -EINVAL | If parameters are invalid |
| -EIO | General input / output error during i2c_taget_register |
| -ENOSYS | If target mode is not implemented |
| void regset_target_lib_set_changed_callback | ( | const struct device * | dev, |
| regset_target_lib_changed_handler_t | handler, | ||
| void * | user_data ) |
Set the regset changed callback handler.
| dev | Pointer to the device structure for the driver instance. |
| handler | Handler to call on regset changes |
| user_data | Optional user data passed to callback |
| int regset_target_lib_write_data | ( | const struct device * | dev, |
| off_t | offset, | ||
| const void * | data, | ||
| size_t | len ) |
Write data to the register set.
| dev | Pointer to the device structure for the driver instance. |
| offset | Address offset to write data to. |
| data | Buffer with data to write. |
| len | Number of bytes to write. |
|
extern |
Generig register set library i2c target API.