You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

stmflash.h 1.3KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _STMFLASH_H
  2. #define _STMFLASH_H
  3. #include "stm32f10x.h"
  4. //////////////////////////////////////////////////////////////////////////////////////////////////////
  5. //ûԼҪ
  6. #define STM32_FLASH_SIZE 256 //ѡSTM32FLASHС(λΪK)
  7. #define STM32_FLASH_WREN 1 //ʹFLASHд(0;1ʹ)
  8. //////////////////////////////////////////////////////////////////////////////////////////////////////
  9. //FLASHʼַ
  10. #define STM32_FLASH_BASE 0x08000000 //STM32 FLASHʼַ
  11. //FLASHֵ
  12. //#define PC_NUM_ADDR 0x08030000 //ݴ洢ʼַ 0X08030000-0X08030023
  13. #define STORE_DATA_NUM 10 //еݸ
  14. extern u16 StoreBuffer[STORE_DATA_NUM];//Ҫдflashе
  15. extern u8 Save_Buffer[STORE_DATA_NUM*2];//Ҫͨڶ
  16. u16 STMFLASH_ReadHalfWord(u32 faddr); //
  17. void STMFLASH_WriteLenByte(u32 WriteAddr,u32 DataToWrite,u16 Len); //ַָʼдָȵ
  18. u32 STMFLASH_ReadLenByte(u32 ReadAddr,u16 Len); //ַָʼȡָ
  19. void STMFLASH_Write(u32 WriteAddr,u16 *pBuffer,u16 NumToWrite); //ַָʼдָȵ
  20. void STMFLASH_Read(u32 ReadAddr,u16 *pBuffer,u16 NumToRead); //ַָʼָȵ
  21. //д
  22. void Test_Write(u32 WriteAddr,u16 WriteData);
  23. #endif