app_eeprom.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef __APP_EEPROM_H
  2. #define __APP_EEPROM_H
  3. #include "dev_conf.h"
  4. extern uint8_t app_eeprom_read_buf[520];
  5. extern uint8_t app_eeprom_write_buf[520];
  6. extern uint8_t read_buf[50];
  7. #define APP_EEPROM_READ_STEP PAGESIZE
  8. #define APP_EEPROM_WRITE_STEP PAGESIZE
  9. typedef uint8_t (*app_eeprom_read_callback)(void);
  10. typedef uint8_t (*app_eeprom_write_callback)(void);
  11. typedef struct
  12. {
  13. uint8_t *buffer;
  14. uint16_t addr;
  15. uint16_t len;
  16. uint16_t cur;
  17. uint8_t save_id;
  18. app_eeprom_read_callback pfun;
  19. uint8_t used;
  20. } app_eeprom_read_cache_t;
  21. typedef struct
  22. {
  23. uint8_t *buffer;
  24. uint16_t addr;
  25. uint16_t len;
  26. uint16_t cur;
  27. uint8_t save_id;
  28. uint8_t count;
  29. app_eeprom_write_callback pfun;
  30. uint8_t used;
  31. } app_eeprom_write_cache_t;
  32. void app_eeprom_read_task(void);
  33. void app_eeprom_write_task(void);
  34. uint8_t app_eeprom_read_50_zhuzu(void);
  35. uint8_t app_eeprom_write_50_zhuzu(void);
  36. #endif // __APP_EEPROM_H