HPM SDK
HPMicro Software Development Kit
eeprom_hal.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2025 HPMicro
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef _EEPROM_HAL_H
9 #define _EEPROM_HAL_H
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 #include "board.h"
16 #include "eeprom_device.h"
17 
19 #define EEPROM_MAX_DEVICE_CNT 32
20 
27 hpm_stat_t hpm_eeprom_register(hpm_eeprom_device_t *device, char device_name[]);
28 
34 hpm_stat_t hpm_eeprom_unregister(char device_name[]);
35 
41 hpm_eeprom_device_t *hpm_eeprom_find(char device_name[]);
42 
49 
56 
65 hpm_stat_t hpm_eeprom_read_block(hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data);
66 
75 hpm_stat_t hpm_eeprom_write_block(hpm_eeprom_device_t *device, uint32_t data_addr, uint32_t len, uint8_t *data);
76 
77 #ifdef __cplusplus
78 }
79 #endif
80 
81 #endif
hpm_eeprom_device_t * hpm_eeprom_find(char device_name[])
Find eeprom device by device name.
Definition: eeprom_hal.c:142
hpm_stat_t hpm_eeprom_register(hpm_eeprom_device_t *device, char device_name[])
Register eeprom device.
Definition: eeprom_hal.c:95
hpm_stat_t hpm_eeprom_deinit(hpm_eeprom_device_t *device)
Deinitialize eeprom device.
Definition: eeprom_hal.c:40
hpm_stat_t hpm_eeprom_init(hpm_eeprom_device_t *device)
Initialize eeprom device.
Definition: eeprom_hal.c:29
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.
Definition: eeprom_hal.c:54
hpm_stat_t hpm_eeprom_unregister(char device_name[])
Unregister eeprom device.
Definition: eeprom_hal.c:120
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.
Definition: eeprom_hal.c:68
uint32_t hpm_stat_t
Definition: hpm_common.h:135
eeprom device structure
Definition: eeprom_device.h:156