42 lines
995 B
C
42 lines
995 B
C
|
#ifndef __STMFLASH_H__
|
|||
|
#define __STMFLASH_H__
|
|||
|
#include "sys.h"
|
|||
|
|
|||
|
//<2F>û<EFBFBD><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Լ<EFBFBD><D4BC><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
|
|||
|
#define STM32_FLASH_SIZE 64 //<2F><>ѡSTM32<33><32>FLASH<53><48><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С(<28><>λΪK)
|
|||
|
#define STM32_FLASH_WREN 1 //ʹ<><CAB9>FLASHд<48><D0B4>(0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;1<><31>ʹ<EFBFBD><CAB9>)
|
|||
|
|
|||
|
/*STM32 FLASH<53><48><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ַ*/
|
|||
|
#define STM32_FLASH_BASE 0x08000000
|
|||
|
|
|||
|
/*Laputa<74>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƫ<EFBFBD>ĵ<EFBFBD>ַ*/
|
|||
|
#define FLASH_SAVE_ADDR 0X0800FF00
|
|||
|
|
|||
|
/****************************************STM32 EEPROM<4F><4D>д<EFBFBD>⺯<EFBFBD><E2BAAF>****************************************/
|
|||
|
u16 STMFLASH_ReadHalfWord(u32 faddr); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
void STMFLASH_WriteLenByte(u32 WriteAddr,u32 DataToWrite,u16 Len); //ָ<><D6B8><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʼд<CABC><D0B4>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
u32 STMFLASH_ReadLenByte(u32 ReadAddr,u16 Len); //ָ<><D6B8><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʼ<EFBFBD><CABC>ȡָ<C8A1><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
void STMFLASH_Write(u32 WriteAddr,u16 *pBuffer,u16 NumToWrite); //<2F><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʼд<CABC><D0B4>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
void STMFLASH_Read(u32 ReadAddr,u16 *pBuffer,u16 NumToRead); //<2F><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD>ȵ<EFBFBD><C8B5><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
|||
|
|
|||
|
|
|||
|
#endif
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|