Emulated_EEPROM.h 2.35 KB
Newer Older
hu's avatar
hu committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#ifndef EMULATED_EEPROM_H__
#define EMULATED_EEPROM_H__

typedef enum
{
  EEPROM_STAT_BLANK = 0U,
  EEPROM_STAT_ACTIVE,
  EEPROM_STAT_ERROR,
}EEPROM_Block_Status_en_t;

typedef enum
{
  EEPROM_RW_PASS = 0,
  EEPROM_RW_FAIL,
}EEPROM_RW_Result_en_t;

typedef enum
{
  EEPROM_STAT_IDLE = 0,
  EEPROM_STAT_BUSY,
}EEPROM_Status_en_t;

/****************************************************************************
 *   !!! The following code should be generated by configuration tool !!!   *
****************************************************************************/
enum g_enEEPROMBlockName
{
    EEPROM_BLOCK_UDS_FLAG = 0U,
    EEPROM_BLOCK_UDS_S27 = 1U,
    EEPROM_BLOCK_UDS_S2E0 = 2U,
    EEPROM_BLOCK_UDS_S2E = 3U,
    EEPROM_BLOCK_UDS_CONFIG = 4U,
    EEPROM_BLOCK_UDS_DTC = 5U,
    EEPROM_BLOCK_ODO = 6U,
    EEPROM_BLOCK_ODO_STAMP = 7U,
    EEPROM_BLOCK_TRIP_STAMP = 8U,
    EEPROM_BLOCK_SERVICE_INFO = 9U,
    EEPROM_BLOCK_EOL_K_LINE = 10U,
};

#define   EEPROM_BLOCK_UDS_FLAG_SIZE        (16U)/*Life:20.0W*/
#define   EEPROM_BLOCK_UDS_S27_SIZE         (16U)/*Life:20.0W*/
#define   EEPROM_BLOCK_UDS_S2E0_SIZE        (216U)/*Life:20.0W*/
#define   EEPROM_BLOCK_UDS_S2E_SIZE         (216U)/*Life:20.0W*/
#define   EEPROM_BLOCK_UDS_CONFIG_SIZE      (40U)/*Life:20.0W*/
#define   EEPROM_BLOCK_UDS_DTC_SIZE         (76U)/*Life:20.0W*/
#define   EEPROM_BLOCK_ODO_SIZE             (4U)/*Life:1000.0W*/
#define   EEPROM_BLOCK_ODO_STAMP_SIZE       (8U)/*Life:1000.0W*/
49
#define   EEPROM_BLOCK_TRIP_STAMP_SIZE      (80U)/*Life:1000.0W*/
hu's avatar
hu committed
50
#define   EEPROM_BLOCK_SERVICE_INFO_SIZE    (56U)/*Life:20.0W*/
hu's avatar
hu committed
51
#define   EEPROM_BLOCK_EOL_K_LINE_SIZE      (80U)/*Life:20.0W*/
hu's avatar
hu committed
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

#define   EEPROM_TOTAL_BLOCK_NUM            (11U)

/****************************************************************************
 *             !!!          End of code generation          !!!             *
****************************************************************************/

extern void EEPROM_Init(void);

extern EEPROM_Status_en_t       EEPROM_Get_Status(void);
extern EEPROM_Block_Status_en_t EEPROM_Get_Block_Status(uint16_t u16BlockID);

extern EEPROM_RW_Result_en_t    EEPROM_Read_Data(uint16_t u16BlockID, uint32_t u32Data[], uint16_t u16Len);
extern EEPROM_RW_Result_en_t    EEPROM_Write_Data(uint16_t u16BlockID, uint32_t u32Data[], uint16_t u16Len);

#endif