Functions | |
| e2p_device_i2c_attribute_t * | e2p_device_i2c_get_attribute (hpm_eeprom_device_t *device) |
| Get eeprom i2c device attribute. More... | |
| hpm_stat_t | e2p_device_i2c_register_param (hpm_eeprom_device_t *device, void *host_info, uint32_t dev_id) |
| Register eeprom i2c device parameter to device structure. More... | |
| hpm_stat_t | e2p_device_i2c_init (hpm_eeprom_device_t *device) |
| Initialize eeprom i2c device, hw init(clock and pin) and i2c master init. More... | |
| hpm_stat_t | e2p_device_i2c_deinit (hpm_eeprom_device_t *device) |
| Deinitialize eeprom i2c device. More... | |
| static uint32_t | e2p_device_i2c_calculate_max_addr (uint8_t borrow_bits, uint32_t addr_bytes) |
| Calculate the max address of eeprom device, depending on borrow_bits and addr_bytes. More... | |
| hpm_stat_t | e2p_device_i2c_page_read (hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data) |
| Read data from eeprom i2c device. More... | |
| hpm_stat_t | e2p_device_i2c_read (hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data) |
| Read data from eeprom i2c device. More... | |
| static bool | e2p_device_i2c_write_in_progress (hpm_eeprom_device_t *device) |
| Check if eeprom i2c device write cycle is in progress. More... | |
| static hpm_stat_t | e2p_device_i2c_page_write (hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data) |
| Write data to eeprom i2c device, page write, not consider borrow_bits. More... | |
| hpm_stat_t | e2p_device_i2c_write (hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data) |
| Write data to eeprom i2c device. More... | |
Variables | |
| static const e2p_device_i2c_attribute_t | supported_e2p_i2c_device_list [] |
| eeprom i2c supported device information list More... | |
| static const uint32_t | eeprom_common_size [] = {0x100, 0x10000} |
| static e2p_device_ops_t | hpm_e2p_i2c_device_ops |
| eeprom i2c device operations structure More... | |
|
static |
Calculate the max address of eeprom device, depending on borrow_bits and addr_bytes.
| [in] | borrow_bits | Number of borrow bits |
| [in] | addr_bytes | Number of address bytes |
| max_addr | Maximum address of eeprom device |
| hpm_stat_t e2p_device_i2c_deinit | ( | hpm_eeprom_device_t * | device | ) |
Deinitialize eeprom i2c device.
De-initialize eeprom i2c device.
| e2p_device_i2c_attribute_t* e2p_device_i2c_get_attribute | ( | hpm_eeprom_device_t * | device | ) |
Get eeprom i2c device attribute.
| [in] | device | Pointer to eeprom device structure |
| Pointer | to eeprom i2c device attribute structure |
| hpm_stat_t e2p_device_i2c_init | ( | hpm_eeprom_device_t * | device | ) |
Initialize eeprom i2c device, hw init(clock and pin) and i2c master init.
| [in] | device | Pointer to eeprom device structure |
| status_success,or | status_fail if initialization fails |
| hpm_stat_t e2p_device_i2c_page_read | ( | hpm_eeprom_device_t * | device, |
| uint32_t | data_addr, | ||
| uint32_t | len, | ||
| uint8_t * | data | ||
| ) |
Read data from eeprom i2c device.
| [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 |
| 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 |
|
static |
Write data to eeprom i2c device, page write, not consider borrow_bits.
| [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 |
| 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 |
| hpm_stat_t e2p_device_i2c_read | ( | hpm_eeprom_device_t * | device, |
| uint32_t | data_addr, | ||
| uint32_t | len, | ||
| uint8_t * | data | ||
| ) |
Read data from eeprom i2c device.
| [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 |
| 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 |
| hpm_stat_t e2p_device_i2c_register_param | ( | hpm_eeprom_device_t * | device, |
| void * | host_info, | ||
| uint32_t | dev_id | ||
| ) |
Register eeprom i2c device parameter to device structure.
| [in] | device | Pointer to eeprom device structure |
| [in] | host_info | Pointer to eeprom i2c host configuration structure |
| [in] | dev_id | Eeprom device id |
| status_success,or | status_fail if dev_id is invalid |
| hpm_stat_t e2p_device_i2c_write | ( | hpm_eeprom_device_t * | device, |
| uint32_t | data_addr, | ||
| uint32_t | len, | ||
| uint8_t * | data | ||
| ) |
Write data to eeprom i2c device.
| [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 |
| 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 |
|
static |
Check if eeprom i2c device write cycle is in progress.
| [in] | device | Pointer to eeprom device structure |
| true | if write cycle is in progress, false otherwise |
|
static |
|
static |
eeprom i2c device operations structure
|
static |
eeprom i2c supported device information list