|
Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
|
Interfaces for I2C EEPROM target devices. More...
Typedefs | |
| typedef void(* | eeprom_target_changed_handler_t) (const struct device *dev, void *user_data) |
| Define the application callback handler function signature. | |
Functions | |
| void | eeprom_target_set_changed_callback (const struct device *dev, eeprom_target_changed_handler_t handler, void *user_data) |
| Set the EEPROM changed callback handler. | |
| size_t | eeprom_target_get_size (const struct device *dev) |
| Get size of the virtual EEPROM. | |
| int | eeprom_target_read_data (const struct device *dev, off_t offset, void *data, size_t len) |
| Read data from the virtual EEPROM. | |
| int | eeprom_target_write_data (const struct device *dev, off_t offset, const void *data, size_t len) |
| Write data to the virtual EEPROM. | |
| static int | eeprom_target_program (const struct device *dev, const uint8_t *eeprom_data, unsigned int length) |
| Program memory of the virtual EEPROM. | |
| static int | eeprom_target_read (const struct device *dev, uint8_t *eeprom_data, unsigned int offset) |
| Read single byte of virtual EEPROM memory. | |
| int | eeprom_target_set_addr (const struct device *dev, uint8_t addr) |
| Change the address of eeprom target at runtime. | |
Interfaces for I2C EEPROM target devices.
| typedef void(* eeprom_target_changed_handler_t) (const struct device *dev, void *user_data) |
#include <zephyr/drivers/i2c/target/eeprom.h>
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. |
#include <zephyr/drivers/i2c/target/eeprom.h>
Get size of the virtual EEPROM.
| dev | Pointer to the device structure for the driver instance. |
|
inlinestatic |
#include <zephyr/drivers/i2c/target/eeprom.h>
Program memory of the virtual EEPROM.
| dev | Pointer to the device structure for the driver instance. |
| eeprom_data | Pointer of data to program into the virtual eeprom memory |
| length | Length of data to program into the virtual eeprom memory |
| 0 | If successful. |
| -EINVAL | Invalid data size |
|
inlinestatic |
#include <zephyr/drivers/i2c/target/eeprom.h>
Read single byte of virtual EEPROM memory.
| dev | Pointer to the device structure for the driver instance. |
| eeprom_data | Pointer of byte where to store the virtual eeprom memory |
| offset | Offset into EEPROM memory where to read the byte |
| 0 | If successful. |
| -EINVAL | Invalid data pointer or offset |
#include <zephyr/drivers/i2c/target/eeprom.h>
Read data from the virtual EEPROM.
| 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. |
#include <zephyr/drivers/i2c/target/eeprom.h>
Change the address of eeprom target at runtime.
| dev | Pointer to the device structure for the driver instance. |
| addr | New address to assign to the eeprom 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 eeprom_target_set_changed_callback | ( | const struct device * | dev, |
| eeprom_target_changed_handler_t | handler, | ||
| void * | user_data ) |
#include <zephyr/drivers/i2c/target/eeprom.h>
Set the EEPROM changed callback handler.
| dev | Pointer to the device structure for the driver instance. |
| handler | Handler to call on EEPROM changes |
| user_data | Optional user data passed to callback |
| int eeprom_target_write_data | ( | const struct device * | dev, |
| off_t | offset, | ||
| const void * | data, | ||
| size_t | len ) |
#include <zephyr/drivers/i2c/target/eeprom.h>
Write data to the virtual EEPROM.
| 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. |