app_eeprom.h 1.2 KB

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