eeprom.h 772 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef EEPROM_H_
  2. #define EEPROM_H_
  3. #include "main.h"
  4. #include "remote.h"
  5. #if USE_REMOTE
  6. # define USE_EEPROM 1
  7. # define IF_EEPROM(...) __VA_ARGS__
  8. #else
  9. # define USE_EEPROM 0
  10. # define IF_EEPROM(...) /* nothing */
  11. #endif
  12. #define EEPROM_NR_SETPOINTS 3u
  13. #define EEPROM_FLAG_DIS 0x01u
  14. #define EEPROM_FLAG_ANADIS 0x02u
  15. #define EEPROM_FLAG_SPHSL 0x04u
  16. struct eeprom_data {
  17. uint8_t flags;
  18. uint16_t setpoints[EEPROM_NR_SETPOINTS];
  19. /* Keep the serial number last.
  20. * With the update of the serial number the data set becomes valid. */
  21. uint8_t serial;
  22. };
  23. struct eeprom_data * eeprom_get_data(void);
  24. void eeprom_store_data(void);
  25. void eeprom_handle_deep_sleep_wakeup(void);
  26. void eeprom_handle_watchdog_interrupt(void);
  27. void eeprom_init(void);
  28. #endif /* EEPROM_H_ */