#pragma once
/**
* @file BSP_EE24.h
* This file contains functions to interact with an EEPROM driver and perform
* read and write operations on it. The driver uses I2C protocol and supports
* multiple partitions, which can be used to store different types of data.
*/

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

typedef struct BSP_EE24_Partion_s
{
    uint32_t address;
    size_t len;
}BSP_EE24_Partion;


typedef struct BSP_EE24_TableHeader_s 
{
    uint32_t version;
    size_t used_len;
    uint8_t reserved[16];
} BSP_EE24_TableHeader;


typedef enum BSP_EE24_PartionEntry {
    BSP_EE24_PART_HEAD_PARTION,
    BSP_EE24_PART_GLOBAL_LIGHT,
    BSP_EE24_PART_RESERVED,
    __BSP_EE24_PART_MAX__,
}BSP_EE24_PartionEntry_e;


bool BSP_EE24_Init(void); 
bool BSP_EE24_Read(uint32_t Address, uint8_t *Data, size_t Len); 
bool BSP_EE24_Write(uint32_t Address, uint8_t *Data, size_t Len); 


bool BSP_EE24_PartRead(BSP_EE24_PartionEntry_e part, uint8_t *Data, size_t LenCheck);
bool BSP_EE24_PartWrite(BSP_EE24_PartionEntry_e part, uint8_t *Data, size_t LenCheck);

#ifdef __cplusplus
}
#endif