57 #define STORAGE_ENTRY(owner, type, version, size) ((((uint32_t)(owner))<<24) | (((uint32_t)(type))<<16) | (((uint32_t)(version))<<8) | ((uint32_t)(size)))
61 #define STORAGE_SYS_ID 0x01
62 #define STORAGE_USER0_ID 0x80
63 #define STORAGE_USER1_ID 0x81
64 #define STORAGE_USER2_ID 0x82
65 #define STORAGE_USER3_ID 0x83
66 #define STORAGE_USER4_ID 0x84
67 #define STORAGE_USER5_ID 0x85
68 #define STORAGE_USER6_ID 0x86
69 #define STORAGE_USER7_ID 0x87
70 #define STORAGE_USER8_ID 0x88
71 #define STORAGE_USER9_ID 0x89
74 #define STORAGE_SYS_KEY_ID 0x01
75 #define STORAGE_SYS_NAME_ID 0x02
76 #define STORAGE_SYS_UART0_ID 0x03
77 #define STORAGE_SYS_UART1_ID 0x04
79 #define STORAGE_SYS_KEY STORAGE_ENTRY(STORAGE_SYS_ID, STORAGE_SYS_KEY_ID, 1, 4)
80 #define STORAGE_SYS_NAME STORAGE_ENTRY(STORAGE_SYS_ID, STORAGE_SYS_NAME_ID, 1, 20)
81 #define STORAGE_SYS_UART0_BAUDRATE STORAGE_ENTRY(STORAGE_SYS_ID, STORAGE_SYS_UART0_ID, 1, 4)
82 #define STORAGE_SYS_UART1_BAUDRATE STORAGE_ENTRY(STORAGE_SYS_ID, STORAGE_SYS_UART1_ID, 1, 4)
uint8_t storage_delete(uint32_t entry)
delete the entry in EEPROM
uint8_t storage_write(uint32_t entry, const void *ram)
copy the entry data from RAM to EEPROM
uint8_t storage_optimize()
optimize data in EEPROM (TODO)
uint8_t storage_format()
delete all data in EEPROM
uint8_t storage_read(uint32_t entry, void *ram)
copy the entry data from EEPROM to RAM