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

📄 eb40a.h

📁 ARM入门的好帮手.包含了从简单到相对较复杂的程序.
💻 H
字号:
//*----------------------------------------------------------------------------
//*         ATMEL Microcontroller Software Support  -  ROUSSET  -
//*----------------------------------------------------------------------------
//* The software is delivered "AS IS" without warranty or condition of any
//* kind, either express, implied or statutory. This includes without
//* limitation any warranty or condition with respect to merchantability or
//* fitness for any particular purpose, or against the infringements of
//* intellectual property rights of others.
//*----------------------------------------------------------------------------
//* File Name           : eb40a.h
//* Object              : AT91R40008 Evaluation Board Features Definition File.
//*
//* 1.0 23/05/00  PFi   : Creation
//* 1.1 11/01/02  PFi   : Internal/External SRAM Definition Clean-up
//*----------------------------------------------------------------------------
#ifndef eb40a_h
#define eb40a_h

#include    "parts/r40008/r40008.h"      /* library definition */


/*---------------------------------------*/
/* AT91EB40A External Memories Definition */
/*---------------------------------------*/

/* Flash Memory : AT49BV1614 1M*16 */
#define FLASH_BASE      ((u_int *)0x01000000)
#define FLASH_SIZE      (2*1024*1024)                /* byte */

//***************
//*  WARNING !!!*
//***************
//*- WARNING !! No External SRAM memories are fitted on the board.
//*- This definition is only if the user adds external SRAM devices.

//* The following definition are put in comments
//* #define     EXT_SRAM_BASE      0x02000000
//* #define     EXT_SRAM_SIZE      (256*1024)
//* #define     EXT_SRAM_LIMIT     (EXT_SRAM_BASE + EXT_SRAM_SIZE)

//* Redefinition of External SRAM to Internal SRAM
#define EXT_SRAM_BASE       RAM_LIMIT                   // 8K (8*1024)
#define EXT_SRAM_SIZE       (RAM_SIZE-RAM_LIMIT)        // 256K (256*1024) - 8K (8*1024)
#define EXT_SRAM_LIMIT      (RAM_BASE + RAM_SIZE)       // SRAM_LIMIT = 0x40000

//* -------------------------------------------------------------------------------------------------------------------
//*      Internal Memory Mapping    |            Internal Memory Mapping      |         Internal Memory Mapping
//*        with ICE Debugger        |              with Angel Monitor         |           with ROMed Application
//* -------------------------------------------------------------------------------------------------------------------
//*                                 |                                         |
//* 0x40000  ---------------        |       0x40000  ---------------          |    0x40000  ---------------
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |     USED      |         |            |               |
//*         |               |       |               |      BY       |         |            |               |
//*         |               |       |               |     ANGEL     |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |     248K      |       |               |               |         |            |     248K      |
//*         |   for user    |       |               |               |         |            |   for user    |
//*         |  application* |       |               |               |         |            |  application* |
//* 0x20000 |               |       |       0x20000  ---------------          |    0x20000 |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |     120K      |         |            |               |
//*         |               |       |               |   for user    |         |            |               |
//*         |               |       |               |  application* |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//*         |               |       |               |               |         |            |               |
//* 0x2000   ---------------        |       0x2000   ---------------          |    0x2000   ---------------
//*         |               |       |               |               |         |            |               |
//*         |      8K       |       |               |      8K       |         |            |      8K       |
//*         |               |       |               |               |         |            |               |
//* 0x0      ---------------        |       0x0      ---------------          |    0x0      ---------------
//*                                 |                                         |
//*                                 |                                         |
//* -------------------------------------------------------------------------------------------------------------------
//*                                 |                                         |
//* 0x40000 = TOP_APPLICATION_STACK |       0x40000 = TOP_APPLICATION_STACK   |    0x40000 = TOP_APPLICATION_STACK
//* 0x02000 = TOP_EXCEPTION_STACK   |       0x02000 = TOP_EXCEPTION_STACK     |    0x02000 = TOP_EXCEPTION_STACK
//*                                 |                                         |
//* *248K - TOP_APPLICATION_STACK   |       *120K - TOP_APPLICATION_STACK     |    *248K - TOP_APPLICATION_STACK
//*                                 |                                         |
//* -------------------------------------------------------------------------------------------------------------------


//*-------------------------------------------------------------------------------------------------------------
//* EBI Initialization Data
//*------------------------
//* The EBI User Interface Image which is copied by the boot.
//* 66MHz master clock assumed.
//* That's hardware! Details in the Electrical Datasheet of the AT91 device.
//* EBI Base Address is added at the end for commodity in copy code.
//*
//* EBI_CSR_1 configuration is removed because no external SRAM is fitted on the board. If External SRAM is added,
//* replace with the line below the EBI_CSR1 line.
//*
//*   #define EBI_CSR_1    (EXT_SRAM_BASE | 0x2525) ; 0x02000000, 16MB, 2 TDF, 16 bits, 2 WS
//*----------------------------------------------------------------------------------------------------------------
#define EBI_CSR_0       ((u_int *)(FLASH_BASE | 0x2539)     /* 0x01000000, 16MB, 2 tdf, 16 bits, 7 WS  */
#define EBI_CSR_1       ((u_int *)0x10000000)               /* unused */
#define EBI_CSR_2       ((u_int *)0x20000000)               /* unused */
#define EBI_CSR_3       ((u_int *)0x30000000)               /* unused */
#define EBI_CSR_4       ((u_int *)0x40000000)               /* unused */
#define EBI_CSR_5       ((u_int *)0x50000000)               /* unused */
#define EBI_CSR_6       ((u_int *)0x60000000)               /* unused */
#define EBI_CSR_7       ((u_int *)0x70000000)               /* unused */

/*-----------------*/
/* Leds Definition */
/*-----------------*/
#define LED1            P16
#define LED2            P17
#define LED3            P18
#define LED4            P19
#define LED5            P3
#define LED6            P4
#define LED7            P5
#define LED8            P6

#define LED_PIO_CTRL    1
#define LED_MASK        (LED1|LED2|LED3|LED4|LED5|LED6|LED7|LED8)

#define LED_ON          PIO_CLEAR_OUT
#define LED_OFF         PIO_SET_OUT

/*-------------------------*/
/* Push Buttons Definition */
/*-------------------------*/
#define SW1_MASK        (1<<12)
#define SW2_MASK        (1<<9)
#define SW3_MASK        (1<<1)
#define SW4_MASK        (1<<2)
#define SW_MASK         (SW1_MASK|SW2_MASK|SW3_MASK|SW4_MASK)

#define SW1             (1<<12)
#define SW2             (1<<9)
#define SW3             (1<<1)
#define SW4             (1<<2)

#define PIO_SW1         (1<<12)
#define PIO_SW2         (1<<9)
#define PIO_SW3         (1<<1)
#define PIO_SW4         (1<<2)

/*--------------------------*/
/* Serial EEPROM Definition */
/*--------------------------*/

#define SCL             (1<<8)
#define SDA             (1<<7)
#define PIO_SCL         (1<<8)
#define PIO_SDA         (1<<7)


/*--------------*/
/* Master Clock */
/*--------------*/

#define MCK             66000000
#define MCKKHz          (MCK/1000)

#endif /* eb40a_h */

⌨️ 快捷键说明

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