freescale
来自「Freescale 系列单片机常用模块与综合系统设计」· 代码 · 共 37 行
TXT
37 行
#ifndef __jm60_flash__
#define __jm60_flash__
#include "IO_Map.h"
extern unsigned char FlashBuffer[55];
#define FLASH_MASS_ERASE_CMD 0x41
#define FLASH_ERASE_CMD 0x40
#define FLASH_PROGRAM_CMD 0x20
#define FLASH_BURST_CMD 0x25
#define BUS_CLOCK 24000000
#if BUS_CLOCK > 12800000
#define FLASH_CLOCK (unsigned char)((BUS_CLOCK/1600000) + 0x40)
#else
#define FLASH_CLOCK (unsigned char)(BUS_CLOCK/200000)
#endif
/* Macros to call the function using the different features */
#define Flash_Erase(Address) \
Flash_Cmd((unsigned int)Address, (unsigned int)1, (unsigned char*) &FlashBuffer[0], FLASH_ERASE_CMD)
#define Flash_Program(Address, Data) \
Flash_Cmd((unsigned int)Address, (unsigned int)1, (unsigned char*)&Data, FLASH_PROGRAM_CMD)
#define Flash_Burst(Address, Size, DataPtr) \
Flash_Cmd((unsigned int)Address, (unsigned int)Size, (unsigned char*)DataPtr, FLASH_BURST_CMD)
#pragma CODE_SEG FLASH_ROUTINES
unsigned char Flash_Cmd(unsigned int FlashAddress, unsigned int FlashDataCounter, unsigned char* pFlashDataPtr, unsigned char FlashCommand);
#pragma CODE_SEG DEFAULT
void FlashInit(void);
void CopyInRAM(void);
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?