src.dualinventive.com/dinet/libdi_fw/include/di_fw/drv/stm32l0_eeprom.h

50 lines
1.4 KiB
C

/**
* @file include/di_fw_drv/stm32l0_eeprom.h
* @brief stm32l0 eeprom header file
* @date May 24, 2017
* @author A.A.W.M. Ruijs
* @copyright 2017 Dual Inventive Technology Centre B.V..
*/
#ifndef INCLUDE_DI_FW_DRV_STM32L0_EEPROM_H_
#define INCLUDE_DI_FW_DRV_STM32L0_EEPROM_H_
#include <di/types.h>
#include <di/config.h>
/**
* initialization
*/
void di_fw_stm32l0_eeprom_init(void);
/**
* Lock eeprom after writing to prevent data being written to eeprom again
* @param ctx context for di_config
*/
void di_fw_stm32l0_eeprom_lock(struct di_config_ctx *ctx);
/**
* Writing data to the EEPROM
*
* @param ctx context for di_config
* @param offset Direct address for writing data
* @param data Byte to be written
* @param size size of the data
*
* @return DNOK if all went well, or error according to what went wrong
*/
di_errno_t di_fw_stm32l0_eeprom_write(struct di_config_ctx *ctx, uint32_t offset, const void *data, size_t size);
/**
* Reading data from the EEPROM
*
* @param ctx context for di_config
* @param offset Direct address for writing data
* @param data pointer to where data need to be stored
* @param size size of the data
*
* @return DNOK if all went well, or error according to what went wrong
*/
di_errno_t di_fw_stm32l0_eeprom_read(struct di_config_ctx *ctx, uint32_t offset, void *data, size_t size);
#endif /* INCLUDE_DI_FW_DRV_STM32L0_EEPROM_H_ */