41 lines
1.1 KiB
C
41 lines
1.1 KiB
C
|
|
/*
|
|||
|
|
*********************************************************************************************************
|
|||
|
|
* IAR Development Kits
|
|||
|
|
* on the
|
|||
|
|
*
|
|||
|
|
* M451
|
|||
|
|
*
|
|||
|
|
* Filename : fmc_flash.h
|
|||
|
|
* Version : V1.00
|
|||
|
|
* Programmer(s) : Qian Xianghong
|
|||
|
|
*********************************************************************************************************
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#ifndef USER_FMC_FLASH_PRESENT
|
|||
|
|
#define USER_FMC_FLASH_PRESENT
|
|||
|
|
|
|||
|
|
#include "stm32l4xx_hal_flash.h"
|
|||
|
|
#include "stm32l4xx_hal_flash_ex.h"
|
|||
|
|
|
|||
|
|
#include "type.h"
|
|||
|
|
|
|||
|
|
// Flash<73>洢<EFBFBD>滮<EFBFBD><E6BBAE><EFBFBD>£<EFBFBD>
|
|||
|
|
// 252~255K: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݣ<EFBFBD>2K+2K<32><4B>˫<EFBFBD>ݴ洢<DDB4><E6B4A2>
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC>ַ<EFBFBD><D6B7>252K<32><4B><EFBFBD><EFBFBD>СΪ4K<34><4B>
|
|||
|
|
#define FLASH_CONFIG_BASE (FLASH_BASE + 0x3F000)
|
|||
|
|
|
|||
|
|
// Flash<73>ɲ<EFBFBD><C9B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>С
|
|||
|
|
#define FLASH_ERASE_SIZE 2048
|
|||
|
|
// <20><>Flashȫ<68>ֻ<EFBFBD><D6BB><EFBFBD>
|
|||
|
|
extern uint8_t Flash_rdBuf[FLASH_ERASE_SIZE];
|
|||
|
|
|
|||
|
|
uint8_t Flash_BufferVerify(uint32_t Addr, uint8_t *buf, uint32_t nbytes);
|
|||
|
|
void Flash_BufferRead(uint32_t Addr, uint8_t *buf, uint32_t nbytes);
|
|||
|
|
void Flash_BufferWrite(uint32_t Addr, uint8_t *buf, uint32_t nbytes);
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD>һҳ
|
|||
|
|
void Flash_ErasePage(uint32_t Addr);
|
|||
|
|
|
|||
|
|
#endif
|