53 lines
1.6 KiB
C
53 lines
1.6 KiB
C
#ifndef _EE_H_
|
|
#define _EE_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C"
|
|
{
|
|
#endif
|
|
|
|
/************************************************************************************************************
|
|
************** Include Headers
|
|
************************************************************************************************************/
|
|
|
|
#include <stdbool.h>
|
|
#include "main.h"
|
|
|
|
/************************************************************************************************************
|
|
************** Public Definitions
|
|
************************************************************************************************************/
|
|
|
|
// none
|
|
|
|
/************************************************************************************************************
|
|
************** Public struct/enum
|
|
************************************************************************************************************/
|
|
|
|
typedef struct
|
|
{
|
|
uint8_t *pData;
|
|
uint32_t Size;
|
|
uint32_t PageSectorSize;
|
|
uint32_t Address;
|
|
uint8_t PageSectorNumber;
|
|
#if (defined FLASH_BANK_1) || (defined FLASH_BANK_2)
|
|
uint8_t BankNumber;
|
|
#endif
|
|
|
|
} EE_HandleTypeDef;
|
|
|
|
/************************************************************************************************************
|
|
************** Public Functions
|
|
************************************************************************************************************/
|
|
|
|
bool EE_Init(void *pData, uint32_t Size);
|
|
uint32_t EE_Capacity(void);
|
|
bool EE_Format(void);
|
|
void EE_Read(void);
|
|
bool EE_Write(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|