1 /******************************************************************************
3 * @purpose: CMSIS Cortex-M3 Core Peripheral Access Layer Header File for
4 * NXP LPC17xx Device Series
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 ******************************************************************************/
28 * ==========================================================================
29 * ---------- Interrupt Number Definition -----------------------------------
30 * ==========================================================================
35 /****** Cortex-M3 Processor Exceptions Numbers ***************************************************/
36 NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
37 MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
38 BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
39 UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
40 SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
41 DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
42 PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
43 SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
45 /****** LPC17xx Specific Interrupt Numbers *******************************************************/
46 WDT_IRQn = 0, /*!< Watchdog Timer Interrupt */
47 TIMER0_IRQn = 1, /*!< Timer0 Interrupt */
48 TIMER1_IRQn = 2, /*!< Timer1 Interrupt */
49 TIMER2_IRQn = 3, /*!< Timer2 Interrupt */
50 TIMER3_IRQn = 4, /*!< Timer3 Interrupt */
51 UART0_IRQn = 5, /*!< UART0 Interrupt */
52 UART1_IRQn = 6, /*!< UART1 Interrupt */
53 UART2_IRQn = 7, /*!< UART2 Interrupt */
54 UART3_IRQn = 8, /*!< UART3 Interrupt */
55 PWM1_IRQn = 9, /*!< PWM1 Interrupt */
56 I2C0_IRQn = 10, /*!< I2C0 Interrupt */
57 I2C1_IRQn = 11, /*!< I2C1 Interrupt */
58 I2C2_IRQn = 12, /*!< I2C2 Interrupt */
59 SPI_IRQn = 13, /*!< SPI Interrupt */
60 SSP0_IRQn = 14, /*!< SSP0 Interrupt */
61 SSP1_IRQn = 15, /*!< SSP1 Interrupt */
62 PLL0_IRQn = 16, /*!< PLL0 Lock (Main PLL) Interrupt */
63 RTC_IRQn = 17, /*!< Real Time Clock Interrupt */
64 EINT0_IRQn = 18, /*!< External Interrupt 0 Interrupt */
65 EINT1_IRQn = 19, /*!< External Interrupt 1 Interrupt */
66 EINT2_IRQn = 20, /*!< External Interrupt 2 Interrupt */
67 EINT3_IRQn = 21, /*!< External Interrupt 3 Interrupt */
68 ADC_IRQn = 22, /*!< A/D Converter Interrupt */
69 BOD_IRQn = 23, /*!< Brown-Out Detect Interrupt */
70 USB_IRQn = 24, /*!< USB Interrupt */
71 CAN_IRQn = 25, /*!< CAN Interrupt */
72 DMA_IRQn = 26, /*!< General Purpose DMA Interrupt */
73 I2S_IRQn = 27, /*!< I2S Interrupt */
74 ENET_IRQn = 28, /*!< Ethernet Interrupt */
75 RIT_IRQn = 29, /*!< Repetitive Interrupt Timer Interrupt */
76 MCPWM_IRQn = 30, /*!< Motor Control PWM Interrupt */
77 QEI_IRQn = 31, /*!< Quadrature Encoder Interface Interrupt */
78 PLL1_IRQn = 32, /*!< PLL1 Lock (USB PLL) Interrupt */
83 * ==========================================================================
84 * ----------- Processor and Core Peripheral Section ------------------------
85 * ==========================================================================
88 /* Configuration of the Cortex-M3 Processor and Core Peripherals */
89 #define __MPU_PRESENT 1 /*!< MPU present or not */
90 #define __NVIC_PRIO_BITS 5 /*!< Number of Bits used for Priority Levels */
91 #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
94 #include "../cortex_m3/core_cm3.h" /* Cortex-M3 processor and core peripherals */
95 #include "system.h" /* System Header */
100 * Initialize the system clock
105 * @brief Setup the microcontroller system.
106 * Initialize the System and update the SystemFrequency variable.
108 extern void SystemInit (void);
111 /******************************************************************************/
112 /* Device Specific Peripheral registers structures */
113 /******************************************************************************/
115 /*------------- System Control (SC) ------------------------------------------*/
118 __IO uint32_t FLASHCFG; /* Flash Accelerator Module */
119 uint32_t RESERVED0[31];
120 __IO uint32_t PLL0CON; /* Clocking and Power Control */
121 __IO uint32_t PLL0CFG;
122 __I uint32_t PLL0STAT;
123 __O uint32_t PLL0FEED;
124 uint32_t RESERVED1[4];
125 __IO uint32_t PLL1CON;
126 __IO uint32_t PLL1CFG;
127 __I uint32_t PLL1STAT;
128 __O uint32_t PLL1FEED;
129 uint32_t RESERVED2[4];
132 uint32_t RESERVED3[15];
133 __IO uint32_t CCLKCFG;
134 __IO uint32_t USBCLKCFG;
135 __IO uint32_t CLKSRCSEL;
136 uint32_t RESERVED4[12];
137 __IO uint32_t EXTINT; /* External Interrupts */
139 __IO uint32_t EXTMODE;
140 __IO uint32_t EXTPOLAR;
141 uint32_t RESERVED6[12];
142 __IO uint32_t RSID; /* Reset */
143 uint32_t RESERVED7[7];
144 __IO uint32_t SCS; /* Syscon Miscellaneous Registers */
145 __IO uint32_t IRCTRIM; /* Clock Dividers */
146 __IO uint32_t PCLKSEL0;
147 __IO uint32_t PCLKSEL1;
148 uint32_t RESERVED8[4];
149 __IO uint32_t USBIntSt; /* USB Device/OTG Interrupt Register */
151 __IO uint32_t CLKOUTCFG; /* Clock Output Configuration */
154 /*------------- Pin Connect Block (PINCON) -----------------------------------*/
157 __IO uint32_t PINSEL0;
158 __IO uint32_t PINSEL1;
159 __IO uint32_t PINSEL2;
160 __IO uint32_t PINSEL3;
161 __IO uint32_t PINSEL4;
162 __IO uint32_t PINSEL5;
163 __IO uint32_t PINSEL6;
164 __IO uint32_t PINSEL7;
165 __IO uint32_t PINSEL8;
166 __IO uint32_t PINSEL9;
167 __IO uint32_t PINSEL10;
168 uint32_t RESERVED0[5];
169 __IO uint32_t PINMODE0;
170 __IO uint32_t PINMODE1;
171 __IO uint32_t PINMODE2;
172 __IO uint32_t PINMODE3;
173 __IO uint32_t PINMODE4;
174 __IO uint32_t PINMODE5;
175 __IO uint32_t PINMODE6;
176 __IO uint32_t PINMODE7;
177 __IO uint32_t PINMODE8;
178 __IO uint32_t PINMODE9;
179 __IO uint32_t PINMODE_OD0;
180 __IO uint32_t PINMODE_OD1;
181 __IO uint32_t PINMODE_OD2;
182 __IO uint32_t PINMODE_OD3;
183 __IO uint32_t PINMODE_OD4;
186 /*------------- General Purpose Input/Output (GPIO) --------------------------*/
189 __IO uint32_t FIODIR;
190 uint32_t RESERVED0[3];
191 __IO uint32_t FIOMASK;
192 __IO uint32_t FIOPIN;
193 __IO uint32_t FIOSET;
199 __I uint32_t IntStatus;
200 __I uint32_t IO0IntStatR;
201 __I uint32_t IO0IntStatF;
202 __O uint32_t IO0IntClr;
203 __IO uint32_t IO0IntEnR;
204 __IO uint32_t IO0IntEnF;
205 uint32_t RESERVED0[3];
206 __I uint32_t IO2IntStatR;
207 __I uint32_t IO2IntStatF;
208 __O uint32_t IO2IntClr;
209 __IO uint32_t IO2IntEnR;
210 __IO uint32_t IO2IntEnF;
213 /*------------- Timer (TIM) --------------------------------------------------*/
229 uint32_t RESERVED0[2];
231 uint32_t RESERVED1[24];
235 /*------------- Pulse-Width Modulation (PWM) ---------------------------------*/
258 uint32_t RESERVED0[7];
262 /*------------- Universal Asynchronous Receiver Transmitter (UART) -----------*/
280 uint8_t RESERVED1[7];
282 uint8_t RESERVED2[7];
284 uint8_t RESERVED3[3];
287 uint8_t RESERVED4[3];
289 uint8_t RESERVED5[7];
291 uint8_t RESERVED6[27];
292 __IO uint8_t RS485CTRL;
293 uint8_t RESERVED7[3];
294 __IO uint8_t ADRMATCH;
314 uint8_t RESERVED1[3];
316 uint8_t RESERVED2[3];
318 uint8_t RESERVED3[3];
320 uint8_t RESERVED4[3];
322 uint8_t RESERVED5[3];
328 uint8_t RESERVED8[27];
329 __IO uint8_t RS485CTRL;
330 uint8_t RESERVED9[3];
331 __IO uint8_t ADRMATCH;
332 uint8_t RESERVED10[3];
333 __IO uint8_t RS485DLY;
336 /*------------- Serial Peripheral Interface (SPI) ----------------------------*/
343 uint32_t RESERVED0[3];
347 /*------------- Synchronous Serial Communication (SSP) -----------------------*/
362 /*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
365 __IO uint32_t I2CONSET;
368 __IO uint32_t I2ADR0;
369 __IO uint32_t I2SCLH;
370 __IO uint32_t I2SCLL;
371 __O uint32_t I2CONCLR;
372 __IO uint32_t MMCTRL;
373 __IO uint32_t I2ADR1;
374 __IO uint32_t I2ADR2;
375 __IO uint32_t I2ADR3;
376 __I uint32_t I2DATA_BUFFER;
377 __IO uint32_t I2MASK0;
378 __IO uint32_t I2MASK1;
379 __IO uint32_t I2MASK2;
380 __IO uint32_t I2MASK3;
383 /*------------- Inter IC Sound (I2S) -----------------------------------------*/
386 __IO uint32_t I2SDAO;
388 __O uint32_t I2STXFIFO;
389 __I uint32_t I2SRXFIFO;
390 __I uint32_t I2SSTATE;
391 __IO uint32_t I2SDMA1;
392 __IO uint32_t I2SDMA2;
393 __IO uint32_t I2SIRQ;
394 __IO uint32_t I2STXRATE;
395 __IO uint32_t I2SRXRATE;
396 __IO uint32_t I2STXBITRATE;
397 __IO uint32_t I2SRXBITRATE;
398 __IO uint32_t I2STXMODE;
399 __IO uint32_t I2SRXMODE;
402 /*------------- Repetitive Interrupt Timer (RIT) -----------------------------*/
405 __IO uint32_t RICOMPVAL;
406 __IO uint32_t RIMASK;
408 uint8_t RESERVED0[3];
409 __IO uint32_t RICOUNTER;
412 /*------------- Real-Time Clock (RTC) ----------------------------------------*/
416 uint8_t RESERVED0[3];
418 uint8_t RESERVED1[3];
420 uint8_t RESERVED2[3];
422 uint8_t RESERVED3[3];
427 uint8_t RESERVED4[3];
429 uint8_t RESERVED5[3];
431 uint8_t RESERVED6[3];
433 uint8_t RESERVED7[3];
435 uint8_t RESERVED8[3];
439 uint8_t RESERVED10[3];
442 __IO uint32_t CALIBRATION;
443 __IO uint32_t GPREG0;
444 __IO uint32_t GPREG1;
445 __IO uint32_t GPREG2;
446 __IO uint32_t GPREG3;
447 __IO uint32_t GPREG4;
448 __IO uint8_t WAKEUPDIS;
449 uint8_t RESERVED12[3];
450 __IO uint8_t PWRCTRL;
451 uint8_t RESERVED13[3];
453 uint8_t RESERVED14[3];
455 uint8_t RESERVED15[3];
457 uint8_t RESERVED16[3];
459 uint8_t RESERVED17[3];
461 uint8_t RESERVED18[3];
465 uint8_t RESERVED20[3];
466 __IO uint16_t ALYEAR;
470 /*------------- Watchdog Timer (WDT) -----------------------------------------*/
474 uint8_t RESERVED0[3];
477 uint8_t RESERVED1[3];
479 __IO uint32_t WDCLKSEL;
482 /*------------- Analog-to-Digital Converter (ADC) ----------------------------*/
488 __IO uint32_t ADINTEN;
501 /*------------- Digital-to-Analog Converter (DAC) ----------------------------*/
505 __IO uint32_t DACCTRL;
506 __IO uint16_t DACCNTVAL;
509 /*------------- Motor Control Pulse-Width Modulation (MCPWM) -----------------*/
513 __O uint32_t MCCON_SET;
514 __O uint32_t MCCON_CLR;
515 __I uint32_t MCCAPCON;
516 __O uint32_t MCCAPCON_SET;
517 __O uint32_t MCCAPCON_CLR;
518 __IO uint32_t MCTIM0;
519 __IO uint32_t MCTIM1;
520 __IO uint32_t MCTIM2;
521 __IO uint32_t MCPER0;
522 __IO uint32_t MCPER1;
523 __IO uint32_t MCPER2;
527 __IO uint32_t MCDEADTIME;
532 __I uint32_t MCINTEN;
533 __O uint32_t MCINTEN_SET;
534 __O uint32_t MCINTEN_CLR;
535 __I uint32_t MCCNTCON;
536 __O uint32_t MCCNTCON_SET;
537 __O uint32_t MCCNTCON_CLR;
538 __I uint32_t MCINTFLAG;
539 __O uint32_t MCINTFLAG_SET;
540 __O uint32_t MCINTFLAG_CLR;
541 __O uint32_t MCCAP_CLR;
544 /*------------- Quadrature Encoder Interface (QEI) ---------------------------*/
548 __I uint32_t QEISTAT;
549 __IO uint32_t QEICONF;
551 __IO uint32_t QEIMAXPOS;
552 __IO uint32_t CMPOS0;
553 __IO uint32_t CMPOS1;
554 __IO uint32_t CMPOS2;
556 __IO uint32_t INXCMP;
557 __IO uint32_t QEILOAD;
558 __I uint32_t QEITIME;
561 __IO uint32_t VELCOMP;
562 __IO uint32_t FILTER;
563 uint32_t RESERVED0[998];
566 __I uint32_t QEIINTSTAT;
572 /*------------- Controller Area Network (CAN) --------------------------------*/
575 __IO uint32_t mask[512]; /* ID Masks */
578 typedef struct /* Acceptance Filter Registers */
581 __IO uint32_t SFF_sa;
582 __IO uint32_t SFF_GRP_sa;
583 __IO uint32_t EFF_sa;
584 __IO uint32_t EFF_GRP_sa;
585 __IO uint32_t ENDofTable;
586 __I uint32_t LUTerrAd;
590 typedef struct /* Central Registers */
592 __I uint32_t CANTxSR;
593 __I uint32_t CANRxSR;
597 typedef struct /* Controller Registers */
625 /*------------- General Purpose Direct Memory Access (GPDMA) -----------------*/
626 typedef struct /* Common Registers */
628 __I uint32_t DMACIntStat;
629 __I uint32_t DMACIntTCStat;
630 __O uint32_t DMACIntTCClear;
631 __I uint32_t DMACIntErrStat;
632 __O uint32_t DMACIntErrClr;
633 __I uint32_t DMACRawIntTCStat;
634 __I uint32_t DMACRawIntErrStat;
635 __I uint32_t DMACEnbldChns;
636 __IO uint32_t DMACSoftBReq;
637 __IO uint32_t DMACSoftSReq;
638 __IO uint32_t DMACSoftLBReq;
639 __IO uint32_t DMACSoftLSReq;
640 __IO uint32_t DMACConfig;
641 __IO uint32_t DMACSync;
644 typedef struct /* Channel Registers */
646 __IO uint32_t DMACCSrcAddr;
647 __IO uint32_t DMACCDestAddr;
648 __IO uint32_t DMACCLLI;
649 __IO uint32_t DMACCControl;
650 __IO uint32_t DMACCConfig;
653 /*------------- Universal Serial Bus (USB) -----------------------------------*/
656 __I uint32_t HcRevision; /* USB Host Registers */
657 __IO uint32_t HcControl;
658 __IO uint32_t HcCommandStatus;
659 __IO uint32_t HcInterruptStatus;
660 __IO uint32_t HcInterruptEnable;
661 __IO uint32_t HcInterruptDisable;
662 __IO uint32_t HcHCCA;
663 __I uint32_t HcPeriodCurrentED;
664 __IO uint32_t HcControlHeadED;
665 __IO uint32_t HcControlCurrentED;
666 __IO uint32_t HcBulkHeadED;
667 __IO uint32_t HcBulkCurrentED;
668 __I uint32_t HcDoneHead;
669 __IO uint32_t HcFmInterval;
670 __I uint32_t HcFmRemaining;
671 __I uint32_t HcFmNumber;
672 __IO uint32_t HcPeriodicStart;
673 __IO uint32_t HcLSTreshold;
674 __IO uint32_t HcRhDescriptorA;
675 __IO uint32_t HcRhDescriptorB;
676 __IO uint32_t HcRhStatus;
677 __IO uint32_t HcRhPortStatus1;
678 __IO uint32_t HcRhPortStatus2;
679 uint32_t RESERVED0[40];
680 __I uint32_t Module_ID;
682 __I uint32_t OTGIntSt; /* USB On-The-Go Registers */
683 __IO uint32_t OTGIntEn;
684 __O uint32_t OTGIntSet;
685 __O uint32_t OTGIntClr;
686 __IO uint32_t OTGStCtrl;
687 __IO uint32_t OTGTmr;
688 uint32_t RESERVED1[58];
690 __I uint32_t USBDevIntSt; /* USB Device Interrupt Registers */
691 __IO uint32_t USBDevIntEn;
692 __O uint32_t USBDevIntClr;
693 __O uint32_t USBDevIntSet;
695 __O uint32_t USBCmdCode; /* USB Device SIE Command Registers */
696 __I uint32_t USBCmdData;
698 __I uint32_t USBRxData; /* USB Device Transfer Registers */
699 __O uint32_t USBTxData;
700 __I uint32_t USBRxPLen;
701 __O uint32_t USBTxPLen;
702 __IO uint32_t USBCtrl;
703 __O uint32_t USBDevIntPri;
705 __I uint32_t USBEpIntSt; /* USB Device Endpoint Interrupt Regs */
706 __IO uint32_t USBEpIntEn;
707 __O uint32_t USBEpIntClr;
708 __O uint32_t USBEpIntSet;
709 __O uint32_t USBEpIntPri;
711 __IO uint32_t USBReEp; /* USB Device Endpoint Realization Reg*/
712 __O uint32_t USBEpInd;
713 __IO uint32_t USBMaxPSize;
715 __I uint32_t USBDMARSt; /* USB Device DMA Registers */
716 __O uint32_t USBDMARClr;
717 __O uint32_t USBDMARSet;
718 uint32_t RESERVED2[9];
719 __IO uint32_t USBUDCAH;
720 __I uint32_t USBEpDMASt;
721 __O uint32_t USBEpDMAEn;
722 __O uint32_t USBEpDMADis;
723 __I uint32_t USBDMAIntSt;
724 __IO uint32_t USBDMAIntEn;
725 uint32_t RESERVED3[2];
726 __I uint32_t USBEoTIntSt;
727 __O uint32_t USBEoTIntClr;
728 __O uint32_t USBEoTIntSet;
729 __I uint32_t USBNDDRIntSt;
730 __O uint32_t USBNDDRIntClr;
731 __O uint32_t USBNDDRIntSet;
732 __I uint32_t USBSysErrIntSt;
733 __O uint32_t USBSysErrIntClr;
734 __O uint32_t USBSysErrIntSet;
735 uint32_t RESERVED4[15];
737 __I uint32_t I2C_RX; /* USB OTG I2C Registers */
739 __I uint32_t I2C_STS;
740 __IO uint32_t I2C_CTL;
741 __IO uint32_t I2C_CLKHI;
742 __O uint32_t I2C_CLKLO;
743 uint32_t RESERVED5[823];
746 __IO uint32_t USBClkCtrl; /* USB Clock Control Registers */
747 __IO uint32_t OTGClkCtrl;
750 __I uint32_t USBClkSt;
751 __I uint32_t OTGClkSt;
755 /*------------- Ethernet Media Access Controller (EMAC) ----------------------*/
758 __IO uint32_t MAC1; /* MAC Registers */
772 uint32_t RESERVED0[2];
776 uint32_t RESERVED1[45];
777 __IO uint32_t Command; /* Control Registers */
779 __IO uint32_t RxDescriptor;
780 __IO uint32_t RxStatus;
781 __IO uint32_t RxDescriptorNumber;
782 __I uint32_t RxProduceIndex;
783 __IO uint32_t RxConsumeIndex;
784 __IO uint32_t TxDescriptor;
785 __IO uint32_t TxStatus;
786 __IO uint32_t TxDescriptorNumber;
787 __IO uint32_t TxProduceIndex;
788 __I uint32_t TxConsumeIndex;
789 uint32_t RESERVED2[10];
793 uint32_t RESERVED3[3];
794 __IO uint32_t FlowControlCounter;
795 __I uint32_t FlowControlStatus;
796 uint32_t RESERVED4[34];
797 __IO uint32_t RxFilterCtrl; /* Rx Filter Registers */
798 __IO uint32_t RxFilterWoLStatus;
799 __IO uint32_t RxFilterWoLClear;
801 __IO uint32_t HashFilterL;
802 __IO uint32_t HashFilterH;
803 uint32_t RESERVED6[882];
804 __I uint32_t IntStatus; /* Module Control Registers */
805 __IO uint32_t IntEnable;
806 __O uint32_t IntClear;
809 __IO uint32_t PowerDown;
811 __IO uint32_t Module_ID;
814 /******************************************************************************/
815 /* Peripheral memory map */
816 /******************************************************************************/
818 #define FLASH_BASE (0x00000000UL)
819 #define RAM_BASE (0x10000000UL)
820 #define GPIO_BASE (0x2009C000UL)
821 #define APB0_BASE (0x40000000UL)
822 #define APB1_BASE (0x40080000UL)
823 #define AHB_BASE (0x50000000UL)
824 #define CM3_BASE (0xE0000000UL)
826 /* APB0 peripherals */
827 #define WDT_BASE (APB0_BASE + 0x00000)
828 #define TIM0_BASE (APB0_BASE + 0x04000)
829 #define TIM1_BASE (APB0_BASE + 0x08000)
830 #define UART0_BASE (APB0_BASE + 0x0C000)
831 #define UART1_BASE (APB0_BASE + 0x10000)
832 #define PWM1_BASE (APB0_BASE + 0x18000)
833 #define I2C0_BASE (APB0_BASE + 0x1C000)
834 #define SPI_BASE (APB0_BASE + 0x20000)
835 #define RTC_BASE (APB0_BASE + 0x24000)
836 #define GPIOINT_BASE (APB0_BASE + 0x28080)
837 #define PINCON_BASE (APB0_BASE + 0x2C000)
838 #define SSP1_BASE (APB0_BASE + 0x30000)
839 #define ADC_BASE (APB0_BASE + 0x34000)
840 #define CANAF_RAM_BASE (APB0_BASE + 0x38000)
841 #define CANAF_BASE (APB0_BASE + 0x3C000)
842 #define CANCR_BASE (APB0_BASE + 0x40000)
843 #define CAN1_BASE (APB0_BASE + 0x44000)
844 #define CAN2_BASE (APB0_BASE + 0x48000)
845 #define I2C1_BASE (APB0_BASE + 0x5C000)
847 /* APB1 peripherals */
848 #define SSP0_BASE (APB1_BASE + 0x08000)
849 #define DAC_BASE (APB1_BASE + 0x0C000)
850 #define TIM2_BASE (APB1_BASE + 0x10000)
851 #define TIM3_BASE (APB1_BASE + 0x14000)
852 #define UART2_BASE (APB1_BASE + 0x18000)
853 #define UART3_BASE (APB1_BASE + 0x1C000)
854 #define I2C2_BASE (APB1_BASE + 0x20000)
855 #define I2S_BASE (APB1_BASE + 0x28000)
856 #define RIT_BASE (APB1_BASE + 0x30000)
857 #define MCPWM_BASE (APB1_BASE + 0x38000)
858 #define QEI_BASE (APB1_BASE + 0x3C000)
859 #define SC_BASE (APB1_BASE + 0x7C000)
861 /* AHB peripherals */
862 #define EMAC_BASE (AHB_BASE + 0x00000)
863 #define GPDMA_BASE (AHB_BASE + 0x04000)
864 #define GPDMACH0_BASE (AHB_BASE + 0x04100)
865 #define GPDMACH1_BASE (AHB_BASE + 0x04120)
866 #define GPDMACH2_BASE (AHB_BASE + 0x04140)
867 #define GPDMACH3_BASE (AHB_BASE + 0x04160)
868 #define GPDMACH4_BASE (AHB_BASE + 0x04180)
869 #define GPDMACH5_BASE (AHB_BASE + 0x041A0)
870 #define GPDMACH6_BASE (AHB_BASE + 0x041C0)
871 #define GPDMACH7_BASE (AHB_BASE + 0x041E0)
872 #define USB_BASE (AHB_BASE + 0x0C000)
875 #define GPIO0_BASE (GPIO_BASE + 0x00000)
876 #define GPIO1_BASE (GPIO_BASE + 0x00020)
877 #define GPIO2_BASE (GPIO_BASE + 0x00040)
878 #define GPIO3_BASE (GPIO_BASE + 0x00060)
879 #define GPIO4_BASE (GPIO_BASE + 0x00080)
882 /******************************************************************************/
883 /* Peripheral declaration */
884 /******************************************************************************/
885 #define SC (( SC_TypeDef *) SC_BASE)
886 #define GPIO0 (( GPIO_TypeDef *) GPIO0_BASE)
887 #define GPIO1 (( GPIO_TypeDef *) GPIO1_BASE)
888 #define GPIO2 (( GPIO_TypeDef *) GPIO2_BASE)
889 #define GPIO3 (( GPIO_TypeDef *) GPIO3_BASE)
890 #define GPIO4 (( GPIO_TypeDef *) GPIO4_BASE)
891 #define WDT (( WDT_TypeDef *) WDT_BASE)
892 #define TIM0 (( TIM_TypeDef *) TIM0_BASE)
893 #define TIM1 (( TIM_TypeDef *) TIM1_BASE)
894 #define TIM2 (( TIM_TypeDef *) TIM2_BASE)
895 #define TIM3 (( TIM_TypeDef *) TIM3_BASE)
896 #define RIT (( RIT_TypeDef *) RIT_BASE)
897 #define UART0 (( UART_TypeDef *) UART0_BASE)
898 #define UART1 (( UART1_TypeDef *) UART1_BASE)
899 #define UART2 (( UART_TypeDef *) UART2_BASE)
900 #define UART3 (( UART_TypeDef *) UART3_BASE)
901 #define PWM1 (( PWM_TypeDef *) PWM1_BASE)
902 #define I2C0 (( I2C_TypeDef *) I2C0_BASE)
903 #define I2C1 (( I2C_TypeDef *) I2C1_BASE)
904 #define I2C2 (( I2C_TypeDef *) I2C2_BASE)
905 #define I2S (( I2S_TypeDef *) I2S_BASE)
906 #define SPI (( SPI_TypeDef *) SPI_BASE)
907 #define RTC (( RTC_TypeDef *) RTC_BASE)
908 #define GPIOINT (( GPIOINT_TypeDef *) GPIOINT_BASE)
909 #define PINCON (( PINCON_TypeDef *) PINCON_BASE)
910 #define SSP0 (( SSP_TypeDef *) SSP0_BASE)
911 #define SSP1 (( SSP_TypeDef *) SSP1_BASE)
912 #define ADC (( ADC_TypeDef *) ADC_BASE)
913 #define DAC (( DAC_TypeDef *) DAC_BASE)
914 #define CANAF_RAM ((CANAF_RAM_TypeDef *) CANAF_RAM_BASE)
915 #define CANAF (( CANAF_TypeDef *) CANAF_BASE)
916 #define CANCR (( CANCR_TypeDef *) CANCR_BASE)
917 #define CAN1 (( CAN_TypeDef *) CAN1_BASE)
918 #define CAN2 (( CAN_TypeDef *) CAN2_BASE)
919 #define MCPWM (( MCPWM_TypeDef *) MCPWM_BASE)
920 #define QEI (( QEI_TypeDef *) QEI_BASE)
921 #define EMAC (( EMAC_TypeDef *) EMAC_BASE)
922 #define GPDMA (( GPDMA_TypeDef *) GPDMA_BASE)
923 #define GPDMACH0 (( GPDMACH_TypeDef *) GPDMACH0_BASE)
924 #define GPDMACH1 (( GPDMACH_TypeDef *) GPDMACH1_BASE)
925 #define GPDMACH2 (( GPDMACH_TypeDef *) GPDMACH2_BASE)
926 #define GPDMACH3 (( GPDMACH_TypeDef *) GPDMACH3_BASE)
927 #define GPDMACH4 (( GPDMACH_TypeDef *) GPDMACH4_BASE)
928 #define GPDMACH5 (( GPDMACH_TypeDef *) GPDMACH5_BASE)
929 #define GPDMACH6 (( GPDMACH_TypeDef *) GPDMACH6_BASE)
930 #define GPDMACH7 (( GPDMACH_TypeDef *) GPDMACH7_BASE)
931 #define USB (( USB_TypeDef *) USB_BASE)
933 #endif // __LPC17xx_H__