1 /****************************************************************************//**
3 * @brief : CMSIS Cortex-M3 Core Peripheral Access Layer Header File for
4 * NXP LPC17xx Device Series
6 * @date : 14th May 2009
7 *----------------------------------------------------------------------------
9 * Copyright (C) 2008 ARM Limited. All rights reserved.
11 * ARM Limited (ARM) is supplying this software for use with Cortex-M3
12 * processor based microcontrollers. This file can be freely distributed
13 * within development tools that are supporting such ARM based processors.
15 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
16 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
18 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
19 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
21 ******************************************************************************/
27 ///////////////////////////////////////////////////////////////////////////////
29 #define KVPB_CHUNK_SIZE 16
31 ///////////////////////////////////////////////////////////////////////////////
32 // ISP_RAM2FLASH_BLOCK_SIZE for 17xx CPU
33 #ifndef ISP_RAM2FLASH_BLOCK_SIZE
34 #define ISP_RAM2FLASH_BLOCK_SIZE 256
35 #endif /* ISP_RAM2FLASH_BLOCK_SIZE */
37 /** @addtogroup CMSIS_Configuration
42 * ==========================================================================
43 * ---------- Interrupt Number Definition -----------------------------------
44 * ==========================================================================
48 * @brief Interrupt Number Type Definition
52 /****** Cortex-M3 Processor Exceptions Numbers ***************************************************/
53 NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
54 MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
55 BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
56 UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
57 SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
58 DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
59 PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
60 SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
62 /****** LPC17xx Specific Interrupt Numbers *******************************************************/
63 WDT_IRQn = 0, /*!< Watchdog Timer Interrupt */
64 TIMER0_IRQn = 1, /*!< Timer0 Interrupt */
65 TIMER1_IRQn = 2, /*!< Timer1 Interrupt */
66 TIMER2_IRQn = 3, /*!< Timer2 Interrupt */
67 TIMER3_IRQn = 4, /*!< Timer3 Interrupt */
68 UART0_IRQn = 5, /*!< UART0 Interrupt */
69 UART1_IRQn = 6, /*!< UART1 Interrupt */
70 UART2_IRQn = 7, /*!< UART2 Interrupt */
71 UART3_IRQn = 8, /*!< UART3 Interrupt */
72 PWM1_IRQn = 9, /*!< PWM1 Interrupt */
73 I2C0_IRQn = 10, /*!< I2C0 Interrupt */
74 I2C1_IRQn = 11, /*!< I2C1 Interrupt */
75 I2C2_IRQn = 12, /*!< I2C2 Interrupt */
76 SPI_IRQn = 13, /*!< SPI Interrupt */
77 SSP0_IRQn = 14, /*!< SSP0 Interrupt */
78 SSP1_IRQn = 15, /*!< SSP1 Interrupt */
79 PLL0_IRQn = 16, /*!< PLL0 Lock (Main PLL) Interrupt */
80 RTC_IRQn = 17, /*!< Real Time Clock Interrupt */
81 EINT0_IRQn = 18, /*!< External Interrupt 0 Interrupt */
82 EINT1_IRQn = 19, /*!< External Interrupt 1 Interrupt */
83 EINT2_IRQn = 20, /*!< External Interrupt 2 Interrupt */
84 EINT3_IRQn = 21, /*!< External Interrupt 3 Interrupt */
85 ADC_IRQn = 22, /*!< A/D Converter Interrupt */
86 BOD_IRQn = 23, /*!< Brown-Out Detect Interrupt */
87 USB_IRQn = 24, /*!< USB Interrupt */
88 CAN_IRQn = 25, /*!< CAN Interrupt */
89 DMA_IRQn = 26, /*!< General Purpose DMA Interrupt */
90 I2S_IRQn = 27, /*!< I2S Interrupt */
91 ENET_IRQn = 28, /*!< Ethernet Interrupt */
92 RIT_IRQn = 29, /*!< Repetitive Interrupt Timer Interrupt */
93 MCPWM_IRQn = 30, /*!< Motor Control PWM Interrupt */
94 QEI_IRQn = 31, /*!< Quadrature Encoder Interface Interrupt */
95 PLL1_IRQn = 32, /*!< PLL1 Lock (USB PLL) Interrupt */
100 * ==========================================================================
101 * ----------- Processor and Core Peripheral Section ------------------------
102 * ==========================================================================
105 /* Configuration of the Cortex-M3 Processor and Core Peripherals */
106 #define __MPU_PRESENT 1 /*!< MPU present or not */
107 #define __NVIC_PRIO_BITS 5 /*!< Number of Bits used for Priority Levels */
108 #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
114 #include "core_cm3.h" /* Cortex-M3 processor and core peripherals */
119 * Initialize the system clock
124 * @brief Setup the microcontroller system.
125 * Initialize the System and update the SystemFrequency variable.
127 extern void SystemInit (void);
130 /** @addtogroup Peripheral_register_structures
134 /******************************************************************************/
135 /* Device Specific Peripheral registers structures */
136 /******************************************************************************/
138 //#ifndef __IAR_SYSTEMS_ICC__
139 //#pragma anon_unions
143 /*------------- System Control (SC) ------------------------------------------*/
145 * @brief System Control Structure Type Definition
149 __IO uint32_t FLASHCFG; /* Flash Accelerator Module */
150 uint32_t RESERVED0[31];
151 __IO uint32_t PLL0CON; /* Clocking and Power Control */
152 __IO uint32_t PLL0CFG;
153 __I uint32_t PLL0STAT;
154 __O uint32_t PLL0FEED;
155 uint32_t RESERVED1[4];
156 __IO uint32_t PLL1CON;
157 __IO uint32_t PLL1CFG;
158 __I uint32_t PLL1STAT;
159 __O uint32_t PLL1FEED;
160 uint32_t RESERVED2[4];
163 uint32_t RESERVED3[15];
164 __IO uint32_t CCLKCFG;
165 __IO uint32_t USBCLKCFG;
166 __IO uint32_t CLKSRCSEL;
167 uint32_t RESERVED4[12];
168 __IO uint32_t EXTINT; /* External Interrupts */
170 __IO uint32_t EXTMODE;
171 __IO uint32_t EXTPOLAR;
172 uint32_t RESERVED6[12];
173 __IO uint32_t RSID; /* Reset */
174 uint32_t RESERVED7[7];
175 __IO uint32_t SCS; /* Syscon Miscellaneous Registers */
176 __IO uint32_t IRCTRIM; /* Clock Dividers */
177 __IO uint32_t PCLKSEL0;
178 __IO uint32_t PCLKSEL1;
179 uint32_t RESERVED8[4];
180 __IO uint32_t USBIntSt; /* USB Device/OTG Interrupt Register */
182 __IO uint32_t CLKOUTCFG; /* Clock Output Configuration */
185 /*------------- Pin Connect Block (PINCON) -----------------------------------*/
187 * @brief Pin Connect (Select) Structure Type Definition
191 __IO uint32_t PINSEL0;
192 __IO uint32_t PINSEL1;
193 __IO uint32_t PINSEL2;
194 __IO uint32_t PINSEL3;
195 __IO uint32_t PINSEL4;
196 __IO uint32_t PINSEL5;
197 __IO uint32_t PINSEL6;
198 __IO uint32_t PINSEL7;
199 __IO uint32_t PINSEL8;
200 __IO uint32_t PINSEL9;
201 __IO uint32_t PINSEL10;
202 uint32_t RESERVED0[5];
203 __IO uint32_t PINMODE0;
204 __IO uint32_t PINMODE1;
205 __IO uint32_t PINMODE2;
206 __IO uint32_t PINMODE3;
207 __IO uint32_t PINMODE4;
208 __IO uint32_t PINMODE5;
209 __IO uint32_t PINMODE6;
210 __IO uint32_t PINMODE7;
211 __IO uint32_t PINMODE8;
212 __IO uint32_t PINMODE9;
213 __IO uint32_t PINMODE_OD0;
214 __IO uint32_t PINMODE_OD1;
215 __IO uint32_t PINMODE_OD2;
216 __IO uint32_t PINMODE_OD3;
217 __IO uint32_t PINMODE_OD4;
218 __IO uint32_t I2CPADCFG;
222 /*------------- General Purpose Input/Output (GPIO) --------------------------*/
224 * @brief GPIO Structure Type Definition
228 __IO uint32_t FIODIR;
229 uint32_t RESERVED0[3];
230 __IO uint32_t FIOMASK;
231 __IO uint32_t FIOPIN;
232 __IO uint32_t FIOSET;
237 * @brief GPIO Interrupt Structure Type Definition
241 __I uint32_t IntStatus;
242 __I uint32_t IO0IntStatR;
243 __I uint32_t IO0IntStatF;
244 __O uint32_t IO0IntClr;
245 __IO uint32_t IO0IntEnR;
246 __IO uint32_t IO0IntEnF;
247 uint32_t RESERVED0[3];
248 __I uint32_t IO2IntStatR;
249 __I uint32_t IO2IntStatF;
250 __O uint32_t IO2IntClr;
251 __IO uint32_t IO2IntEnR;
252 __IO uint32_t IO2IntEnF;
255 /*------------- Timer (TIM) --------------------------------------------------*/
257 * @brief Timer Structure Type Definition
274 uint32_t RESERVED0[2];
276 uint32_t RESERVED1[24];
280 /*------------- Pulse-Width Modulation (PWM) ---------------------------------*/
282 * @brief Pulse Width ModulationStructure Type Definition
307 uint32_t RESERVED1[7];
311 /*------------- Universal Asynchronous Receiver Transmitter (UART) -----------*/
313 * @brief Universal Asynchronous Receiver Transmitter 0/2/3 Structure Type Definition
335 uint8_t RESERVED1[7];
337 uint8_t RESERVED2[7];
339 uint8_t RESERVED3[3];
345 uint8_t RESERVED5[39];
346 __I uint32_t FIFOLVL;
350 * @brief Universal Asynchronous Receiver Transmitter 1 Structure Type Definition
369 uint8_t RESERVED1[3];
371 uint8_t RESERVED2[3];
373 uint8_t RESERVED3[3];
375 uint8_t RESERVED4[3];
377 uint8_t RESERVED5[3];
383 uint8_t RESERVED8[27];
384 __IO uint8_t RS485CTRL;
385 uint8_t RESERVED9[3];
386 __IO uint8_t ADRMATCH;
387 uint8_t RESERVED10[3];
388 __IO uint8_t RS485DLY;
389 uint8_t RESERVED11[3];
390 __IO uint32_t FIFOLVL;
394 /*------------- Serial Peripheral Interface (SPI) ----------------------------*/
396 * @brief Serial Peripheral InterfaceStructure Type Definition
404 uint32_t RESERVED0[3];
408 /*------------- Synchronous Serial Communication (SSP) -----------------------*/
410 * @brief Synchronous Serial Communication Structure Type Definition
426 /*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
428 * @brief Inter-Intergrated Circuit Structure Type Definition
432 __IO uint32_t I2CONSET;
435 __IO uint32_t I2ADR0;
436 __IO uint32_t I2SCLH;
437 __IO uint32_t I2SCLL;
438 __O uint32_t I2CONCLR;
439 __IO uint32_t MMCTRL;
440 __IO uint32_t I2ADR1;
441 __IO uint32_t I2ADR2;
442 __IO uint32_t I2ADR3;
443 __I uint32_t I2DATA_BUFFER;
444 __IO uint32_t I2MASK0;
445 __IO uint32_t I2MASK1;
446 __IO uint32_t I2MASK2;
447 __IO uint32_t I2MASK3;
450 /*------------- Inter IC Sound (I2S) -----------------------------------------*/
452 * @brief Inter IC Sound Structure Type Definition
456 __IO uint32_t I2SDAO;
457 __IO uint32_t I2SDAI;
458 __O uint32_t I2STXFIFO;
459 __I uint32_t I2SRXFIFO;
460 __I uint32_t I2SSTATE;
461 __IO uint32_t I2SDMA1;
462 __IO uint32_t I2SDMA2;
463 __IO uint32_t I2SIRQ;
464 __IO uint32_t I2STXRATE;
465 __IO uint32_t I2SRXRATE;
466 __IO uint32_t I2STXBITRATE;
467 __IO uint32_t I2SRXBITRATE;
468 __IO uint32_t I2STXMODE;
469 __IO uint32_t I2SRXMODE;
472 /*------------- Repetitive Interrupt Timer (RIT) -----------------------------*/
474 * @brief Repetitive Interrupt Timer Structure Type Definition
478 __IO uint32_t RICOMPVAL;
479 __IO uint32_t RIMASK;
481 uint8_t RESERVED0[3];
482 __IO uint32_t RICOUNTER;
485 /*------------- Real-Time Clock (RTC) ----------------------------------------*/
487 * @brief Real Time Clock Structure Type Definition
492 uint8_t RESERVED0[7];
494 uint8_t RESERVED1[3];
496 uint8_t RESERVED2[3];
498 uint8_t RESERVED3[3];
503 uint8_t RESERVED4[3];
505 uint8_t RESERVED5[3];
507 uint8_t RESERVED6[3];
509 uint8_t RESERVED7[3];
511 uint8_t RESERVED8[3];
515 uint8_t RESERVED10[3];
518 __IO uint32_t CALIBRATION;
519 __IO uint32_t GPREG0;
520 __IO uint32_t GPREG1;
521 __IO uint32_t GPREG2;
522 __IO uint32_t GPREG3;
523 __IO uint32_t GPREG4;
524 __IO uint8_t WAKEUPDIS;
525 uint8_t RESERVED12[3];
526 __IO uint8_t PWRCTRL;
527 uint8_t RESERVED13[3];
529 uint8_t RESERVED14[3];
531 uint8_t RESERVED15[3];
533 uint8_t RESERVED16[3];
535 uint8_t RESERVED17[3];
537 uint8_t RESERVED18[3];
541 uint8_t RESERVED20[3];
542 __IO uint16_t ALYEAR;
547 /*------------- Watchdog Timer (WDT) -----------------------------------------*/
549 * @brief Watchdog Timer Structure Type Definition
554 uint8_t RESERVED0[3];
557 uint8_t RESERVED1[3];
559 __IO uint32_t WDCLKSEL;
562 /*------------- Analog-to-Digital Converter (ADC) ----------------------------*/
564 * @brief Analog to Digital Structure Type Definition
570 #ifndef __LPC17XX_REV00
573 __IO uint32_t ADINTEN;
587 /*------------- Digital-to-Analog Converter (DAC) ----------------------------*/
589 * @brief Digital to Analog Structure Type Definition
594 __IO uint32_t DACCTRL;
595 __IO uint16_t DACCNTVAL;
598 /*------------- Motor Control Pulse-Width Modulation (MCPWM) -----------------*/
600 * @brief Motor Control Pulse Width Modulation Structure Type Definition
605 __O uint32_t MCCON_SET;
606 __O uint32_t MCCON_CLR;
607 __I uint32_t MCCAPCON;
608 __O uint32_t MCCAPCON_SET;
609 __O uint32_t MCCAPCON_CLR;
610 __IO uint32_t MCTIM0;
611 __IO uint32_t MCTIM1;
612 __IO uint32_t MCTIM2;
613 __IO uint32_t MCPER0;
614 __IO uint32_t MCPER1;
615 __IO uint32_t MCPER2;
619 __IO uint32_t MCDEADTIME;
624 __I uint32_t MCINTEN;
625 __O uint32_t MCINTEN_SET;
626 __O uint32_t MCINTEN_CLR;
627 __I uint32_t MCCNTCON;
628 __O uint32_t MCCNTCON_SET;
629 __O uint32_t MCCNTCON_CLR;
630 __I uint32_t MCINTFLAG;
631 __O uint32_t MCINTFLAG_SET;
632 __O uint32_t MCINTFLAG_CLR;
633 __O uint32_t MCCAP_CLR;
636 /*------------- Quadrature Encoder Interface (QEI) ---------------------------*/
638 * @brief Quadrature Encoder Interface Structure Type Definition
643 __I uint32_t QEISTAT;
644 __IO uint32_t QEICONF;
646 __IO uint32_t QEIMAXPOS;
647 __IO uint32_t CMPOS0;
648 __IO uint32_t CMPOS1;
649 __IO uint32_t CMPOS2;
651 __IO uint32_t INXCMP;
652 __IO uint32_t QEILOAD;
653 __I uint32_t QEITIME;
656 __IO uint32_t VELCOMP;
657 __IO uint32_t FILTER;
658 uint32_t RESERVED0[998];
661 __I uint32_t QEIINTSTAT;
667 /*------------- Controller Area Network (CAN) --------------------------------*/
669 * @brief Control Area Network Structure Type Definition
673 __IO uint32_t mask[512]; /* ID Masks */
677 * @brief Acceptance Filter Structure Type Definition
679 typedef struct /* Acceptance Filter Registers */
682 __IO uint32_t SFF_sa;
683 __IO uint32_t SFF_GRP_sa;
684 __IO uint32_t EFF_sa;
685 __IO uint32_t EFF_GRP_sa;
686 __IO uint32_t ENDofTable;
687 __I uint32_t LUTerrAd;
689 __IO uint32_t FCANIE;
690 __I uint32_t FCANIC0;
691 __I uint32_t FCANIC1;
695 * @brief CAN Central Structure Type Definition
697 typedef struct /* Central Registers */
699 __I uint32_t CANTxSR;
700 __I uint32_t CANRxSR;
705 * @brief CAN Controller Structure Type Definition
707 typedef struct /* Controller Registers */
735 /*------------- General Purpose Direct Memory Access (GPDMA) -----------------*/
737 * @brief General Purpose Direct Memory Access Structure Type Definition
739 typedef struct /* Common Registers */
741 __I uint32_t DMACIntStat;
742 __I uint32_t DMACIntTCStat;
743 __O uint32_t DMACIntTCClear;
744 __I uint32_t DMACIntErrStat;
745 __O uint32_t DMACIntErrClr;
746 __I uint32_t DMACRawIntTCStat;
747 __I uint32_t DMACRawIntErrStat;
748 __I uint32_t DMACEnbldChns;
749 __IO uint32_t DMACSoftBReq;
750 __IO uint32_t DMACSoftSReq;
751 __IO uint32_t DMACSoftLBReq;
752 __IO uint32_t DMACSoftLSReq;
753 __IO uint32_t DMACConfig;
754 __IO uint32_t DMACSync;
758 * @brief GPDMA Channel Structure Type Definition
760 typedef struct /* Channel Registers */
762 __IO uint32_t DMACCSrcAddr;
763 __IO uint32_t DMACCDestAddr;
764 __IO uint32_t DMACCLLI;
765 __IO uint32_t DMACCControl;
766 __IO uint32_t DMACCConfig;
770 /*------------- Universal Serial Bus (USB) -----------------------------------*/
772 * @brief Universal Serial Bus Structure Type Definition
776 __I uint32_t HcRevision; /* USB Host Registers */
777 __IO uint32_t HcControl;
778 __IO uint32_t HcCommandStatus;
779 __IO uint32_t HcInterruptStatus;
780 __IO uint32_t HcInterruptEnable;
781 __IO uint32_t HcInterruptDisable;
782 __IO uint32_t HcHCCA;
783 __I uint32_t HcPeriodCurrentED;
784 __IO uint32_t HcControlHeadED;
785 __IO uint32_t HcControlCurrentED;
786 __IO uint32_t HcBulkHeadED;
787 __IO uint32_t HcBulkCurrentED;
788 __I uint32_t HcDoneHead;
789 __IO uint32_t HcFmInterval;
790 __I uint32_t HcFmRemaining;
791 __I uint32_t HcFmNumber;
792 __IO uint32_t HcPeriodicStart;
793 __IO uint32_t HcLSTreshold;
794 __IO uint32_t HcRhDescriptorA;
795 __IO uint32_t HcRhDescriptorB;
796 __IO uint32_t HcRhStatus;
797 __IO uint32_t HcRhPortStatus1;
798 __IO uint32_t HcRhPortStatus2;
799 uint32_t RESERVED0[40];
800 __I uint32_t Module_ID;
802 __I uint32_t OTGIntSt; /* USB On-The-Go Registers */
803 __IO uint32_t OTGIntEn;
804 __O uint32_t OTGIntSet;
805 __O uint32_t OTGIntClr;
806 __IO uint32_t OTGStCtrl;
807 __IO uint32_t OTGTmr;
808 uint32_t RESERVED1[58];
810 __I uint32_t USBDevIntSt; /* USB Device Interrupt Registers */
811 __IO uint32_t USBDevIntEn;
812 __O uint32_t USBDevIntClr;
813 __O uint32_t USBDevIntSet;
815 __O uint32_t USBCmdCode; /* USB Device SIE Command Registers */
816 __I uint32_t USBCmdData;
818 __I uint32_t USBRxData; /* USB Device Transfer Registers */
819 __O uint32_t USBTxData;
820 __I uint32_t USBRxPLen;
821 __O uint32_t USBTxPLen;
822 __IO uint32_t USBCtrl;
823 __O uint32_t USBDevIntPri;
825 __I uint32_t USBEpIntSt; /* USB Device Endpoint Interrupt Regs */
826 __IO uint32_t USBEpIntEn;
827 __O uint32_t USBEpIntClr;
828 __O uint32_t USBEpIntSet;
829 __O uint32_t USBEpIntPri;
831 __IO uint32_t USBReEp; /* USB Device Endpoint Realization Reg*/
832 __O uint32_t USBEpInd;
833 __IO uint32_t USBMaxPSize;
835 __I uint32_t USBDMARSt; /* USB Device DMA Registers */
836 __O uint32_t USBDMARClr;
837 __O uint32_t USBDMARSet;
838 uint32_t RESERVED2[9];
839 __IO uint32_t USBUDCAH;
840 __I uint32_t USBEpDMASt;
841 __O uint32_t USBEpDMAEn;
842 __O uint32_t USBEpDMADis;
843 __I uint32_t USBDMAIntSt;
844 __IO uint32_t USBDMAIntEn;
845 uint32_t RESERVED3[2];
846 __I uint32_t USBEoTIntSt;
847 __O uint32_t USBEoTIntClr;
848 __O uint32_t USBEoTIntSet;
849 __I uint32_t USBNDDRIntSt;
850 __O uint32_t USBNDDRIntClr;
851 __O uint32_t USBNDDRIntSet;
852 __I uint32_t USBSysErrIntSt;
853 __O uint32_t USBSysErrIntClr;
854 __O uint32_t USBSysErrIntSet;
855 uint32_t RESERVED4[15];
857 __I uint32_t I2C_RX; /* USB OTG I2C Registers */
859 __I uint32_t I2C_STS;
860 __IO uint32_t I2C_CTL;
861 __IO uint32_t I2C_CLKHI;
862 __O uint32_t I2C_CLKLO;
863 uint32_t RESERVED5[823];
866 __IO uint32_t USBClkCtrl; /* USB Clock Control Registers */
867 __IO uint32_t OTGClkCtrl;
870 __I uint32_t USBClkSt;
871 __I uint32_t OTGClkSt;
875 /*------------- Ethernet Media Access Controller (EMAC) ----------------------*/
877 * @brief Ethernet Media Access Controller Structure Type Definition
881 __IO uint32_t MAC1; /* MAC Registers */
895 uint32_t RESERVED0[2];
899 uint32_t RESERVED1[45];
900 __IO uint32_t Command; /* Control Registers */
902 __IO uint32_t RxDescriptor;
903 __IO uint32_t RxStatus;
904 __IO uint32_t RxDescriptorNumber;
905 __I uint32_t RxProduceIndex;
906 __IO uint32_t RxConsumeIndex;
907 __IO uint32_t TxDescriptor;
908 __IO uint32_t TxStatus;
909 __IO uint32_t TxDescriptorNumber;
910 __IO uint32_t TxProduceIndex;
911 __I uint32_t TxConsumeIndex;
912 uint32_t RESERVED2[10];
916 uint32_t RESERVED3[3];
917 __IO uint32_t FlowControlCounter;
918 __I uint32_t FlowControlStatus;
919 uint32_t RESERVED4[34];
920 __IO uint32_t RxFilterCtrl; /* Rx Filter Registers */
921 __IO uint32_t RxFilterWoLStatus;
922 __IO uint32_t RxFilterWoLClear;
924 __IO uint32_t HashFilterL;
925 __IO uint32_t HashFilterH;
926 uint32_t RESERVED6[882];
927 __I uint32_t IntStatus; /* Module Control Registers */
928 __IO uint32_t IntEnable;
929 __O uint32_t IntClear;
932 __IO uint32_t PowerDown;
934 __IO uint32_t Module_ID;
937 //#ifndef __IAR_SYSTEMS_ICC__
938 //#pragma no_anon_unions
946 /** @addtogroup Peripheral_memory_map
950 /******************************************************************************/
951 /* Peripheral memory map */
952 /******************************************************************************/
954 #define FLASH_BASE (0x00000000UL)
955 #define RAM_BASE (0x10000000UL)
956 #ifdef __LPC17XX_REV00
957 #define AHBRAM0_BASE (0x20000000UL)
958 #define AHBRAM1_BASE (0x20004000UL)
960 #define AHBRAM0_BASE (0x2007C000UL)
961 #define AHBRAM1_BASE (0x20080000UL)
962 #define GPIO_BASE (0x2009C000UL)
964 #define APB0_BASE (0x40000000UL)
965 #define APB1_BASE (0x40080000UL)
966 #define AHB_BASE (0x50000000UL)
967 #define CM3_BASE (0xE0000000UL)
969 #ifdef __LPC17XX_REV00
970 #define GPIO_BASE (AHB_BASE + 0x14000)
973 /* APB0 peripherals */
974 #define WDT_BASE (APB0_BASE + 0x00000)
975 #define TIM0_BASE (APB0_BASE + 0x04000)
976 #define TIM1_BASE (APB0_BASE + 0x08000)
977 #define UART0_BASE (APB0_BASE + 0x0C000)
978 #define UART1_BASE (APB0_BASE + 0x10000)
979 #define PWM1_BASE (APB0_BASE + 0x18000)
980 #define I2C0_BASE (APB0_BASE + 0x1C000)
981 #define SPI_BASE (APB0_BASE + 0x20000)
982 #define RTC_BASE (APB0_BASE + 0x24000)
983 #define GPIOINT_BASE (APB0_BASE + 0x28080)
984 #define PINCON_BASE (APB0_BASE + 0x2C000)
985 #define SSP1_BASE (APB0_BASE + 0x30000)
986 #define ADC_BASE (APB0_BASE + 0x34000)
987 #define CANAF_RAM_BASE (APB0_BASE + 0x38000)
988 #define CANAF_BASE (APB0_BASE + 0x3C000)
989 #define CANCR_BASE (APB0_BASE + 0x40000)
990 #define CAN1_BASE (APB0_BASE + 0x44000)
991 #define CAN2_BASE (APB0_BASE + 0x48000)
992 #define I2C1_BASE (APB0_BASE + 0x5C000)
994 /* APB1 peripherals */
995 #define SSP0_BASE (APB1_BASE + 0x08000)
996 #define DAC_BASE (APB1_BASE + 0x0C000)
997 #define TIM2_BASE (APB1_BASE + 0x10000)
998 #define TIM3_BASE (APB1_BASE + 0x14000)
999 #define UART2_BASE (APB1_BASE + 0x18000)
1000 #define UART3_BASE (APB1_BASE + 0x1C000)
1001 #define I2C2_BASE (APB1_BASE + 0x20000)
1002 #define I2S_BASE (APB1_BASE + 0x28000)
1003 #define RIT_BASE (APB1_BASE + 0x30000)
1004 #define MCPWM_BASE (APB1_BASE + 0x38000)
1005 #define QEI_BASE (APB1_BASE + 0x3C000)
1006 #define SC_BASE (APB1_BASE + 0x7C000)
1008 /* AHB peripherals */
1009 #define EMAC_BASE (AHB_BASE + 0x00000)
1010 #define GPDMA_BASE (AHB_BASE + 0x04000)
1011 #define GPDMACH0_BASE (AHB_BASE + 0x04100)
1012 #define GPDMACH1_BASE (AHB_BASE + 0x04120)
1013 #define GPDMACH2_BASE (AHB_BASE + 0x04140)
1014 #define GPDMACH3_BASE (AHB_BASE + 0x04160)
1015 #define GPDMACH4_BASE (AHB_BASE + 0x04180)
1016 #define GPDMACH5_BASE (AHB_BASE + 0x041A0)
1017 #define GPDMACH6_BASE (AHB_BASE + 0x041C0)
1018 #define GPDMACH7_BASE (AHB_BASE + 0x041E0)
1019 #define USB_BASE (AHB_BASE + 0x0C000)
1022 #define GPIO0_BASE (GPIO_BASE + 0x00000)
1023 #define GPIO1_BASE (GPIO_BASE + 0x00020)
1024 #define GPIO2_BASE (GPIO_BASE + 0x00040)
1025 #define GPIO3_BASE (GPIO_BASE + 0x00060)
1026 #define GPIO4_BASE (GPIO_BASE + 0x00080)
1033 /** @addtogroup Peripheral_declaration
1037 /******************************************************************************/
1038 /* Peripheral declaration */
1039 /******************************************************************************/
1040 #define SC (( SC_TypeDef *) SC_BASE)
1041 #define GPIO0 (( GPIO_TypeDef *) GPIO0_BASE)
1042 #define GPIO1 (( GPIO_TypeDef *) GPIO1_BASE)
1043 #define GPIO2 (( GPIO_TypeDef *) GPIO2_BASE)
1044 #define GPIO3 (( GPIO_TypeDef *) GPIO3_BASE)
1045 #define GPIO4 (( GPIO_TypeDef *) GPIO4_BASE)
1046 #define WDT (( WDT_TypeDef *) WDT_BASE)
1047 #define TIM0 (( TIM_TypeDef *) TIM0_BASE)
1048 #define TIM1 (( TIM_TypeDef *) TIM1_BASE)
1049 #define TIM2 (( TIM_TypeDef *) TIM2_BASE)
1050 #define TIM3 (( TIM_TypeDef *) TIM3_BASE)
1051 #define RIT (( RIT_TypeDef *) RIT_BASE)
1052 #define UART0 (( UART_TypeDef *) UART0_BASE)
1053 #define UART1 (( UART1_TypeDef *) UART1_BASE)
1054 #define UART2 (( UART_TypeDef *) UART2_BASE)
1055 #define UART3 (( UART_TypeDef *) UART3_BASE)
1056 #define PWM1 (( PWM_TypeDef *) PWM1_BASE)
1057 #define I2C0 (( I2C_TypeDef *) I2C0_BASE)
1058 #define I2C1 (( I2C_TypeDef *) I2C1_BASE)
1059 #define I2C2 (( I2C_TypeDef *) I2C2_BASE)
1060 #define I2S (( I2S_TypeDef *) I2S_BASE)
1061 #define SPI (( SPI_TypeDef *) SPI_BASE)
1062 #define RTC (( RTC_TypeDef *) RTC_BASE)
1063 #define GPIOINT ((GPIOINT_TypeDef *) GPIOINT_BASE)
1064 #define PINCON (( PINCON_TypeDef *) PINCON_BASE)
1065 #define SSP0 (( SSP_TypeDef *) SSP0_BASE)
1066 #define SSP1 (( SSP_TypeDef *) SSP1_BASE)
1067 #define ADC (( ADC_TypeDef *) ADC_BASE)
1068 #define DAC (( DAC_TypeDef *) DAC_BASE)
1069 #define CANAF_RAM ((CANAF_RAM_TypeDef *)CANAF_RAM_BASE)
1070 #define CANAF (( CANAF_TypeDef *) CANAF_BASE)
1071 #define CANCR (( CANCR_TypeDef *) CANCR_BASE)
1072 #define CAN1 (( CAN_TypeDef *) CAN1_BASE)
1073 #define CAN2 (( CAN_TypeDef *) CAN2_BASE)
1074 #define MCPWM (( MCPWM_TypeDef *) MCPWM_BASE)
1075 #define QEI (( QEI_TypeDef *) QEI_BASE)
1076 #define EMAC (( EMAC_TypeDef *) EMAC_BASE)
1077 #define GPDMA (( GPDMA_TypeDef *) GPDMA_BASE)
1078 #define DMAREQSEL (*(__IO uint32_t *) ( 0x4000C1C4))
1079 #define GPDMACH0 ((GPDMACH_TypeDef *) GPDMACH0_BASE)
1080 #define GPDMACH1 ((GPDMACH_TypeDef *) GPDMACH1_BASE)
1081 #define GPDMACH2 ((GPDMACH_TypeDef *) GPDMACH2_BASE)
1082 #define GPDMACH3 ((GPDMACH_TypeDef *) GPDMACH3_BASE)
1083 #define GPDMACH4 ((GPDMACH_TypeDef *) GPDMACH4_BASE)
1084 #define GPDMACH5 ((GPDMACH_TypeDef *) GPDMACH5_BASE)
1085 #define GPDMACH6 ((GPDMACH_TypeDef *) GPDMACH6_BASE)
1086 #define GPDMACH7 ((GPDMACH_TypeDef *) GPDMACH7_BASE)
1087 #define USB (( USB_TypeDef *) USB_BASE)
1093 #endif // __LPC17xx_H__
1095 /* End Of File ---------------------------------------------------------------- */