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.
61 lines
3.0 KiB
61 lines
3.0 KiB
5 months ago
|
/*
|
||
|
*********************************************************************************************************
|
||
|
*
|
||
|
* ģ������ : cpu�ڲ�falsh����ģ��
|
||
|
* �ļ����� : bsp_cpu_flash.h
|
||
|
* �� �� : V1.0
|
||
|
*
|
||
|
* Copyright (C), 2013-2014, ���������� www.armfly.com
|
||
|
*
|
||
|
*********************************************************************************************************
|
||
|
*/
|
||
|
|
||
|
#ifndef _BSP_CPU_FLASH_H_
|
||
|
#define _BSP_CPU_FLASH_H_
|
||
|
|
||
|
#include "main.h"
|
||
|
|
||
|
|
||
|
#define CPU_FLASH_BASE_ADDR (uint32_t)(FLASH_BASE) /* 0x08000000 */
|
||
|
#define CPU_FLASH_END_ADDR (uint32_t)(0x081FFFFF)
|
||
|
|
||
|
#define CPU_FLASH_SIZE (2 * 1024 * 1024) /* FLASH������ */
|
||
|
#define CPU_FLASH_SECTOR_SIZE (128 * 1024) /* ������С���ֽ� */
|
||
|
|
||
|
/* Base address of the Flash sectors Bank 1 */
|
||
|
#define ADDR_FLASH_SECTOR_0_BANK1 ((uint32_t)0x08000000) /* Base @ of Sector 0, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_1_BANK1 ((uint32_t)0x08020000) /* Base @ of Sector 1, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_2_BANK1 ((uint32_t)0x08040000) /* Base @ of Sector 2, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_3_BANK1 ((uint32_t)0x08060000) /* Base @ of Sector 3, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_4_BANK1 ((uint32_t)0x08080000) /* Base @ of Sector 4, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_5_BANK1 ((uint32_t)0x080A0000) /* Base @ of Sector 5, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_6_BANK1 ((uint32_t)0x080C0000) /* Base @ of Sector 6, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_7_BANK1 ((uint32_t)0x080E0000) /* Base @ of Sector 7, 128 Kbytes */
|
||
|
|
||
|
/* Base address of the Flash sectors Bank 2 */
|
||
|
#define ADDR_FLASH_SECTOR_0_BANK2 ((uint32_t)0x08100000) /* Base @ of Sector 0, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_1_BANK2 ((uint32_t)0x08120000) /* Base @ of Sector 1, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_2_BANK2 ((uint32_t)0x08140000) /* Base @ of Sector 2, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_3_BANK2 ((uint32_t)0x08160000) /* Base @ of Sector 3, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_4_BANK2 ((uint32_t)0x08180000) /* Base @ of Sector 4, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_5_BANK2 ((uint32_t)0x081A0000) /* Base @ of Sector 5, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_6_BANK2 ((uint32_t)0x081C0000) /* Base @ of Sector 6, 128 Kbytes */
|
||
|
#define ADDR_FLASH_SECTOR_7_BANK2 ((uint32_t)0x081E0000) /* Base @ of Sector 7, 128 Kbytes */
|
||
|
|
||
|
#define FLASH_IS_EQU 0 /* Flash���ݺʹ�д�����������ȣ�����Ҫ������д���� */
|
||
|
#define FLASH_REQ_WRITE 1 /* Flash����Ҫ������ֱ��д */
|
||
|
#define FLASH_REQ_ERASE 2 /* Flash��Ҫ�Ȳ���,��д */
|
||
|
#define FLASH_PARAM_ERR 3 /* ������������ */
|
||
|
|
||
|
uint8_t bsp_ReadCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpDst, uint32_t _ulSize);
|
||
|
uint8_t bsp_WriteCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpSrc, uint32_t _ulSize);
|
||
|
uint8_t bsp_CmpCpuFlash(uint32_t _ulFlashAddr, uint8_t *_ucpBuf, uint32_t _ulSize);
|
||
|
|
||
|
uint8_t bsp_EraseCpuFlash(uint32_t _ulFlashAddr);
|
||
|
|
||
|
#endif
|
||
|
|
||
|
|
||
|
/***************************** ���������� www.armfly.com (END OF FILE) *********************************/
|
||
|
|