Internal_EEPROM.h 4.43 KB
Newer Older
时昊's avatar
时昊 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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
#ifndef INTERNAL_EEPROM_H
#define INTERNAL_EEPROM_H

#include "TYW_stdint.h"
#include "r_eel_types.h"

typedef enum
{
    INTERNAL_EE_BLOCK_00=1u,
    INTERNAL_EE_BLOCK_01,
    INTERNAL_EE_BLOCK_02,
    INTERNAL_EE_BLOCK_03,
    INTERNAL_EE_BLOCK_04,
    INTERNAL_EE_BLOCK_05,
    INTERNAL_EE_BLOCK_06,
    INTERNAL_EE_BLOCK_07,
    INTERNAL_EE_BLOCK_08,
    INTERNAL_EE_BLOCK_09,
    INTERNAL_EE_BLOCK_10,
    INTERNAL_EE_BLOCK_11,
    INTERNAL_EE_BLOCK_12,
    INTERNAL_EE_BLOCK_13,
    INTERNAL_EE_BLOCK_14,
    INTERNAL_EE_BLOCK_15,
    INTERNAL_EE_BLOCK_16,
    INTERNAL_EE_BLOCK_17,
    INTERNAL_EE_BLOCK_18,
    INTERNAL_EE_BLOCK_19,
    INTERNAL_EE_BLOCK_20,
    INTERNAL_EE_BLOCK_21,
    INTERNAL_EE_BLOCK_22,
    INTERNAL_EE_BLOCK_23,
    INTERNAL_EE_BLOCK_24,
    INTERNAL_EE_BLOCK_25,
    INTERNAL_EE_BLOCK_26,
    INTERNAL_EE_BLOCK_27,
    INTERNAL_EE_BLOCK_28,
    INTERNAL_EE_BLOCK_29,
    INTERNAL_EE_BLOCK_30,
    INTERNAL_EE_BLOCK_31,
    INTERNAL_EE_BLOCK_32,
    INTERNAL_EE_BLOCK_33,
    INTERNAL_EE_BLOCK_34,
    INTERNAL_EE_BLOCK_35,
    INTERNAL_EE_BLOCK_36,
    INTERNAL_EE_BLOCK_37,
    INTERNAL_EE_BLOCK_38,
    INTERNAL_EE_BLOCK_39,
    INTERNAL_EE_BLOCK_40,
    INTERNAL_EE_BLOCK_41,
    INTERNAL_EE_BLOCK_42,
    INTERNAL_EE_BLOCK_43,
    INTERNAL_EE_BLOCK_44,
    INTERNAL_EE_BLOCK_45,
    INTERNAL_EE_BLOCK_46,
    INTERNAL_EE_BLOCK_47,
    INTERNAL_EE_BLOCK_48,
    INTERNAL_EE_BLOCK_49,
    INTERNAL_EE_BLOCK_50,
    INTERNAL_EE_BLOCK_51,
    INTERNAL_EE_BLOCK_52,
    INTERNAL_EE_BLOCK_53,
    INTERNAL_EE_BLOCK_54,
    INTERNAL_EE_BLOCK_55,
    INTERNAL_EE_BLOCK_56,
    INTERNAL_EE_BLOCK_57,
    INTERNAL_EE_BLOCK_58,
    INTERNAL_EE_BLOCK_59,
    INTERNAL_EE_BLOCK_60,
    INTERNAL_EE_BLOCK_61,
    INTERNAL_EE_BLOCK_62,
    INTERNAL_EE_BLOCK_63,
} EE_BLOCK_NB;


#define INTERNAL_EE_BLOCK_00_size 364 //DTC
#define INTERNAL_EE_BLOCK_01_size 1  //User Setting
#define INTERNAL_EE_BLOCK_02_size 1  //User Setting
#define INTERNAL_EE_BLOCK_03_size 1  //User Setting
#define INTERNAL_EE_BLOCK_04_size 1  //User Setting
#define INTERNAL_EE_BLOCK_05_size 1  //User Setting
#define INTERNAL_EE_BLOCK_06_size 1  //User Setting
#define INTERNAL_EE_BLOCK_07_size 1  //User Setting

