#include "board.h"
#include "hpm_i2c_drv.h"
#include "eeprom_device.h"
Go to the source code of this file.
◆ HPM_E2P_I2C_ADD_CUSTOM_ID_TO_DEV_ID
| #define HPM_E2P_I2C_ADD_CUSTOM_ID_TO_DEV_ID |
( |
|
dev_id, |
|
|
|
custom_id |
|
) |
| ((((uint32_t)(custom_id)) << 16) | ((uint32_t)(dev_id))) |
◆ HPM_E2P_I2C_DEV_ADDR
| #define HPM_E2P_I2C_DEV_ADDR |
( |
|
family_id, |
|
|
|
custom_id |
|
) |
| ((uint8_t)(family_id) | (uint8_t)(custom_id)) |
eeprom i2c device address definition macro
◆ e2p_device_i2c_deinit()
De-initialize eeprom i2c device.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
- Return values
-
| status_success | De-initialize eeprom i2c device. |
◆ e2p_device_i2c_get_attribute()
Get eeprom i2c device attribute.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
- Return values
-
| Pointer | to eeprom i2c device attribute structure |
◆ e2p_device_i2c_init()
Initialize eeprom i2c device, hw init(clock and pin) and i2c master init.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
- Return values
-
| status_success,or | status_fail if initialization fails |
◆ e2p_device_i2c_read()
Read data from eeprom i2c device.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
| [in] | data_addr | Data address to read from |
| [in] | len | Length of data to read |
| [out] | data | Pointer to buffer to store read data |
- Return values
-
| status_success | or status_fail if reading fails or status_invalid_argument if invalid argument is detected or status_timeout if timeout occurs during reading or status_i2c_no_addr_hit if no acknowledge from slave device |
- Note
- This function will handle page splitting and borrow bits internally, and call e2p_device_i2c_page_read; so the user does not need to worry about these details.
◆ e2p_device_i2c_register_param()
Register eeprom i2c device parameter to device structure.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
| [in] | host_info | Pointer to eeprom i2c host configuration structure |
| [in] | dev_id | Eeprom device id |
- Return values
-
| status_success,or | status_fail if dev_id is invalid |
◆ e2p_device_i2c_write()
Write data to eeprom i2c device.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
| [in] | data_addr | Data address to write to |
| [in] | len | Length of data to write |
| [in] | data | Pointer to buffer containing data to write |
- Return values
-
| status_success | or status_fail if writing fails or status_timeout if timeout occurs during writing or status_i2c_no_addr_hit if no acknowledge from slave device or status_invalid_argument if invalid argument is detected |
- Note
- This function will handle page splitting and borrow bits internally, and call e2p_device_i2c_page_write; so the user does not need to worry about these details.