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

📄 low_level_init.c

📁 采用IAR在线调试ADI公司基于ARM7内核的ADUC7026的ExternalMemory代码
💻 C
字号:
/**************************************************
 *
 * This module contains the function `__low_level_init', a function
 * that is called before the `main' function of the program.  Normally
 * low-level initializations - such as setting the prefered interrupt
 * level or setting the watchdog - can be performed here.
 *
 * Note that this function is called before the data segments are
 * initialized, this means that this function cannot rely on the
 * values of global or static variables.
 *
 * When this function returns zero, the startup code will inhibit the
 * initialization of the data segments. The result is faster startup,
 * the drawback is that neither global nor static data will be
 * initialized.
 *
 * Copyright 1999-2004 IAR Systems. All rights reserved.
 *
 * $Revision: 1.7 $
 *
 **************************************************/

/* ICODE is the same segment as cstartup. By placing __low_level_init
 * in the same segment, we make sure it can be reached with BL. */
#include "ioaduc7026.h"
#ifdef __cplusplus
extern "C" {
#endif

#pragma language=extended

__interwork int __low_level_init(void);

#pragma location="ICODE"
__interwork int __low_level_init(void)
{
  /*==================================*/
  /*  Initialize hardware.            */
  /*==================================*/

  /*==================================*/
  /* Choose if segment initialization */
  /* should be done or not.           */
  /* Return: 0 to omit seg_init       */
  /*         1 to run seg_init        */
  /*==================================*/

	GP1CON = 0x011;							// Setup tx & rx pins on P1.0 and P1.1
	GP0CON = 0x220;							// ext mem mode for BHE & BLE
	GP2CON = 0x22222220;
	GP3CON = 0x22222222;
	GP4CON = 0x22222222;
	
											// configure ext mem port
// Enable External Memory
	XMCFG = 0x1;
	XM0CON = 0x3;							// enable ext mem in 16-bit mode
	XM0PAR = 0x70FF;  

  // Do what ever is neccessary to configure the external memory segment
  // either here or in the cstartup file.

  return (1);
}

#pragma language=default

#ifdef __cplusplus
}
#endif

⌨️ 快捷键说明

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