EE_Dataset.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /************************************************************************
  2. Grt-Mars, Inc.
  3. 240 Sheffield Str.
  4. Mountainside, New Jersey 07092
  5. PROJECT : ProEX
  6. Author : Peter Strezev
  7. *******************************************************************************
  8. --------------------- EEPROM emulation headers -----------------------
  9. EEPROM emulator is used to store the irrigation programs in FLASH. Total of 4
  10. programs can be stored USER-A, USER-B, USER-C and Contractor. The 3 User programs
  11. can be recalled at any time by placing to Program Select switch in proper position.
  12. The Contractor program is only accessible through "SAVE" and "RESTORE" functions
  13. of the "Spetial Features" user interface menu.
  14. *******************************************************************************/
  15. #ifndef _EE_DATASET
  16. #define _EE_DATASET
  17. #include "stm32f10x_conf.h"
  18. #include "config.h"
  19. /*
  20. 笔记:
  21. 模拟1k,实际需要2k空间(2页交互使用)
  22. 能保存1k/2=512byte数据(另外512byte存地址)
  23. 注意:数据越小越好建议在1k/4=256byte内,这样才有意义
  24. <=256byte, 用1k
  25. <=512byte, 用2k
  26. */
  27. /* Virtual addresses for the FLASH variables */
  28. #define EE_ADDR_COMGATEWAY 0
  29. #define __disable_interrupt() __disable_irq()
  30. #define __enable_interrupt() __enable_irq()
  31. typedef enum
  32. {
  33. EE_DONE = 0,
  34. EE_BADVAR = 1,
  35. EE_BADPRG = 2,
  36. EE_BADPAGE = 0xAB,
  37. } tEEstat;
  38. void EEprom_Init ( void );
  39. void SaveDtuConfig ( unsigned short addr );
  40. void LoadDtuConfig ( unsigned short addr );
  41. #endif