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

📄 eb55.h

📁 at91rm9200基于多媒体控制接口控制smc卡的控制程序
💻 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           : eb55.h
//* Object              : AT91M55800A Evaluation Board Features Definition File.
//*
//* Compatibility	: Library V3
//*
//* 1.0 17/10/02  PFi   : Creation.
//*			  This file has been derived from the one in the AT91 C library
//*			  v2. It has been adapted to be compatible with the library v3.
//* Adaptations		:
//*	- AT91C_" has been added has defined in the LibV3 for each references to PIO lines.
//*	- New SW_MASK has been defined.
//*	- New LED_MASK has been defined.
//*	- LED_ON / LED_OFF definitions has been removed because the PIO functions in the
//*	  LibV3 allows to set or clear a PIO line directly.
//*
//* Modifications :
//*	- Wrong definition of MCK (in MHz) has been corrected. 32768 -> 32768000.
//*     - Wrong definition EBI_CSR_0 EBI_CSR_1
//*--------------------------------------------------------------------------------------
#ifndef eb55_h
#define eb55_h

//常数设置
#define TRUE 1
#define FALSE 0


//----------------------55800A内部设备开关定义---------------------------------
//WDT
#define WDT_EN
//USART
#define US0_EN
#define US1_EN
#define US2_EN
//TIMER
#define TC0_EN
#define TC1_EN
#define TC2_EN
#define TC3_EN
#define TC4_EN
#define TC5_EN
//ADC
#define ADC0_EN
#define ADC1_EN
//DAC
#define DAC0_EN
#define DAC1_EN
//SPI
#define SPI_EN
//I2C
#define I2C_EN
//IRQ
#define FIRQ_EN
#define IRQ0_EN
#define IRQ1_EN
#define IRQ2_EN
#define IRQ3_EN
#define IRQ4_EN

//--------------------中断优先级定义---------------------------
#define FIQ_INTERRUPT_LEVEL			7 //最高级
#define USART0_INTERRUPT_LEVEL		6
#define USART1_INTERRUPT_LEVEL		6
#define TIMER0_INTERRUPT_LEVEL		5
#define TIMER1_INTERRUPT_LEVEL		4
#define TIMER2_INTERRUPT_LEVEL		3
#define TIMER3_INTERRUPT_LEVEL		2
#define SOFT_INTERRUPT_LEVEL		1
#define PIO_INTERRUPT_LEVEL			1
#define IRQ0_INTERRUPT_LEVEL		0 //最低级

/*-----------------*/
/* Clock Selection */
/*-----------------*/
#define TC_CLKS                  0x7
#define TC_CLKS_MCK2             0x0
#define TC_CLKS_MCK8             0x1
#define TC_CLKS_MCK32            0x2
#define TC_CLKS_MCK128           0x3
#define TC_CLKS_MCK1024          0x4

/*---------------------------------------*/
/* AT91EB55 External Memories Definition */
/*---------------------------------------*/

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

/* SRAM : size is depending on the devices fitted on the board */
#define EXT_SRAM_BASE           (0x02000000)
#define EXT_SRAM_DEFAULT_SIZE   (256*1024)
#define EXT_SRAM_LIMIT  (EXT_SRAM_BASE+EXT_SRAM_SIZE)

/*---------------------------------------------------------------------------*/
/* EBI Initialization Data                                                   */
/*---------------------------------------------------------------------------*/
/* The EBI User Interface Image which is copied by the boot.                 */
/* 32 MHz 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.          */
/*---------------------------------------------------------------------------*/
#define EBI_CSR_0       ((unsigned int )(FLASH_BASE | 0x2529))     /* 0x01000000, 16MB, 2 tdf, 16 bits, 3 WS  */
#define EBI_CSR_1       ((unsigned int )(EXT_SRAM_BASE | 0x2121))  /* 0x02000000, 16MB, 0 hold, 16 bits, 1 WS */
#define EBI_CSR_2       ((unsigned int )0x20000000)               /* unused */
#define EBI_CSR_3       ((unsigned int )0x30000000)               /* unused */
#define EBI_CSR_4       ((unsigned int )0x40000000)               /* unused */
#define EBI_CSR_5       ((unsigned int )0x50000000)               /* unused */
#define EBI_CSR_6       ((unsigned int )0x60000000)               /* unused */
#define EBI_CSR_7       ((unsigned int )0x70000000)               /* unused */

/*-----------------*/
/* Leds Definition */
/*-----------------*/
#define LED1            AT91C_PIO_PB8
#define LED2            AT91C_PIO_PB9
#define LED3            AT91C_PIO_PB10
#define LED4            AT91C_PIO_PB11
#define LED5            AT91C_PIO_PB12
#define LED6            AT91C_PIO_PB13
#define LED7            AT91C_PIO_PB14
#define LED8            AT91C_PIO_PB15
#define LED_MASK        (LED1 | LED2 | LED3 | LED4 | LED5 | LED6 | LED7 | LED8)

/*-------------------------*/
/* Push Buttons Definition */
/*-------------------------*/
#define SW1_MASK        AT91C_PIO_PB20		
#define SW2_MASK        AT91C_PIO_PA9		// IRQ0
#define SW3_MASK        AT91C_PIO_PB17
#define SW4_MASK        AT91C_PIO_PB19
#define SW_MASK         (SW1_MASK|SW4_MASK|SW3_MASK)

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

#define SCL             AT91C_PA1
#define SDA             AT91C_PA2
#define PIO_SCL         1
#define PIO_SDA         2

/*--------------*/
/* Battery      */
/*--------------*/

#define FASTCHG_CTRL    AT91C_PB18
#define FASTCHG_ON      0x0
#define FASTCHG_OFF     0x1

/*-----------------*/
/*  A/D Converter  */
/*-----------------*/
#define AD_NCONVST      AT91C_PB19
#define START_CONV      0x0

#define LOOP_DAC1_AD0   //* with CB6 Closed
#define LOOP_DAC0_AD4   //* with CB5 Closed

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

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

#define EXT_QUARTZ      16000000


#endif /* eb55_h */

⌨️ 快捷键说明

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