⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 integrator_target.c

📁 An111 is a quite old flashing equipment. It s the source code to drive old equipment.
💻 C
字号:
// *************************************************************************
//
// Copyright ARM Limited 1999 - 2003.  All rights reserved.
//
// *************************************************************************
//
//
// Target-specific code to get platform into correct mode
// to be able to program flash.
//
// *************************************************************************

#define INTEGRATOR_EBI_CSR1          0x12000004
#define INTEGRATOR_EBI_WRITE_ENABLE  0x04            
#define INTEGRATOR_EBI_LOCK          0x12000020
#define INTEGRATOR_SC_CTRLS          0x11000008
#define INTEGRATOR_SC_CTRL_nFLVPPEN  (1 << 1)
#define INTEGRATOR_SC_CTRL_nFLWP     (1 << 2)
#define INTEGRATOR_SC_CTRLC          0x1100000C


int Flash_Write_Enable ()
{

	*(volatile unsigned int *)INTEGRATOR_EBI_LOCK = 0xA05F;			// Unlock EBI registers
	*(volatile unsigned int *)INTEGRATOR_EBI_CSR1 |= INTEGRATOR_EBI_WRITE_ENABLE;	// Enable Writes to CS1 (Application Flash)
	*(volatile unsigned int *)INTEGRATOR_EBI_LOCK = 0;				// Lock EBI registers
	*(volatile unsigned int *)INTEGRATOR_SC_CTRLS =
		INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP;// Enable programming voltage & remove Flash write protection

    return 0;
}

int Flash_Write_Disable ()
{
	*(volatile unsigned int *)INTEGRATOR_EBI_LOCK = 0xA05F;
	*(volatile unsigned int *)INTEGRATOR_EBI_CSR1 &= ~INTEGRATOR_EBI_WRITE_ENABLE;
	*(volatile unsigned int *)INTEGRATOR_EBI_LOCK = 0;
	*(volatile unsigned int *)INTEGRATOR_SC_CTRLC =
		INTEGRATOR_SC_CTRL_nFLVPPEN | INTEGRATOR_SC_CTRL_nFLWP;

    return 0;
}



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -