#include "board.h"
#include "hpm_spi_drv.h"
#include "eeprom_device.h"
Go to the source code of this file.
◆ E2P_SPI_INSTRUCTION_RDSR
| #define E2P_SPI_INSTRUCTION_RDSR 0x05 |
◆ E2P_SPI_INSTRUCTION_READ
| #define E2P_SPI_INSTRUCTION_READ 0x03 |
◆ E2P_SPI_INSTRUCTION_STATUS_WEL_MASK
| #define E2P_SPI_INSTRUCTION_STATUS_WEL_MASK 0x02 |
◆ E2P_SPI_INSTRUCTION_STATUS_WIP_MASK
| #define E2P_SPI_INSTRUCTION_STATUS_WIP_MASK 0x01 |
eeprom spi device status register bit mask
◆ E2P_SPI_INSTRUCTION_WRDI
| #define E2P_SPI_INSTRUCTION_WRDI 0x04 |
◆ E2P_SPI_INSTRUCTION_WREN
| #define E2P_SPI_INSTRUCTION_WREN 0x06 |
eeprom spi device support register instruction
◆ E2P_SPI_INSTRUCTION_WRITE
| #define E2P_SPI_INSTRUCTION_WRITE 0x02 |
◆ E2P_SPI_INSTRUCTION_WRSR
| #define E2P_SPI_INSTRUCTION_WRSR 0x01 |
◆ e2p_device_spi_deinit()
De-initialize eeprom spi device.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
- Return values
-
◆ e2p_device_spi_get_attribute()
Get eeprom spi device attribute.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
- Return values
-
| Pointer | to eeprom spi device attribute structure |
◆ e2p_device_spi_init()
Initialize eeprom spi device, hw init(clock and pin) and spi master init.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
- Return values
-
| status_success | or status_fail if initialization fails or status_invalid_argument if configuration is invalid |
◆ e2p_device_spi_read()
Read data from eeprom spi device.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
| [in] | data_addr | Data address to read from |
| [in] | len | Length of data to read |
| [in] | data | Pointer to buffer to store read data |
- Return values
-
| status_success | or status_fail if read operation fails or status_invalid_argument if configuration is invalid or status_spi_master_busy if spi bus is busy or status_timeout if spi transfer timeout |
◆ e2p_device_spi_register_param()
Register eeprom spi device parameter to device structure.
- Parameters
-
| [in] | device | Pointer to eeprom device structure |
| [in] | host_info | Pointer to eeprom spi host configuration structure |
| [in] | dev_id | Eeprom device id |
- Return values
-
| status_success | or status_fail if dev_id is invalid |
◆ e2p_device_spi_write()
Write data to eeprom spi 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 read operation fails or status_invalid_argument if configuration is invalid or status_spi_master_busy if spi bus is busy or status_timeout if spi transfer timeout |
- Note
- This function will handle page splitting and borrow bits internally, and call e2p_device_spi_page_write; so the user does not need to worry about these details.