📄 lpc2103.h
字号:
/***************************************************************************
**
** This file defines the Special Function Registers for
** NXP LPC2101
**
** Used with ICCARM and AARM.
**
** (c) Copyright IAR Systems 2003
**
** $Revision: 22899 $
**
** Note: Only little endian addressing of 8 bit registers.
***************************************************************************/
#ifndef __IOLPC2101_H
#define __IOLPC2101_H
#if (((__TID__ >> 8) & 0x7F) != 0x4F) /* 0x4F = 79 dec */
#error This file should only be compiled by ICCARM/AARM
#endif
#include "io_macros.h"
/***************************************************************************
***************************************************************************
**
** IOLPC2101 SPECIAL FUNCTION REGISTERS
**
***************************************************************************
***************************************************************************
***************************************************************************/
/* C specific declarations ************************************************/
#ifdef __IAR_SYSTEMS_ICC__
#ifndef _SYSTEM_BUILD
#pragma system_include
#endif
/* External Interrupt Register */
typedef struct{
__REG32 EINT0 : 1;
__REG32 EINT1 : 1;
__REG32 EINT2 : 1;
__REG32 :29;
} __extint_bits;
/* External Interrupt Wakeup Register */
typedef struct{
__REG32 EXTWAKE0 : 1;
__REG32 EXTWAKE1 : 1;
__REG32 EXTWAKE2 : 1;
__REG32 :12;
__REG32 RTCWAKE : 1;
__REG32 :16;
} __extwake_bits;
/* External Interrupt Mode Register */
typedef struct{
__REG32 EXTMODE0 : 1;
__REG32 EXTMODE1 : 1;
__REG32 EXTMODE2 : 1;
__REG32 :29;
} __extmode_bits;
/* External Interrupt Polarity Register */
typedef struct{
__REG32 EXTPOLAR0 : 1;
__REG32 EXTPOLAR1 : 1;
__REG32 EXTPOLAR2 : 1;
__REG32 :29;
} __extpol_bits;
/* System Control/Status Flags Register */
typedef struct{
__REG32 GPIO0M : 1;
__REG32 :31;
} __scs_bits;
/* Memory Mapping Control Register */
typedef struct{
__REG32 MAP : 2;
__REG32 :30;
} __memmap_bits;
/* PLL Control Register */
typedef struct{
__REG32 PLLE : 1;
__REG32 PLLC : 1;
__REG32 :30;
} __pllcon_bits;
/* PLL Config Register */
typedef struct{
__REG32 MSEL : 5;
__REG32 PSEL : 2;
__REG32 :25;
} __pllcfg_bits;
/* PLL Status Register */
typedef struct{
__REG32 MSEL : 5;
__REG32 PSEL : 2;
__REG32 : 1;
__REG32 PLLE : 1;
__REG32 PLLC : 1;
__REG32 PLOCK : 1;
__REG32 :21;
} __pllstat_bits;
/* PLL Feed Register */
typedef struct{
__REG32 FEED : 8;
__REG32 :24;
} __pllfeed_bits;
/* Power Control Register */
typedef struct{
__REG32 IDL : 1;
__REG32 PD : 1;
__REG32 :30;
} __pcon_bits;
/* Power Control For Peripherals Register */
typedef struct{
__REG32 : 1;
__REG32 PCTIM0 : 1;
__REG32 PCTIM1 : 1;
__REG32 PCUART0 : 1;
__REG32 PCUART1 : 1;
__REG32 : 2;
__REG32 PCI2C0 : 1;
__REG32 PCSPI : 1;
__REG32 PCRTC : 1;
__REG32 PCSSP : 1;
__REG32 : 1;
__REG32 PCAD : 1;
__REG32 : 6;
__REG32 PCI2C1 : 1;
__REG32 : 8;
__REG32 PCTIM2 : 1;
__REG32 PCTIM3 : 1;
__REG32 : 2;
} __pconp_bits;
/* Reset Source Identification Register */
typedef struct{
__REG32 POR : 1;
__REG32 EXTR : 1;
__REG32 WDTR : 1;
__REG32 :29;
} __rsir_bits;
/* APB Divider Register */
typedef struct{
__REG32 APBDIV : 2;
__REG32 :30;
} __apbdiv_bits;
/* Memory Accelerator Module Control Register */
typedef struct{
__REG32 MODECTRL : 2;
__REG32 :30;
} __mamcr_bits;
/* Memory Accelerator Module Timing Register */
typedef struct{
__REG32 CYCLES : 3;
__REG32 :29;
} __mamtim_bits;
/* VIC Interrupt Registers */
typedef struct{
__REG32 WDT : 1;
__REG32 : 1;
__REG32 DEBUGRX : 1;
__REG32 DEBUGTX : 1;
__REG32 TIMER0 : 1;
__REG32 TIMER1 : 1;
__REG32 UART0 : 1;
__REG32 UART1 : 1;
__REG32 : 1;
__REG32 I2C0 : 1;
__REG32 SPI0 : 1;
__REG32 SSP : 1;
__REG32 PLL : 1;
__REG32 RTC : 1;
__REG32 EINT0 : 1;
__REG32 EINT1 : 1;
__REG32 EINT2 : 1;
__REG32 : 1;
__REG32 AD0 : 1;
__REG32 I2C1 : 1;
__REG32 : 6;
__REG32 TIMER2 : 1;
__REG32 TIMER3 : 1;
__REG32 : 4;
} __vicint_bits;
/* VIC Vector Control Registers */
typedef struct{
__REG32 NUMBER : 5;
__REG32 ENABLED : 1;
__REG32 :26;
} __vicvectcntl_bits;
/* VIC Protection Enable Register */
typedef struct{
__REG32 PROTECT : 1;
__REG32 :31;
} __vicprotection_bits;
/* Pin Function Select Register 0 */
typedef struct{
__REG32 P0_0 : 2;
__REG32 P0_1 : 2;
__REG32 P0_2 : 2;
__REG32 P0_3 : 2;
__REG32 P0_4 : 2;
__REG32 P0_5 : 2;
__REG32 P0_6 : 2;
__REG32 P0_7 : 2;
__REG32 P0_8 : 2;
__REG32 P0_9 : 2;
__REG32 P0_10 : 2;
__REG32 P0_11 : 2;
__REG32 P0_12 : 2;
__REG32 P0_13 : 2;
__REG32 P0_14 : 2;
__REG32 P0_15 : 2;
} __pinsel0_bits;
/* Pin Function Select Register 1 */
typedef struct{
__REG32 P0_16 : 2;
__REG32 P0_17 : 2;
__REG32 P0_18 : 2;
__REG32 P0_19 : 2;
__REG32 P0_20 : 2;
__REG32 P0_21 : 2;
__REG32 P0_22 : 2;
__REG32 P0_23 : 2;
__REG32 P0_24 : 2;
__REG32 P0_25 : 2;
__REG32 P0_26 : 2;
__REG32 P0_27 : 2;
__REG32 P0_28 : 2;
__REG32 P0_29 : 2;
__REG32 P0_30 : 2;
__REG32 P0_31 : 2;
} __pinsel1_bits;
/* GPIO Registers */
typedef struct {
__REG32 P0_0 : 1;
__REG32 P0_1 : 1;
__REG32 P0_2 : 1;
__REG32 P0_3 : 1;
__REG32 P0_4 : 1;
__REG32 P0_5 : 1;
__REG32 P0_6 : 1;
__REG32 P0_7 : 1;
__REG32 P0_8 : 1;
__REG32 P0_9 : 1;
__REG32 P0_10 : 1;
__REG32 P0_11 : 1;
__REG32 P0_12 : 1;
__REG32 P0_13 : 1;
__REG32 P0_14 : 1;
__REG32 P0_15 : 1;
__REG32 P0_16 : 1;
__REG32 P0_17 : 1;
__REG32 P0_18 : 1;
__REG32 P0_19 : 1;
__REG32 P0_20 : 1;
__REG32 P0_21 : 1;
__REG32 P0_22 : 1;
__REG32 P0_23 : 1;
__REG32 P0_24 : 1;
__REG32 P0_25 : 1;
__REG32 P0_26 : 1;
__REG32 P0_27 : 1;
__REG32 P0_28 : 1;
__REG32 P0_29 : 1;
__REG32 P0_30 : 1;
__REG32 P0_31 : 1;
} __gpio_bits;
/* FGPIO Registers */
typedef union{
//FIODIR
//FIOMASK
//FIOPIN
//FIOSET
//FIOCLR
struct {
__REG32 P0_0 : 1;
__REG32 P0_1 : 1;
__REG32 P0_2 : 1;
__REG32 P0_3 : 1;
__REG32 P0_4 : 1;
__REG32 P0_5 : 1;
__REG32 P0_6 : 1;
__REG32 P0_7 : 1;
__REG32 P0_8 : 1;
__REG32 P0_9 : 1;
__REG32 P0_10 : 1;
__REG32 P0_11 : 1;
__REG32 P0_12 : 1;
__REG32 P0_13 : 1;
__REG32 P0_14 : 1;
__REG32 P0_15 : 1;
__REG32 P0_16 : 1;
__REG32 P0_17 : 1;
__REG32 P0_18 : 1;
__REG32 P0_19 : 1;
__REG32 P0_20 : 1;
__REG32 P0_21 : 1;
__REG32 P0_22 : 1;
__REG32 P0_23 : 1;
__REG32 P0_24 : 1;
__REG32 P0_25 : 1;
__REG32 P0_26 : 1;
__REG32 P0_27 : 1;
__REG32 P0_28 : 1;
__REG32 P0_29 : 1;
__REG32 P0_30 : 1;
__REG32 P0_31 : 1;
};
struct
{
union
{
//FIODIR0
//FIOMASK0
//FIOPIN0
//FIOSET0
//FIOCLR0
struct{
__REG8 P0_0 : 1;
__REG8 P0_1 : 1;
__REG8 P0_2 : 1;
__REG8 P0_3 : 1;
__REG8 P0_4 : 1;
__REG8 P0_5 : 1;
__REG8 P0_6 : 1;
__REG8 P0_7 : 1;
} __byte0_bit;
__REG8 __byte0;
};
union
{
//FIODIR1
//FIOMASK1
//FIOPIN1
//FIOSET1
//FIOCLR1
struct{
__REG8 P0_0 : 1;
__REG8 P0_1 : 1;
__REG8 P0_2 : 1;
__REG8 P0_3 : 1;
__REG8 P0_4 : 1;
__REG8 P0_5 : 1;
__REG8 P0_6 : 1;
__REG8 P0_7 : 1;
} __byte1_bit;
__REG8 __byte1;
};
union
{
//FIODIR2
//FIOMASK2
//FIOPIN2
//FIOSET2
//FIOCLR2
struct{
__REG8 P0_0 : 1;
__REG8 P0_1 : 1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -