eeprom.h 572 B

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #ifndef __EEPROM_H__
  3. #define __EEPROM_H__
  4. /* Type defs */
  5. typedef union {
  6. uint64_t u64;
  7. int64_t i64;
  8. uint32_t u32[2];
  9. int32_t i32[2];
  10. } nt64_t;
  11. typedef enum {
  12. Flash_Ok = 0,
  13. Flash_Error = 1,
  14. Flash_PG_End = 2,
  15. Flash_PG_Clear = 3
  16. } flash_result_t;
  17. /* Defines */
  18. #define FLASH_PAGE_START 0x0800F800
  19. #define FLASH_PAGE_END 0x0800FFF8
  20. #define FLASH_PAGE_NMB 31
  21. #define FLASH_PAGE_NUM 1
  22. /* Functions prototypes */
  23. flash_result_t Flash_Write(uint64_t * data);
  24. flash_result_t Flash_Read(uint64_t * data);
  25. #endif /* __EEPROM_H__ */