#define INTERNAL_EE_BLOCK_08_size 1
#define INTERNAL_EE_BLOCK_09_size 1
#define INTERNAL_EE_BLOCK_10_size 1
#define INTERNAL_EE_BLOCK_11_size 1
#define INTERNAL_EE_BLOCK_12_size 1
#define INTERNAL_EE_BLOCK_13_size 1
#define INTERNAL_EE_BLOCK_14_size 1
#define INTERNAL_EE_BLOCK_15_size 1
#define INTERNAL_EE_BLOCK_16_size 1
#define INTERNAL_EE_BLOCK_17_size 1
#define INTERNAL_EE_BLOCK_18_size 1
#define INTERNAL_EE_BLOCK_19_size 1
#define INTERNAL_EE_BLOCK_20_size 1
#define INTERNAL_EE_BLOCK_21_size 1
#define INTERNAL_EE_BLOCK_22_size 1
#define INTERNAL_EE_BLOCK_23_size 1
#define INTERNAL_EE_BLOCK_24_size 1
#define INTERNAL_EE_BLOCK_25_size 1
#define INTERNAL_EE_BLOCK_26_size 1
#define INTERNAL_EE_BLOCK_27_size 1
#define INTERNAL_EE_BLOCK_28_size 1
#define INTERNAL_EE_BLOCK_29_size 1
#define INTERNAL_EE_BLOCK_30_size 1
#define INTERNAL_EE_BLOCK_31_size 1
#define INTERNAL_EE_BLOCK_32_size 1
#define INTERNAL_EE_BLOCK_33_size 1
#define INTERNAL_EE_BLOCK_34_size 1
#define INTERNAL_EE_BLOCK_35_size 1
#define INTERNAL_EE_BLOCK_36_size 1
#define INTERNAL_EE_BLOCK_37_size 1
#define INTERNAL_EE_BLOCK_38_size 1
#define INTERNAL_EE_BLOCK_39_size 1
#define INTERNAL_EE_BLOCK_40_size 1
#define INTERNAL_EE_BLOCK_41_size 1
#define INTERNAL_EE_BLOCK_42_size 1
#define INTERNAL_EE_BLOCK_43_size 1
#define INTERNAL_EE_BLOCK_44_size 1
#define INTERNAL_EE_BLOCK_45_size 1
#define INTERNAL_EE_BLOCK_46_size 1
#define INTERNAL_EE_BLOCK_47_size 1
#define INTERNAL_EE_BLOCK_48_size 1
#define INTERNAL_EE_BLOCK_49_size 1
#define INTERNAL_EE_BLOCK_50_size 1
#define INTERNAL_EE_BLOCK_51_size 1
#define INTERNAL_EE_BLOCK_52_size 1
#define INTERNAL_EE_BLOCK_53_size 1
#define INTERNAL_EE_BLOCK_54_size 1
#define INTERNAL_EE_BLOCK_55_size 1
#define INTERNAL_EE_BLOCK_56_size 1
#define INTERNAL_EE_BLOCK_57_size 1
#define INTERNAL_EE_BLOCK_58_size 1
#define INTERNAL_EE_BLOCK_59_size 1
#define INTERNAL_EE_BLOCK_60_size 1
#define INTERNAL_EE_BLOCK_61_size 1
#define INTERNAL_EE_BLOCK_62_size 1
#define INTERNAL_EE_BLOCK_63_size 1


void Internal_EEPROM_OPEN(void);
void Internal_EEPROM_CLOSE(void);
void Internal_EEL_Init(void);
r_eel_status_t Internal_EEL_Write(uint16_t blockID, uint8_t pbuf [], uint32_t length);
r_eel_status_t Internal_EEL_Read(uint8_t blockID, uint8_t pbuf [], uint32_t length);
void Internal_EEL_DEINIT(void);


#endif