FLASH.H 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* --------------------------- (C) COPYRIGHT 2021 Fortiortech ShenZhen -----------------------------
  2. File Name : FLASH.h
  3. Author : Fortiortech Appliction Team
  4. Version : V1.0
  5. Date : 2021-07-24
  6. Description : This file contains flash变量和函数的定义 parameter used for Motor Control.
  7. ----------------------------------------------------------------------------------------------------
  8. All Rights Reserved
  9. ------------------------------------------------------------------------------------------------- */
  10. /* Define to prevent recursive inclusion -------------------------------------------------------- */
  11. /******************************************************************************///Including Header Files
  12. #include <FU68xx_5.h>
  13. #ifndef __FLASH_H__
  14. #define __FLASH_H__
  15. #define USERCODEADDRESS 0X3F00
  16. typedef struct
  17. {
  18. uint8 FlashRead;
  19. uint8 FlashWrite;
  20. uint16 FlashRead2Byte;
  21. uint16 FlashWrite2Byte;
  22. } MCUFlash;
  23. extern MCUFlash xdata FlashTest; //flash数据测试
  24. extern uint16 Get2ByteFromFlash(uint8 xdata *BlockStartAddr); //2字节的flash读取函数
  25. extern uint8 Write2Byte2Flash(uint8 xdata *BlockStartAddr,uint16 NewData2Flash); //2字节的flash写入函数
  26. extern void WriteOrReadFlashTest(uint8 xdata *BlockStartAddr,uint16 NewData2Flash); //读写函数定义
  27. extern void Flash_Sector_Erase(uint8 xdata *FlashAddress); //自擦除函数定义
  28. extern void Flash_Sector_Write(uint8 xdata *FlashAddress, uint8 FlashData); //自写入函数定义
  29. #endif