HPM SDK
HPMicro Software Development Kit
eeprom_hal.h File Reference
#include "board.h"
#include "eeprom_device.h"

Go to the source code of this file.

Macros

#define EEPROM_MAX_DEVICE_CNT   32
 eeprom support max device count More...
 

Functions

hpm_stat_t hpm_eeprom_register (hpm_eeprom_device_t *device, char device_name[])
 Register eeprom device. More...
 
hpm_stat_t hpm_eeprom_unregister (char device_name[])
 Unregister eeprom device. More...
 
hpm_eeprom_device_thpm_eeprom_find (char device_name[])
 Find eeprom device by device name. More...
 
hpm_stat_t hpm_eeprom_init (hpm_eeprom_device_t *device)
 Initialize eeprom device. More...
 
hpm_stat_t hpm_eeprom_deinit (hpm_eeprom_device_t *device)
 Deinitialize eeprom device. More...
 
hpm_stat_t hpm_eeprom_read_block (hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data)
 Read data from eeprom device. More...
 
hpm_stat_t hpm_eeprom_write_block (hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data)
 Write data to eeprom device. More...
 

Macro Definition Documentation

◆ EEPROM_MAX_DEVICE_CNT

#define EEPROM_MAX_DEVICE_CNT   32

eeprom support max device count

Function Documentation

◆ hpm_eeprom_deinit()

hpm_stat_t hpm_eeprom_deinit ( hpm_eeprom_device_t device)

Deinitialize eeprom device.

Parameters
[in]devicePointer to eeprom device structure
Return values
status_success

◆ hpm_eeprom_find()

hpm_eeprom_device_t* hpm_eeprom_find ( char  device_name[])

Find eeprom device by device name.

Parameters
[in]device_nameDevice name
Return values
Pointerto eeprom device structure

◆ hpm_eeprom_init()

hpm_stat_t hpm_eeprom_init ( hpm_eeprom_device_t device)

Initialize eeprom device.

Parameters
[in]devicePointer to eeprom device structure
Return values
status_successor status_fail if initialization fails

◆ hpm_eeprom_read_block()

hpm_stat_t hpm_eeprom_read_block ( hpm_eeprom_device_t device,
uint32_t  data_addr,
uint32_t  len,
uint8_t *  data 
)

Read data from eeprom device.

Parameters
[in]devicePointer to eeprom device structure
[in]data_addrData address to read from
[in]lenLength of data to read
[in]dataPointer to buffer to store read data
Return values
status_successif without any error

◆ hpm_eeprom_register()

hpm_stat_t hpm_eeprom_register ( hpm_eeprom_device_t device,
char  device_name[] 
)

Register eeprom device.

Parameters
[in]devicePointer to eeprom device structure
[in]device_nameDevice name
Return values
status_success

◆ hpm_eeprom_unregister()

hpm_stat_t hpm_eeprom_unregister ( char  device_name[])

Unregister eeprom device.

Parameters
[in]device_nameDevice name
Return values
status_successor status_fail if unregister fails

◆ hpm_eeprom_write_block()

hpm_stat_t hpm_eeprom_write_block ( hpm_eeprom_device_t device,
uint32_t  data_addr,
uint32_t  len,
uint8_t *  data 
)

Write data to eeprom device.

Parameters
[in]devicePointer to eeprom device structure
[in]data_addrData address to write to
[in]lenLength of data to write
[in]dataPointer to buffer containing data to write
Return values
status_successif without any error