EEPROM.h.bak 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. /*---------------------------------------------------------------------*/
  2. /* --- STC MCU Limited ------------------------------------------------*/
  3. /* --- STC 1T Series MCU Demo Programme -------------------------------*/
  4. /* --- Mobile: (86)13922805190 ----------------------------------------*/
  5. /* --- Fax: 86-0513-55012956,55012947,55012969 ------------------------*/
  6. /* --- Tel: 86-0513-55012928,55012929,55012966 ------------------------*/
  7. /* --- Web: www.STCMCU.com --------------------------------------------*/
  8. /* --- Web: www.STCMCUDATA.com ---------------------------------------*/
  9. /* --- QQ: 800003751 -------------------------------------------------*/
  10. /* 如果要在程序中使用此代码,请在程序中注明使用了STC的资料及程序 */
  11. /*---------------------------------------------------------------------*/
  12. #ifndef __EEPROM_H
  13. #define __EEPROM_H
  14. #include "config.h"
  15. #define STC8X1K08 8
  16. #define STC8X1K16 16
  17. #define STC8XxK32 32
  18. #define STC8XxK60 60
  19. // 选择MCU型号
  20. #define MCU_Type STC8XxK32 //STC8X1K08, STC8X1K16, STC8XxK32, STC8XxK32, STC8XxK60
  21. /************************** ISP/IAP *****************************
  22. 型号 大小 扇区数 开始地址 结束地址 MOVC读偏移地址
  23. STC8X1K08 4K 8扇区 0x0000 ~ 0x0FFF 0x2000
  24. STC8X1K16 12K 24扇区 0x0000 ~ 0x2FFF 0x4000
  25. STC8XxK32 32K 64扇区 0x0000 ~ 0x7FFF 0x8000
  26. STC8XxK60 4K 8扇区 0x0000 ~ 0x0FFF 0xF000
  27. */
  28. #if (MCU_Type == STC8X1K08)
  29. #define MOVC_ShiftAddress 0x2000
  30. #elif (MCU_Type == STC8X1K16)
  31. #define MOVC_ShiftAddress 0x4000
  32. #elif (MCU_Type == STC8XxK32)
  33. #define MOVC_ShiftAddress 0x8000
  34. #elif (MCU_Type == STC8XxK60)
  35. #define MOVC_ShiftAddress 0xF000
  36. #else
  37. #define MOVC_ShiftAddress 0xC000 //用户自定义
  38. #endif
  39. void DisableEEPROM(void);
  40. void EEPROM_read_n(u16 EE_address,u8 *DataAddress,u16 number);
  41. void EEPROM_write_n(u16 EE_address,u8 *DataAddress,u16 number);
  42. void EEPROM_SectorErase(u16 EE_address);
  43. #endif