/** ****************************************************************************** * @file EEPROM/EEPROM_Emulation/inc/eeprom.h * @author MCD Application Team * @brief This file contains all the functions prototypes for the EEPROM * emulation firmware library. ****************************************************************************** * @attention * * Copyright (c) 2017 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** *//* ... *//* Define to prevent recursive inclusion -------------------------------------*/#ifndef__EEPROM_H#define__EEPROM_H/* Includes ------------------------------------------------------------------*/#include"stm32f4xx_hal.h"Includes/* Exported constants --------------------------------------------------------*//* EEPROM emulation firmware error codes */#defineEE_OK(uint32_t)HAL_OK#defineEE_ERROR(uint32_t)HAL_ERROR#defineEE_BUSY(uint32_t)HAL_BUSY#defineEE_TIMEOUT(uint32_t)HAL_TIMEOUT/* Define the size of the sectors to be used */#definePAGE_SIZE(uint32_t)0x4000/* Page size = 16KByte *//* Device voltage range supposed to be [2.7V to 3.6V], the operation will be done by word *//* ... */#defineVOLTAGE_RANGE(uint8_t)VOLTAGE_RANGE_3/* EEPROM start address in Flash */#defineEEPROM_START_ADDRESS((uint32_t)0x08008000)/* EEPROM emulation start address: from sector2 : after 16KByte of used Flash memory *//* ... *//* Pages 0 and 1 base and end addresses */#definePAGE0_BASE_ADDRESS((uint32_t)(EEPROM_START_ADDRESS+0x0000))#definePAGE0_END_ADDRESS((uint32_t)(EEPROM_START_ADDRESS+(PAGE_SIZE-1)))#definePAGE0_IDFLASH_SECTOR_2#definePAGE1_BASE_ADDRESS((uint32_t)(EEPROM_START_ADDRESS+0x4000))#definePAGE1_END_ADDRESS((uint32_t)(EEPROM_START_ADDRESS+(2*PAGE_SIZE-1)))#definePAGE1_IDFLASH_SECTOR_3/* Used Flash pages for EEPROM emulation */#definePAGE0((uint16_t)0x0000)#definePAGE1((uint16_t)0x0001)/* Page nb between PAGE0_BASE_ADDRESS & PAGE1_BASE_ADDRESS*//* No valid page define */#defineNO_VALID_PAGE((uint16_t)0x00AB)/* Page status definitions */#defineERASED((uint16_t)0xFFFF)/* Page is empty */#defineRECEIVE_DATA((uint16_t)0xEEEE)/* Page is marked to receive data */#defineVALID_PAGE((uint16_t)0x0000)/* Page containing valid data *//* Valid pages in read and write defines */#defineREAD_FROM_VALID_PAGE((uint8_t)0x00)#defineWRITE_IN_VALID_PAGE((uint8_t)0x01)/* Page full define */#definePAGE_FULL((uint8_t)0x80)/* Variables' number */#defineNB_OF_VAR((uint8_t)0x03)23 definesExported constants/* Exported types ------------------------------------------------------------*//* Exported macro ------------------------------------------------------------*//* Exported functions ------------------------------------------------------- */uint16_tEE_Init(void);uint16_tEE_ReadVariable(uint16_tVirtAddress,uint16_t*Data);uint16_tEE_WriteVariable(uint16_tVirtAddress,uint16_tData);Exported functions/* ... */#endif/* __EEPROM_H */
Details
Show: from
Types: Columns:
All items filtered out
All items filtered out
This file uses the notable symbols shown below. Click anywhere in the file to view more details.