eeprom.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef FAKE_EEPROM_H_
  2. #define FAKE_EEPROM_H_
  3. #define EEMEM __attribute__((section("eeprom")))
  4. #define eeprom_is_ready() 1
  5. #define eeprom_busy_wait() do { } while (!eeprom_is_ready())
  6. static inline uint8_t eeprom_read_byte (const uint8_t *p)
  7. {
  8. return 0u;
  9. }
  10. static inline uint16_t eeprom_read_word (const uint16_t *p)
  11. {
  12. return 0u;
  13. }
  14. static inline uint32_t eeprom_read_dword (const uint32_t *p)
  15. {
  16. return 0u;
  17. }
  18. static inline float eeprom_read_float (const float *p)
  19. {
  20. return 0.0f;
  21. }
  22. static inline void eeprom_read_block (void *d, const void *s, size_t n)
  23. {
  24. }
  25. static inline void eeprom_write_byte (uint8_t *p, uint8_t v)
  26. {
  27. }
  28. static inline void eeprom_write_word (uint16_t *p, uint16_t v)
  29. {
  30. }
  31. static inline void eeprom_write_dword (uint32_t *p, uint32_t v)
  32. {
  33. }
  34. static inline void eeprom_write_float (float *p, float v)
  35. {
  36. }
  37. static inline void eeprom_write_block (const void *s, void *d, size_t n)
  38. {
  39. }
  40. static inline void eeprom_update_byte (uint8_t *p, uint8_t v)
  41. {
  42. }
  43. static inline void eeprom_update_word (uint16_t *p, uint16_t v)
  44. {
  45. }
  46. static inline void eeprom_update_dword (uint32_t *p, uint32_t v)
  47. {
  48. }
  49. static inline void eeprom_update_float (float *p, float v)
  50. {
  51. }
  52. static inline void eeprom_update_block (const void *s, void *d, size_t n)
  53. {
  54. }
  55. #endif /* FAKE_EEPROM_H_ */