Final version of the m3pi software

Dependencies:   mbed m3pi FreeRTOS_V8_2_1_LPC1768

Committer:
JoaoJardim
Date:
Fri Dec 21 18:34:21 2018 +0000
Revision:
8:167680431cf4
Parent:
6:00f820418d01
Final version of the software for the m3pi

Who changed what in which revision?

UserRevisionLine numberNew contents of line
JoaoJardim 6:00f820418d01 1 /******************************************************************************
JoaoJardim 6:00f820418d01 2 * @file: LPC17xx.h
JoaoJardim 6:00f820418d01 3 * @purpose: CMSIS Cortex-M3 Core Peripheral Access Layer Header File for
JoaoJardim 6:00f820418d01 4 * NXP LPC17xx Device Series
JoaoJardim 6:00f820418d01 5 * @version: V1.09
JoaoJardim 6:00f820418d01 6 * @date: 17. March 2010
JoaoJardim 6:00f820418d01 7 *----------------------------------------------------------------------------
JoaoJardim 6:00f820418d01 8 *
JoaoJardim 6:00f820418d01 9 * Copyright (C) 2008 ARM Limited. All rights reserved.
JoaoJardim 6:00f820418d01 10 *
JoaoJardim 6:00f820418d01 11 * ARM Limited (ARM) is supplying this software for use with Cortex-M3
JoaoJardim 6:00f820418d01 12 * processor based microcontrollers. This file can be freely distributed
JoaoJardim 6:00f820418d01 13 * within development tools that are supporting such ARM based processors.
JoaoJardim 6:00f820418d01 14 *
JoaoJardim 6:00f820418d01 15 * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
JoaoJardim 6:00f820418d01 16 * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
JoaoJardim 6:00f820418d01 17 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
JoaoJardim 6:00f820418d01 18 * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
JoaoJardim 6:00f820418d01 19 * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
JoaoJardim 6:00f820418d01 20 *
JoaoJardim 6:00f820418d01 21 ******************************************************************************/
JoaoJardim 6:00f820418d01 22
JoaoJardim 6:00f820418d01 23
JoaoJardim 6:00f820418d01 24 #ifndef __LPC17xx_H__
JoaoJardim 6:00f820418d01 25 #define __LPC17xx_H__
JoaoJardim 6:00f820418d01 26
JoaoJardim 6:00f820418d01 27 /*
JoaoJardim 6:00f820418d01 28 * ==========================================================================
JoaoJardim 6:00f820418d01 29 * ---------- Interrupt Number Definition -----------------------------------
JoaoJardim 6:00f820418d01 30 * ==========================================================================
JoaoJardim 6:00f820418d01 31 */
JoaoJardim 6:00f820418d01 32
JoaoJardim 6:00f820418d01 33 typedef enum IRQn
JoaoJardim 6:00f820418d01 34 {
JoaoJardim 6:00f820418d01 35 /****** Cortex-M3 Processor Exceptions Numbers ***************************************************/
JoaoJardim 6:00f820418d01 36 NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
JoaoJardim 6:00f820418d01 37 MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
JoaoJardim 6:00f820418d01 38 BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
JoaoJardim 6:00f820418d01 39 UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
JoaoJardim 6:00f820418d01 40 SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
JoaoJardim 6:00f820418d01 41 DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
JoaoJardim 6:00f820418d01 42 PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
JoaoJardim 6:00f820418d01 43 SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
JoaoJardim 6:00f820418d01 44
JoaoJardim 6:00f820418d01 45 /****** LPC17xx Specific Interrupt Numbers *******************************************************/
JoaoJardim 6:00f820418d01 46 WDT_IRQn = 0, /*!< Watchdog Timer Interrupt */
JoaoJardim 6:00f820418d01 47 TIMER0_IRQn = 1, /*!< Timer0 Interrupt */
JoaoJardim 6:00f820418d01 48 TIMER1_IRQn = 2, /*!< Timer1 Interrupt */
JoaoJardim 6:00f820418d01 49 TIMER2_IRQn = 3, /*!< Timer2 Interrupt */
JoaoJardim 6:00f820418d01 50 TIMER3_IRQn = 4, /*!< Timer3 Interrupt */
JoaoJardim 6:00f820418d01 51 UART0_IRQn = 5, /*!< UART0 Interrupt */
JoaoJardim 6:00f820418d01 52 UART1_IRQn = 6, /*!< UART1 Interrupt */
JoaoJardim 6:00f820418d01 53 UART2_IRQn = 7, /*!< UART2 Interrupt */
JoaoJardim 6:00f820418d01 54 UART3_IRQn = 8, /*!< UART3 Interrupt */
JoaoJardim 6:00f820418d01 55 PWM1_IRQn = 9, /*!< PWM1 Interrupt */
JoaoJardim 6:00f820418d01 56 I2C0_IRQn = 10, /*!< I2C0 Interrupt */
JoaoJardim 6:00f820418d01 57 I2C1_IRQn = 11, /*!< I2C1 Interrupt */
JoaoJardim 6:00f820418d01 58 I2C2_IRQn = 12, /*!< I2C2 Interrupt */
JoaoJardim 6:00f820418d01 59 SPI_IRQn = 13, /*!< SPI Interrupt */
JoaoJardim 6:00f820418d01 60 SSP0_IRQn = 14, /*!< SSP0 Interrupt */
JoaoJardim 6:00f820418d01 61 SSP1_IRQn = 15, /*!< SSP1 Interrupt */
JoaoJardim 6:00f820418d01 62 PLL0_IRQn = 16, /*!< PLL0 Lock (Main PLL) Interrupt */
JoaoJardim 6:00f820418d01 63 RTC_IRQn = 17, /*!< Real Time Clock Interrupt */
JoaoJardim 6:00f820418d01 64 EINT0_IRQn = 18, /*!< External Interrupt 0 Interrupt */
JoaoJardim 6:00f820418d01 65 EINT1_IRQn = 19, /*!< External Interrupt 1 Interrupt */
JoaoJardim 6:00f820418d01 66 EINT2_IRQn = 20, /*!< External Interrupt 2 Interrupt */
JoaoJardim 6:00f820418d01 67 EINT3_IRQn = 21, /*!< External Interrupt 3 Interrupt */
JoaoJardim 6:00f820418d01 68 ADC_IRQn = 22, /*!< A/D Converter Interrupt */
JoaoJardim 6:00f820418d01 69 BOD_IRQn = 23, /*!< Brown-Out Detect Interrupt */
JoaoJardim 6:00f820418d01 70 USB_IRQn = 24, /*!< USB Interrupt */
JoaoJardim 6:00f820418d01 71 CAN_IRQn = 25, /*!< CAN Interrupt */
JoaoJardim 6:00f820418d01 72 DMA_IRQn = 26, /*!< General Purpose DMA Interrupt */
JoaoJardim 6:00f820418d01 73 I2S_IRQn = 27, /*!< I2S Interrupt */
JoaoJardim 6:00f820418d01 74 ENET_IRQn = 28, /*!< Ethernet Interrupt */
JoaoJardim 6:00f820418d01 75 RIT_IRQn = 29, /*!< Repetitive Interrupt Timer Interrupt */
JoaoJardim 6:00f820418d01 76 MCPWM_IRQn = 30, /*!< Motor Control PWM Interrupt */
JoaoJardim 6:00f820418d01 77 QEI_IRQn = 31, /*!< Quadrature Encoder Interface Interrupt */
JoaoJardim 6:00f820418d01 78 PLL1_IRQn = 32, /*!< PLL1 Lock (USB PLL) Interrupt */
JoaoJardim 6:00f820418d01 79 USBActivity_IRQn = 33, /* USB Activity interrupt */
JoaoJardim 6:00f820418d01 80 CANActivity_IRQn = 34, /* CAN Activity interrupt */
JoaoJardim 6:00f820418d01 81 } IRQn_Type;
JoaoJardim 6:00f820418d01 82
JoaoJardim 6:00f820418d01 83
JoaoJardim 6:00f820418d01 84 /*
JoaoJardim 6:00f820418d01 85 * ==========================================================================
JoaoJardim 6:00f820418d01 86 * ----------- Processor and Core Peripheral Section ------------------------
JoaoJardim 6:00f820418d01 87 * ==========================================================================
JoaoJardim 6:00f820418d01 88 */
JoaoJardim 6:00f820418d01 89
JoaoJardim 6:00f820418d01 90 /* Configuration of the Cortex-M3 Processor and Core Peripherals */
JoaoJardim 6:00f820418d01 91 #define __MPU_PRESENT 1 /*!< MPU present or not */
JoaoJardim 6:00f820418d01 92 #define __NVIC_PRIO_BITS 5 /*!< Number of Bits used for Priority Levels */
JoaoJardim 6:00f820418d01 93 #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
JoaoJardim 6:00f820418d01 94
JoaoJardim 6:00f820418d01 95
JoaoJardim 6:00f820418d01 96 #include <core_cm3.h> /* Cortex-M3 processor and core peripherals */
JoaoJardim 6:00f820418d01 97 #include "system_LPC17xx.h" /* System Header */
JoaoJardim 6:00f820418d01 98
JoaoJardim 6:00f820418d01 99
JoaoJardim 6:00f820418d01 100 /******************************************************************************/
JoaoJardim 6:00f820418d01 101 /* Device Specific Peripheral registers structures */
JoaoJardim 6:00f820418d01 102 /******************************************************************************/
JoaoJardim 6:00f820418d01 103
JoaoJardim 6:00f820418d01 104 #if defined ( __CC_ARM )
JoaoJardim 6:00f820418d01 105 #pragma anon_unions
JoaoJardim 6:00f820418d01 106 #endif
JoaoJardim 6:00f820418d01 107
JoaoJardim 6:00f820418d01 108 /*------------- System Control (SC) ------------------------------------------*/
JoaoJardim 6:00f820418d01 109 typedef struct
JoaoJardim 6:00f820418d01 110 {
JoaoJardim 6:00f820418d01 111 __IO uint32_t FLASHCFG; /* Flash Accelerator Module */
JoaoJardim 6:00f820418d01 112 uint32_t RESERVED0[31];
JoaoJardim 6:00f820418d01 113 __IO uint32_t PLL0CON; /* Clocking and Power Control */
JoaoJardim 6:00f820418d01 114 __IO uint32_t PLL0CFG;
JoaoJardim 6:00f820418d01 115 __I uint32_t PLL0STAT;
JoaoJardim 6:00f820418d01 116 __O uint32_t PLL0FEED;
JoaoJardim 6:00f820418d01 117 uint32_t RESERVED1[4];
JoaoJardim 6:00f820418d01 118 __IO uint32_t PLL1CON;
JoaoJardim 6:00f820418d01 119 __IO uint32_t PLL1CFG;
JoaoJardim 6:00f820418d01 120 __I uint32_t PLL1STAT;
JoaoJardim 6:00f820418d01 121 __O uint32_t PLL1FEED;
JoaoJardim 6:00f820418d01 122 uint32_t RESERVED2[4];
JoaoJardim 6:00f820418d01 123 __IO uint32_t PCON;
JoaoJardim 6:00f820418d01 124 __IO uint32_t PCONP;
JoaoJardim 6:00f820418d01 125 uint32_t RESERVED3[15];
JoaoJardim 6:00f820418d01 126 __IO uint32_t CCLKCFG;
JoaoJardim 6:00f820418d01 127 __IO uint32_t USBCLKCFG;
JoaoJardim 6:00f820418d01 128 __IO uint32_t CLKSRCSEL;
JoaoJardim 6:00f820418d01 129 __IO uint32_t CANSLEEPCLR;
JoaoJardim 6:00f820418d01 130 __IO uint32_t CANWAKEFLAGS;
JoaoJardim 6:00f820418d01 131 uint32_t RESERVED4[10];
JoaoJardim 6:00f820418d01 132 __IO uint32_t EXTINT; /* External Interrupts */
JoaoJardim 6:00f820418d01 133 uint32_t RESERVED5;
JoaoJardim 6:00f820418d01 134 __IO uint32_t EXTMODE;
JoaoJardim 6:00f820418d01 135 __IO uint32_t EXTPOLAR;
JoaoJardim 6:00f820418d01 136 uint32_t RESERVED6[12];
JoaoJardim 6:00f820418d01 137 __IO uint32_t RSID; /* Reset */
JoaoJardim 6:00f820418d01 138 uint32_t RESERVED7[7];
JoaoJardim 6:00f820418d01 139 __IO uint32_t SCS; /* Syscon Miscellaneous Registers */
JoaoJardim 6:00f820418d01 140 __IO uint32_t IRCTRIM; /* Clock Dividers */
JoaoJardim 6:00f820418d01 141 __IO uint32_t PCLKSEL0;
JoaoJardim 6:00f820418d01 142 __IO uint32_t PCLKSEL1;
JoaoJardim 6:00f820418d01 143 uint32_t RESERVED8[4];
JoaoJardim 6:00f820418d01 144 __IO uint32_t USBIntSt; /* USB Device/OTG Interrupt Register */
JoaoJardim 6:00f820418d01 145 __IO uint32_t DMAREQSEL;
JoaoJardim 6:00f820418d01 146 __IO uint32_t CLKOUTCFG; /* Clock Output Configuration */
JoaoJardim 6:00f820418d01 147 } LPC_SC_TypeDef;
JoaoJardim 6:00f820418d01 148
JoaoJardim 6:00f820418d01 149 /*------------- Pin Connect Block (PINCON) -----------------------------------*/
JoaoJardim 6:00f820418d01 150 typedef struct
JoaoJardim 6:00f820418d01 151 {
JoaoJardim 6:00f820418d01 152 __IO uint32_t PINSEL0;
JoaoJardim 6:00f820418d01 153 __IO uint32_t PINSEL1;
JoaoJardim 6:00f820418d01 154 __IO uint32_t PINSEL2;
JoaoJardim 6:00f820418d01 155 __IO uint32_t PINSEL3;
JoaoJardim 6:00f820418d01 156 __IO uint32_t PINSEL4;
JoaoJardim 6:00f820418d01 157 __IO uint32_t PINSEL5;
JoaoJardim 6:00f820418d01 158 __IO uint32_t PINSEL6;
JoaoJardim 6:00f820418d01 159 __IO uint32_t PINSEL7;
JoaoJardim 6:00f820418d01 160 __IO uint32_t PINSEL8;
JoaoJardim 6:00f820418d01 161 __IO uint32_t PINSEL9;
JoaoJardim 6:00f820418d01 162 __IO uint32_t PINSEL10;
JoaoJardim 6:00f820418d01 163 uint32_t RESERVED0[5];
JoaoJardim 6:00f820418d01 164 __IO uint32_t PINMODE0;
JoaoJardim 6:00f820418d01 165 __IO uint32_t PINMODE1;
JoaoJardim 6:00f820418d01 166 __IO uint32_t PINMODE2;
JoaoJardim 6:00f820418d01 167 __IO uint32_t PINMODE3;
JoaoJardim 6:00f820418d01 168 __IO uint32_t PINMODE4;
JoaoJardim 6:00f820418d01 169 __IO uint32_t PINMODE5;
JoaoJardim 6:00f820418d01 170 __IO uint32_t PINMODE6;
JoaoJardim 6:00f820418d01 171 __IO uint32_t PINMODE7;
JoaoJardim 6:00f820418d01 172 __IO uint32_t PINMODE8;
JoaoJardim 6:00f820418d01 173 __IO uint32_t PINMODE9;
JoaoJardim 6:00f820418d01 174 __IO uint32_t PINMODE_OD0;
JoaoJardim 6:00f820418d01 175 __IO uint32_t PINMODE_OD1;
JoaoJardim 6:00f820418d01 176 __IO uint32_t PINMODE_OD2;
JoaoJardim 6:00f820418d01 177 __IO uint32_t PINMODE_OD3;
JoaoJardim 6:00f820418d01 178 __IO uint32_t PINMODE_OD4;
JoaoJardim 6:00f820418d01 179 __IO uint32_t I2CPADCFG;
JoaoJardim 6:00f820418d01 180 } LPC_PINCON_TypeDef;
JoaoJardim 6:00f820418d01 181
JoaoJardim 6:00f820418d01 182 /*------------- General Purpose Input/Output (GPIO) --------------------------*/
JoaoJardim 6:00f820418d01 183 typedef struct
JoaoJardim 6:00f820418d01 184 {
JoaoJardim 6:00f820418d01 185 union {
JoaoJardim 6:00f820418d01 186 __IO uint32_t FIODIR;
JoaoJardim 6:00f820418d01 187 struct {
JoaoJardim 6:00f820418d01 188 __IO uint16_t FIODIRL;
JoaoJardim 6:00f820418d01 189 __IO uint16_t FIODIRH;
JoaoJardim 6:00f820418d01 190 };
JoaoJardim 6:00f820418d01 191 struct {
JoaoJardim 6:00f820418d01 192 __IO uint8_t FIODIR0;
JoaoJardim 6:00f820418d01 193 __IO uint8_t FIODIR1;
JoaoJardim 6:00f820418d01 194 __IO uint8_t FIODIR2;
JoaoJardim 6:00f820418d01 195 __IO uint8_t FIODIR3;
JoaoJardim 6:00f820418d01 196 };
JoaoJardim 6:00f820418d01 197 };
JoaoJardim 6:00f820418d01 198 uint32_t RESERVED0[3];
JoaoJardim 6:00f820418d01 199 union {
JoaoJardim 6:00f820418d01 200 __IO uint32_t FIOMASK;
JoaoJardim 6:00f820418d01 201 struct {
JoaoJardim 6:00f820418d01 202 __IO uint16_t FIOMASKL;
JoaoJardim 6:00f820418d01 203 __IO uint16_t FIOMASKH;
JoaoJardim 6:00f820418d01 204 };
JoaoJardim 6:00f820418d01 205 struct {
JoaoJardim 6:00f820418d01 206 __IO uint8_t FIOMASK0;
JoaoJardim 6:00f820418d01 207 __IO uint8_t FIOMASK1;
JoaoJardim 6:00f820418d01 208 __IO uint8_t FIOMASK2;
JoaoJardim 6:00f820418d01 209 __IO uint8_t FIOMASK3;
JoaoJardim 6:00f820418d01 210 };
JoaoJardim 6:00f820418d01 211 };
JoaoJardim 6:00f820418d01 212 union {
JoaoJardim 6:00f820418d01 213 __IO uint32_t FIOPIN;
JoaoJardim 6:00f820418d01 214 struct {
JoaoJardim 6:00f820418d01 215 __IO uint16_t FIOPINL;
JoaoJardim 6:00f820418d01 216 __IO uint16_t FIOPINH;
JoaoJardim 6:00f820418d01 217 };
JoaoJardim 6:00f820418d01 218 struct {
JoaoJardim 6:00f820418d01 219 __IO uint8_t FIOPIN0;
JoaoJardim 6:00f820418d01 220 __IO uint8_t FIOPIN1;
JoaoJardim 6:00f820418d01 221 __IO uint8_t FIOPIN2;
JoaoJardim 6:00f820418d01 222 __IO uint8_t FIOPIN3;
JoaoJardim 6:00f820418d01 223 };
JoaoJardim 6:00f820418d01 224 };
JoaoJardim 6:00f820418d01 225 union {
JoaoJardim 6:00f820418d01 226 __IO uint32_t FIOSET;
JoaoJardim 6:00f820418d01 227 struct {
JoaoJardim 6:00f820418d01 228 __IO uint16_t FIOSETL;
JoaoJardim 6:00f820418d01 229 __IO uint16_t FIOSETH;
JoaoJardim 6:00f820418d01 230 };
JoaoJardim 6:00f820418d01 231 struct {
JoaoJardim 6:00f820418d01 232 __IO uint8_t FIOSET0;
JoaoJardim 6:00f820418d01 233 __IO uint8_t FIOSET1;
JoaoJardim 6:00f820418d01 234 __IO uint8_t FIOSET2;
JoaoJardim 6:00f820418d01 235 __IO uint8_t FIOSET3;
JoaoJardim 6:00f820418d01 236 };
JoaoJardim 6:00f820418d01 237 };
JoaoJardim 6:00f820418d01 238 union {
JoaoJardim 6:00f820418d01 239 __O uint32_t FIOCLR;
JoaoJardim 6:00f820418d01 240 struct {
JoaoJardim 6:00f820418d01 241 __O uint16_t FIOCLRL;
JoaoJardim 6:00f820418d01 242 __O uint16_t FIOCLRH;
JoaoJardim 6:00f820418d01 243 };
JoaoJardim 6:00f820418d01 244 struct {
JoaoJardim 6:00f820418d01 245 __O uint8_t FIOCLR0;
JoaoJardim 6:00f820418d01 246 __O uint8_t FIOCLR1;
JoaoJardim 6:00f820418d01 247 __O uint8_t FIOCLR2;
JoaoJardim 6:00f820418d01 248 __O uint8_t FIOCLR3;
JoaoJardim 6:00f820418d01 249 };
JoaoJardim 6:00f820418d01 250 };
JoaoJardim 6:00f820418d01 251 } LPC_GPIO_TypeDef;
JoaoJardim 6:00f820418d01 252
JoaoJardim 6:00f820418d01 253 typedef struct
JoaoJardim 6:00f820418d01 254 {
JoaoJardim 6:00f820418d01 255 __I uint32_t IntStatus;
JoaoJardim 6:00f820418d01 256 __I uint32_t IO0IntStatR;
JoaoJardim 6:00f820418d01 257 __I uint32_t IO0IntStatF;
JoaoJardim 6:00f820418d01 258 __O uint32_t IO0IntClr;
JoaoJardim 6:00f820418d01 259 __IO uint32_t IO0IntEnR;
JoaoJardim 6:00f820418d01 260 __IO uint32_t IO0IntEnF;
JoaoJardim 6:00f820418d01 261 uint32_t RESERVED0[3];
JoaoJardim 6:00f820418d01 262 __I uint32_t IO2IntStatR;
JoaoJardim 6:00f820418d01 263 __I uint32_t IO2IntStatF;
JoaoJardim 6:00f820418d01 264 __O uint32_t IO2IntClr;
JoaoJardim 6:00f820418d01 265 __IO uint32_t IO2IntEnR;
JoaoJardim 6:00f820418d01 266 __IO uint32_t IO2IntEnF;
JoaoJardim 6:00f820418d01 267 } LPC_GPIOINT_TypeDef;
JoaoJardim 6:00f820418d01 268
JoaoJardim 6:00f820418d01 269 /*------------- Timer (TIM) --------------------------------------------------*/
JoaoJardim 6:00f820418d01 270 typedef struct
JoaoJardim 6:00f820418d01 271 {
JoaoJardim 6:00f820418d01 272 __IO uint32_t IR;
JoaoJardim 6:00f820418d01 273 __IO uint32_t TCR;
JoaoJardim 6:00f820418d01 274 __IO uint32_t TC;
JoaoJardim 6:00f820418d01 275 __IO uint32_t PR;
JoaoJardim 6:00f820418d01 276 __IO uint32_t PC;
JoaoJardim 6:00f820418d01 277 __IO uint32_t MCR;
JoaoJardim 6:00f820418d01 278 __IO uint32_t MR0;
JoaoJardim 6:00f820418d01 279 __IO uint32_t MR1;
JoaoJardim 6:00f820418d01 280 __IO uint32_t MR2;
JoaoJardim 6:00f820418d01 281 __IO uint32_t MR3;
JoaoJardim 6:00f820418d01 282 __IO uint32_t CCR;
JoaoJardim 6:00f820418d01 283 __I uint32_t CR0;
JoaoJardim 6:00f820418d01 284 __I uint32_t CR1;
JoaoJardim 6:00f820418d01 285 uint32_t RESERVED0[2];
JoaoJardim 6:00f820418d01 286 __IO uint32_t EMR;
JoaoJardim 6:00f820418d01 287 uint32_t RESERVED1[12];
JoaoJardim 6:00f820418d01 288 __IO uint32_t CTCR;
JoaoJardim 6:00f820418d01 289 } LPC_TIM_TypeDef;
JoaoJardim 6:00f820418d01 290
JoaoJardim 6:00f820418d01 291 /*------------- Pulse-Width Modulation (PWM) ---------------------------------*/
JoaoJardim 6:00f820418d01 292 typedef struct
JoaoJardim 6:00f820418d01 293 {
JoaoJardim 6:00f820418d01 294 __IO uint32_t IR;
JoaoJardim 6:00f820418d01 295 __IO uint32_t TCR;
JoaoJardim 6:00f820418d01 296 __IO uint32_t TC;
JoaoJardim 6:00f820418d01 297 __IO uint32_t PR;
JoaoJardim 6:00f820418d01 298 __IO uint32_t PC;
JoaoJardim 6:00f820418d01 299 __IO uint32_t MCR;
JoaoJardim 6:00f820418d01 300 __IO uint32_t MR0;
JoaoJardim 6:00f820418d01 301 __IO uint32_t MR1;
JoaoJardim 6:00f820418d01 302 __IO uint32_t MR2;
JoaoJardim 6:00f820418d01 303 __IO uint32_t MR3;
JoaoJardim 6:00f820418d01 304 __IO uint32_t CCR;
JoaoJardim 6:00f820418d01 305 __I uint32_t CR0;
JoaoJardim 6:00f820418d01 306 __I uint32_t CR1;
JoaoJardim 6:00f820418d01 307 __I uint32_t CR2;
JoaoJardim 6:00f820418d01 308 __I uint32_t CR3;
JoaoJardim 6:00f820418d01 309 uint32_t RESERVED0;
JoaoJardim 6:00f820418d01 310 __IO uint32_t MR4;
JoaoJardim 6:00f820418d01 311 __IO uint32_t MR5;
JoaoJardim 6:00f820418d01 312 __IO uint32_t MR6;
JoaoJardim 6:00f820418d01 313 __IO uint32_t PCR;
JoaoJardim 6:00f820418d01 314 __IO uint32_t LER;
JoaoJardim 6:00f820418d01 315 uint32_t RESERVED1[7];
JoaoJardim 6:00f820418d01 316 __IO uint32_t CTCR;
JoaoJardim 6:00f820418d01 317 } LPC_PWM_TypeDef;
JoaoJardim 6:00f820418d01 318
JoaoJardim 6:00f820418d01 319 /*------------- Universal Asynchronous Receiver Transmitter (UART) -----------*/
JoaoJardim 6:00f820418d01 320 typedef struct
JoaoJardim 6:00f820418d01 321 {
JoaoJardim 6:00f820418d01 322 union {
JoaoJardim 6:00f820418d01 323 __I uint8_t RBR;
JoaoJardim 6:00f820418d01 324 __O uint8_t THR;
JoaoJardim 6:00f820418d01 325 __IO uint8_t DLL;
JoaoJardim 6:00f820418d01 326 uint32_t RESERVED0;
JoaoJardim 6:00f820418d01 327 };
JoaoJardim 6:00f820418d01 328 union {
JoaoJardim 6:00f820418d01 329 __IO uint8_t DLM;
JoaoJardim 6:00f820418d01 330 __IO uint32_t IER;
JoaoJardim 6:00f820418d01 331 };
JoaoJardim 6:00f820418d01 332 union {
JoaoJardim 6:00f820418d01 333 __I uint32_t IIR;
JoaoJardim 6:00f820418d01 334 __O uint8_t FCR;
JoaoJardim 6:00f820418d01 335 };
JoaoJardim 6:00f820418d01 336 __IO uint8_t LCR;
JoaoJardim 6:00f820418d01 337 uint8_t RESERVED1[7];
JoaoJardim 6:00f820418d01 338 __I uint8_t LSR;
JoaoJardim 6:00f820418d01 339 uint8_t RESERVED2[7];
JoaoJardim 6:00f820418d01 340 __IO uint8_t SCR;
JoaoJardim 6:00f820418d01 341 uint8_t RESERVED3[3];
JoaoJardim 6:00f820418d01 342 __IO uint32_t ACR;
JoaoJardim 6:00f820418d01 343 __IO uint8_t ICR;
JoaoJardim 6:00f820418d01 344 uint8_t RESERVED4[3];
JoaoJardim 6:00f820418d01 345 __IO uint8_t FDR;
JoaoJardim 6:00f820418d01 346 uint8_t RESERVED5[7];
JoaoJardim 6:00f820418d01 347 __IO uint8_t TER;
JoaoJardim 6:00f820418d01 348 uint8_t RESERVED6[39];
JoaoJardim 6:00f820418d01 349 __IO uint32_t FIFOLVL;
JoaoJardim 6:00f820418d01 350 } LPC_UART_TypeDef;
JoaoJardim 6:00f820418d01 351
JoaoJardim 6:00f820418d01 352 typedef struct
JoaoJardim 6:00f820418d01 353 {
JoaoJardim 6:00f820418d01 354 union {
JoaoJardim 6:00f820418d01 355 __I uint8_t RBR;
JoaoJardim 6:00f820418d01 356 __O uint8_t THR;
JoaoJardim 6:00f820418d01 357 __IO uint8_t DLL;
JoaoJardim 6:00f820418d01 358 uint32_t RESERVED0;
JoaoJardim 6:00f820418d01 359 };
JoaoJardim 6:00f820418d01 360 union {
JoaoJardim 6:00f820418d01 361 __IO uint8_t DLM;
JoaoJardim 6:00f820418d01 362 __IO uint32_t IER;
JoaoJardim 6:00f820418d01 363 };
JoaoJardim 6:00f820418d01 364 union {
JoaoJardim 6:00f820418d01 365 __I uint32_t IIR;
JoaoJardim 6:00f820418d01 366 __O uint8_t FCR;
JoaoJardim 6:00f820418d01 367 };
JoaoJardim 6:00f820418d01 368 __IO uint8_t LCR;
JoaoJardim 6:00f820418d01 369 uint8_t RESERVED1[7];
JoaoJardim 6:00f820418d01 370 __I uint8_t LSR;
JoaoJardim 6:00f820418d01 371 uint8_t RESERVED2[7];
JoaoJardim 6:00f820418d01 372 __IO uint8_t SCR;
JoaoJardim 6:00f820418d01 373 uint8_t RESERVED3[3];
JoaoJardim 6:00f820418d01 374 __IO uint32_t ACR;
JoaoJardim 6:00f820418d01 375 __IO uint8_t ICR;
JoaoJardim 6:00f820418d01 376 uint8_t RESERVED4[3];
JoaoJardim 6:00f820418d01 377 __IO uint8_t FDR;
JoaoJardim 6:00f820418d01 378 uint8_t RESERVED5[7];
JoaoJardim 6:00f820418d01 379 __IO uint8_t TER;
JoaoJardim 6:00f820418d01 380 uint8_t RESERVED6[39];
JoaoJardim 6:00f820418d01 381 __IO uint32_t FIFOLVL;
JoaoJardim 6:00f820418d01 382 } LPC_UART0_TypeDef;
JoaoJardim 6:00f820418d01 383
JoaoJardim 6:00f820418d01 384 typedef struct
JoaoJardim 6:00f820418d01 385 {
JoaoJardim 6:00f820418d01 386 union {
JoaoJardim 6:00f820418d01 387 __I uint8_t RBR;
JoaoJardim 6:00f820418d01 388 __O uint8_t THR;
JoaoJardim 6:00f820418d01 389 __IO uint8_t DLL;
JoaoJardim 6:00f820418d01 390 uint32_t RESERVED0;
JoaoJardim 6:00f820418d01 391 };
JoaoJardim 6:00f820418d01 392 union {
JoaoJardim 6:00f820418d01 393 __IO uint8_t DLM;
JoaoJardim 6:00f820418d01 394 __IO uint32_t IER;
JoaoJardim 6:00f820418d01 395 };
JoaoJardim 6:00f820418d01 396 union {
JoaoJardim 6:00f820418d01 397 __I uint32_t IIR;
JoaoJardim 6:00f820418d01 398 __O uint8_t FCR;
JoaoJardim 6:00f820418d01 399 };
JoaoJardim 6:00f820418d01 400 __IO uint8_t LCR;
JoaoJardim 6:00f820418d01 401 uint8_t RESERVED1[3];
JoaoJardim 6:00f820418d01 402 __IO uint8_t MCR;
JoaoJardim 6:00f820418d01 403 uint8_t RESERVED2[3];
JoaoJardim 6:00f820418d01 404 __I uint8_t LSR;
JoaoJardim 6:00f820418d01 405 uint8_t RESERVED3[3];
JoaoJardim 6:00f820418d01 406 __I uint8_t MSR;
JoaoJardim 6:00f820418d01 407 uint8_t RESERVED4[3];
JoaoJardim 6:00f820418d01 408 __IO uint8_t SCR;
JoaoJardim 6:00f820418d01 409 uint8_t RESERVED5[3];
JoaoJardim 6:00f820418d01 410 __IO uint32_t ACR;
JoaoJardim 6:00f820418d01 411 uint32_t RESERVED6;
JoaoJardim 6:00f820418d01 412 __IO uint32_t FDR;
JoaoJardim 6:00f820418d01 413 uint32_t RESERVED7;
JoaoJardim 6:00f820418d01 414 __IO uint8_t TER;
JoaoJardim 6:00f820418d01 415 uint8_t RESERVED8[27];
JoaoJardim 6:00f820418d01 416 __IO uint8_t RS485CTRL;
JoaoJardim 6:00f820418d01 417 uint8_t RESERVED9[3];
JoaoJardim 6:00f820418d01 418 __IO uint8_t ADRMATCH;
JoaoJardim 6:00f820418d01 419 uint8_t RESERVED10[3];
JoaoJardim 6:00f820418d01 420 __IO uint8_t RS485DLY;
JoaoJardim 6:00f820418d01 421 uint8_t RESERVED11[3];
JoaoJardim 6:00f820418d01 422 __IO uint32_t FIFOLVL;
JoaoJardim 6:00f820418d01 423 } LPC_UART1_TypeDef;
JoaoJardim 6:00f820418d01 424
JoaoJardim 6:00f820418d01 425 /*------------- Serial Peripheral Interface (SPI) ----------------------------*/
JoaoJardim 6:00f820418d01 426 typedef struct
JoaoJardim 6:00f820418d01 427 {
JoaoJardim 6:00f820418d01 428 __IO uint32_t SPCR;
JoaoJardim 6:00f820418d01 429 __I uint32_t SPSR;
JoaoJardim 6:00f820418d01 430 __IO uint32_t SPDR;
JoaoJardim 6:00f820418d01 431 __IO uint32_t SPCCR;
JoaoJardim 6:00f820418d01 432 uint32_t RESERVED0[3];
JoaoJardim 6:00f820418d01 433 __IO uint32_t SPINT;
JoaoJardim 6:00f820418d01 434 } LPC_SPI_TypeDef;
JoaoJardim 6:00f820418d01 435
JoaoJardim 6:00f820418d01 436 /*------------- Synchronous Serial Communication (SSP) -----------------------*/
JoaoJardim 6:00f820418d01 437 typedef struct
JoaoJardim 6:00f820418d01 438 {
JoaoJardim 6:00f820418d01 439 __IO uint32_t CR0;
JoaoJardim 6:00f820418d01 440 __IO uint32_t CR1;
JoaoJardim 6:00f820418d01 441 __IO uint32_t DR;
JoaoJardim 6:00f820418d01 442 __I uint32_t SR;
JoaoJardim 6:00f820418d01 443 __IO uint32_t CPSR;
JoaoJardim 6:00f820418d01 444 __IO uint32_t IMSC;
JoaoJardim 6:00f820418d01 445 __IO uint32_t RIS;
JoaoJardim 6:00f820418d01 446 __IO uint32_t MIS;
JoaoJardim 6:00f820418d01 447 __IO uint32_t ICR;
JoaoJardim 6:00f820418d01 448 __IO uint32_t DMACR;
JoaoJardim 6:00f820418d01 449 } LPC_SSP_TypeDef;
JoaoJardim 6:00f820418d01 450
JoaoJardim 6:00f820418d01 451 /*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
JoaoJardim 6:00f820418d01 452 typedef struct
JoaoJardim 6:00f820418d01 453 {
JoaoJardim 6:00f820418d01 454 __IO uint32_t I2CONSET;
JoaoJardim 6:00f820418d01 455 __I uint32_t I2STAT;
JoaoJardim 6:00f820418d01 456 __IO uint32_t I2DAT;
JoaoJardim 6:00f820418d01 457 __IO uint32_t I2ADR0;
JoaoJardim 6:00f820418d01 458 __IO uint32_t I2SCLH;
JoaoJardim 6:00f820418d01 459 __IO uint32_t I2SCLL;
JoaoJardim 6:00f820418d01 460 __O uint32_t I2CONCLR;
JoaoJardim 6:00f820418d01 461 __IO uint32_t MMCTRL;
JoaoJardim 6:00f820418d01 462 __IO uint32_t I2ADR1;
JoaoJardim 6:00f820418d01 463 __IO uint32_t I2ADR2;
JoaoJardim 6:00f820418d01 464 __IO uint32_t I2ADR3;
JoaoJardim 6:00f820418d01 465 __I uint32_t I2DATA_BUFFER;
JoaoJardim 6:00f820418d01 466 __IO uint32_t I2MASK0;
JoaoJardim 6:00f820418d01 467 __IO uint32_t I2MASK1;
JoaoJardim 6:00f820418d01 468 __IO uint32_t I2MASK2;
JoaoJardim 6:00f820418d01 469 __IO uint32_t I2MASK3;
JoaoJardim 6:00f820418d01 470 } LPC_I2C_TypeDef;
JoaoJardim 6:00f820418d01 471
JoaoJardim 6:00f820418d01 472 /*------------- Inter IC Sound (I2S) -----------------------------------------*/
JoaoJardim 6:00f820418d01 473 typedef struct
JoaoJardim 6:00f820418d01 474 {
JoaoJardim 6:00f820418d01 475 __IO uint32_t I2SDAO;
JoaoJardim 6:00f820418d01 476 __IO uint32_t I2SDAI;
JoaoJardim 6:00f820418d01 477 __O uint32_t I2STXFIFO;
JoaoJardim 6:00f820418d01 478 __I uint32_t I2SRXFIFO;
JoaoJardim 6:00f820418d01 479 __I uint32_t I2SSTATE;
JoaoJardim 6:00f820418d01 480 __IO uint32_t I2SDMA1;
JoaoJardim 6:00f820418d01 481 __IO uint32_t I2SDMA2;
JoaoJardim 6:00f820418d01 482 __IO uint32_t I2SIRQ;
JoaoJardim 6:00f820418d01 483 __IO uint32_t I2STXRATE;
JoaoJardim 6:00f820418d01 484 __IO uint32_t I2SRXRATE;
JoaoJardim 6:00f820418d01 485 __IO uint32_t I2STXBITRATE;
JoaoJardim 6:00f820418d01 486 __IO uint32_t I2SRXBITRATE;
JoaoJardim 6:00f820418d01 487 __IO uint32_t I2STXMODE;
JoaoJardim 6:00f820418d01 488 __IO uint32_t I2SRXMODE;
JoaoJardim 6:00f820418d01 489 } LPC_I2S_TypeDef;
JoaoJardim 6:00f820418d01 490
JoaoJardim 6:00f820418d01 491 /*------------- Repetitive Interrupt Timer (RIT) -----------------------------*/
JoaoJardim 6:00f820418d01 492 typedef struct
JoaoJardim 6:00f820418d01 493 {
JoaoJardim 6:00f820418d01 494 __IO uint32_t RICOMPVAL;
JoaoJardim 6:00f820418d01 495 __IO uint32_t RIMASK;
JoaoJardim 6:00f820418d01 496 __IO uint8_t RICTRL;
JoaoJardim 6:00f820418d01 497 uint8_t RESERVED0[3];
JoaoJardim 6:00f820418d01 498 __IO uint32_t RICOUNTER;
JoaoJardim 6:00f820418d01 499 } LPC_RIT_TypeDef;
JoaoJardim 6:00f820418d01 500
JoaoJardim 6:00f820418d01 501 /*------------- Real-Time Clock (RTC) ----------------------------------------*/
JoaoJardim 6:00f820418d01 502 typedef struct
JoaoJardim 6:00f820418d01 503 {
JoaoJardim 6:00f820418d01 504 __IO uint8_t ILR;
JoaoJardim 6:00f820418d01 505 uint8_t RESERVED0[7];
JoaoJardim 6:00f820418d01 506 __IO uint8_t CCR;
JoaoJardim 6:00f820418d01 507 uint8_t RESERVED1[3];
JoaoJardim 6:00f820418d01 508 __IO uint8_t CIIR;
JoaoJardim 6:00f820418d01 509 uint8_t RESERVED2[3];
JoaoJardim 6:00f820418d01 510 __IO uint8_t AMR;
JoaoJardim 6:00f820418d01 511 uint8_t RESERVED3[3];
JoaoJardim 6:00f820418d01 512 __I uint32_t CTIME0;
JoaoJardim 6:00f820418d01 513 __I uint32_t CTIME1;
JoaoJardim 6:00f820418d01 514 __I uint32_t CTIME2;
JoaoJardim 6:00f820418d01 515 __IO uint8_t SEC;
JoaoJardim 6:00f820418d01 516 uint8_t RESERVED4[3];
JoaoJardim 6:00f820418d01 517 __IO uint8_t MIN;
JoaoJardim 6:00f820418d01 518 uint8_t RESERVED5[3];
JoaoJardim 6:00f820418d01 519 __IO uint8_t HOUR;
JoaoJardim 6:00f820418d01 520 uint8_t RESERVED6[3];
JoaoJardim 6:00f820418d01 521 __IO uint8_t DOM;
JoaoJardim 6:00f820418d01 522 uint8_t RESERVED7[3];
JoaoJardim 6:00f820418d01 523 __IO uint8_t DOW;
JoaoJardim 6:00f820418d01 524 uint8_t RESERVED8[3];
JoaoJardim 6:00f820418d01 525 __IO uint16_t DOY;
JoaoJardim 6:00f820418d01 526 uint16_t RESERVED9;
JoaoJardim 6:00f820418d01 527 __IO uint8_t MONTH;
JoaoJardim 6:00f820418d01 528 uint8_t RESERVED10[3];
JoaoJardim 6:00f820418d01 529 __IO uint16_t YEAR;
JoaoJardim 6:00f820418d01 530 uint16_t RESERVED11;
JoaoJardim 6:00f820418d01 531 __IO uint32_t CALIBRATION;
JoaoJardim 6:00f820418d01 532 __IO uint32_t GPREG0;
JoaoJardim 6:00f820418d01 533 __IO uint32_t GPREG1;
JoaoJardim 6:00f820418d01 534 __IO uint32_t GPREG2;
JoaoJardim 6:00f820418d01 535 __IO uint32_t GPREG3;
JoaoJardim 6:00f820418d01 536 __IO uint32_t GPREG4;
JoaoJardim 6:00f820418d01 537 __IO uint8_t RTC_AUXEN;
JoaoJardim 6:00f820418d01 538 uint8_t RESERVED12[3];
JoaoJardim 6:00f820418d01 539 __IO uint8_t RTC_AUX;
JoaoJardim 6:00f820418d01 540 uint8_t RESERVED13[3];
JoaoJardim 6:00f820418d01 541 __IO uint8_t ALSEC;
JoaoJardim 6:00f820418d01 542 uint8_t RESERVED14[3];
JoaoJardim 6:00f820418d01 543 __IO uint8_t ALMIN;
JoaoJardim 6:00f820418d01 544 uint8_t RESERVED15[3];
JoaoJardim 6:00f820418d01 545 __IO uint8_t ALHOUR;
JoaoJardim 6:00f820418d01 546 uint8_t RESERVED16[3];
JoaoJardim 6:00f820418d01 547 __IO uint8_t ALDOM;
JoaoJardim 6:00f820418d01 548 uint8_t RESERVED17[3];
JoaoJardim 6:00f820418d01 549 __IO uint8_t ALDOW;
JoaoJardim 6:00f820418d01 550 uint8_t RESERVED18[3];
JoaoJardim 6:00f820418d01 551 __IO uint16_t ALDOY;
JoaoJardim 6:00f820418d01 552 uint16_t RESERVED19;
JoaoJardim 6:00f820418d01 553 __IO uint8_t ALMON;
JoaoJardim 6:00f820418d01 554 uint8_t RESERVED20[3];
JoaoJardim 6:00f820418d01 555 __IO uint16_t ALYEAR;
JoaoJardim 6:00f820418d01 556 uint16_t RESERVED21;
JoaoJardim 6:00f820418d01 557 } LPC_RTC_TypeDef;
JoaoJardim 6:00f820418d01 558
JoaoJardim 6:00f820418d01 559 /*------------- Watchdog Timer (WDT) -----------------------------------------*/
JoaoJardim 6:00f820418d01 560 typedef struct
JoaoJardim 6:00f820418d01 561 {
JoaoJardim 6:00f820418d01 562 __IO uint8_t WDMOD;
JoaoJardim 6:00f820418d01 563 uint8_t RESERVED0[3];
JoaoJardim 6:00f820418d01 564 __IO uint32_t WDTC;
JoaoJardim 6:00f820418d01 565 __O uint8_t WDFEED;
JoaoJardim 6:00f820418d01 566 uint8_t RESERVED1[3];
JoaoJardim 6:00f820418d01 567 __I uint32_t WDTV;
JoaoJardim 6:00f820418d01 568 __IO uint32_t WDCLKSEL;
JoaoJardim 6:00f820418d01 569 } LPC_WDT_TypeDef;
JoaoJardim 6:00f820418d01 570
JoaoJardim 6:00f820418d01 571 /*------------- Analog-to-Digital Converter (ADC) ----------------------------*/
JoaoJardim 6:00f820418d01 572 typedef struct
JoaoJardim 6:00f820418d01 573 {
JoaoJardim 6:00f820418d01 574 __IO uint32_t ADCR;
JoaoJardim 6:00f820418d01 575 __IO uint32_t ADGDR;
JoaoJardim 6:00f820418d01 576 uint32_t RESERVED0;
JoaoJardim 6:00f820418d01 577 __IO uint32_t ADINTEN;
JoaoJardim 6:00f820418d01 578 __I uint32_t ADDR0;
JoaoJardim 6:00f820418d01 579 __I uint32_t ADDR1;
JoaoJardim 6:00f820418d01 580 __I uint32_t ADDR2;
JoaoJardim 6:00f820418d01 581 __I uint32_t ADDR3;
JoaoJardim 6:00f820418d01 582 __I uint32_t ADDR4;
JoaoJardim 6:00f820418d01 583 __I uint32_t ADDR5;
JoaoJardim 6:00f820418d01 584 __I uint32_t ADDR6;
JoaoJardim 6:00f820418d01 585 __I uint32_t ADDR7;
JoaoJardim 6:00f820418d01 586 __I uint32_t ADSTAT;
JoaoJardim 6:00f820418d01 587 __IO uint32_t ADTRM;
JoaoJardim 6:00f820418d01 588 } LPC_ADC_TypeDef;
JoaoJardim 6:00f820418d01 589
JoaoJardim 6:00f820418d01 590 /*------------- Digital-to-Analog Converter (DAC) ----------------------------*/
JoaoJardim 6:00f820418d01 591 typedef struct
JoaoJardim 6:00f820418d01 592 {
JoaoJardim 6:00f820418d01 593 __IO uint32_t DACR;
JoaoJardim 6:00f820418d01 594 __IO uint32_t DACCTRL;
JoaoJardim 6:00f820418d01 595 __IO uint16_t DACCNTVAL;
JoaoJardim 6:00f820418d01 596 } LPC_DAC_TypeDef;
JoaoJardim 6:00f820418d01 597
JoaoJardim 6:00f820418d01 598 /*------------- Motor Control Pulse-Width Modulation (MCPWM) -----------------*/
JoaoJardim 6:00f820418d01 599 typedef struct
JoaoJardim 6:00f820418d01 600 {
JoaoJardim 6:00f820418d01 601 __I uint32_t MCCON;
JoaoJardim 6:00f820418d01 602 __O uint32_t MCCON_SET;
JoaoJardim 6:00f820418d01 603 __O uint32_t MCCON_CLR;
JoaoJardim 6:00f820418d01 604 __I uint32_t MCCAPCON;
JoaoJardim 6:00f820418d01 605 __O uint32_t MCCAPCON_SET;
JoaoJardim 6:00f820418d01 606 __O uint32_t MCCAPCON_CLR;
JoaoJardim 6:00f820418d01 607 __IO uint32_t MCTIM0;
JoaoJardim 6:00f820418d01 608 __IO uint32_t MCTIM1;
JoaoJardim 6:00f820418d01 609 __IO uint32_t MCTIM2;
JoaoJardim 6:00f820418d01 610 __IO uint32_t MCPER0;
JoaoJardim 6:00f820418d01 611 __IO uint32_t MCPER1;
JoaoJardim 6:00f820418d01 612 __IO uint32_t MCPER2;
JoaoJardim 6:00f820418d01 613 __IO uint32_t MCPW0;
JoaoJardim 6:00f820418d01 614 __IO uint32_t MCPW1;
JoaoJardim 6:00f820418d01 615 __IO uint32_t MCPW2;
JoaoJardim 6:00f820418d01 616 __IO uint32_t MCDEADTIME;
JoaoJardim 6:00f820418d01 617 __IO uint32_t MCCCP;
JoaoJardim 6:00f820418d01 618 __IO uint32_t MCCR0;
JoaoJardim 6:00f820418d01 619 __IO uint32_t MCCR1;
JoaoJardim 6:00f820418d01 620 __IO uint32_t MCCR2;
JoaoJardim 6:00f820418d01 621 __I uint32_t MCINTEN;
JoaoJardim 6:00f820418d01 622 __O uint32_t MCINTEN_SET;
JoaoJardim 6:00f820418d01 623 __O uint32_t MCINTEN_CLR;
JoaoJardim 6:00f820418d01 624 __I uint32_t MCCNTCON;
JoaoJardim 6:00f820418d01 625 __O uint32_t MCCNTCON_SET;
JoaoJardim 6:00f820418d01 626 __O uint32_t MCCNTCON_CLR;
JoaoJardim 6:00f820418d01 627 __I uint32_t MCINTFLAG;
JoaoJardim 6:00f820418d01 628 __O uint32_t MCINTFLAG_SET;
JoaoJardim 6:00f820418d01 629 __O uint32_t MCINTFLAG_CLR;
JoaoJardim 6:00f820418d01 630 __O uint32_t MCCAP_CLR;
JoaoJardim 6:00f820418d01 631 } LPC_MCPWM_TypeDef;
JoaoJardim 6:00f820418d01 632
JoaoJardim 6:00f820418d01 633 /*------------- Quadrature Encoder Interface (QEI) ---------------------------*/
JoaoJardim 6:00f820418d01 634 typedef struct
JoaoJardim 6:00f820418d01 635 {
JoaoJardim 6:00f820418d01 636 __O uint32_t QEICON;
JoaoJardim 6:00f820418d01 637 __I uint32_t QEISTAT;
JoaoJardim 6:00f820418d01 638 __IO uint32_t QEICONF;
JoaoJardim 6:00f820418d01 639 __I uint32_t QEIPOS;
JoaoJardim 6:00f820418d01 640 __IO uint32_t QEIMAXPOS;
JoaoJardim 6:00f820418d01 641 __IO uint32_t CMPOS0;
JoaoJardim 6:00f820418d01 642 __IO uint32_t CMPOS1;
JoaoJardim 6:00f820418d01 643 __IO uint32_t CMPOS2;
JoaoJardim 6:00f820418d01 644 __I uint32_t INXCNT;
JoaoJardim 6:00f820418d01 645 __IO uint32_t INXCMP;
JoaoJardim 6:00f820418d01 646 __IO uint32_t QEILOAD;
JoaoJardim 6:00f820418d01 647 __I uint32_t QEITIME;
JoaoJardim 6:00f820418d01 648 __I uint32_t QEIVEL;
JoaoJardim 6:00f820418d01 649 __I uint32_t QEICAP;
JoaoJardim 6:00f820418d01 650 __IO uint32_t VELCOMP;
JoaoJardim 6:00f820418d01 651 __IO uint32_t FILTER;
JoaoJardim 6:00f820418d01 652 uint32_t RESERVED0[998];
JoaoJardim 6:00f820418d01 653 __O uint32_t QEIIEC;
JoaoJardim 6:00f820418d01 654 __O uint32_t QEIIES;
JoaoJardim 6:00f820418d01 655 __I uint32_t QEIINTSTAT;
JoaoJardim 6:00f820418d01 656 __I uint32_t QEIIE;
JoaoJardim 6:00f820418d01 657 __O uint32_t QEICLR;
JoaoJardim 6:00f820418d01 658 __O uint32_t QEISET;
JoaoJardim 6:00f820418d01 659 } LPC_QEI_TypeDef;
JoaoJardim 6:00f820418d01 660
JoaoJardim 6:00f820418d01 661 /*------------- Controller Area Network (CAN) --------------------------------*/
JoaoJardim 6:00f820418d01 662 typedef struct
JoaoJardim 6:00f820418d01 663 {
JoaoJardim 6:00f820418d01 664 __IO uint32_t mask[512]; /* ID Masks */
JoaoJardim 6:00f820418d01 665 } LPC_CANAF_RAM_TypeDef;
JoaoJardim 6:00f820418d01 666
JoaoJardim 6:00f820418d01 667 typedef struct /* Acceptance Filter Registers */
JoaoJardim 6:00f820418d01 668 {
JoaoJardim 6:00f820418d01 669 __IO uint32_t AFMR;
JoaoJardim 6:00f820418d01 670 __IO uint32_t SFF_sa;
JoaoJardim 6:00f820418d01 671 __IO uint32_t SFF_GRP_sa;
JoaoJardim 6:00f820418d01 672 __IO uint32_t EFF_sa;
JoaoJardim 6:00f820418d01 673 __IO uint32_t EFF_GRP_sa;
JoaoJardim 6:00f820418d01 674 __IO uint32_t ENDofTable;
JoaoJardim 6:00f820418d01 675 __I uint32_t LUTerrAd;
JoaoJardim 6:00f820418d01 676 __I uint32_t LUTerr;
JoaoJardim 6:00f820418d01 677 __IO uint32_t FCANIE;
JoaoJardim 6:00f820418d01 678 __IO uint32_t FCANIC0;
JoaoJardim 6:00f820418d01 679 __IO uint32_t FCANIC1;
JoaoJardim 6:00f820418d01 680 } LPC_CANAF_TypeDef;
JoaoJardim 6:00f820418d01 681
JoaoJardim 6:00f820418d01 682 typedef struct /* Central Registers */
JoaoJardim 6:00f820418d01 683 {
JoaoJardim 6:00f820418d01 684 __I uint32_t CANTxSR;
JoaoJardim 6:00f820418d01 685 __I uint32_t CANRxSR;
JoaoJardim 6:00f820418d01 686 __I uint32_t CANMSR;
JoaoJardim 6:00f820418d01 687 } LPC_CANCR_TypeDef;
JoaoJardim 6:00f820418d01 688
JoaoJardim 6:00f820418d01 689 typedef struct /* Controller Registers */
JoaoJardim 6:00f820418d01 690 {
JoaoJardim 6:00f820418d01 691 __IO uint32_t MOD;
JoaoJardim 6:00f820418d01 692 __O uint32_t CMR;
JoaoJardim 6:00f820418d01 693 __IO uint32_t GSR;
JoaoJardim 6:00f820418d01 694 __I uint32_t ICR;
JoaoJardim 6:00f820418d01 695 __IO uint32_t IER;
JoaoJardim 6:00f820418d01 696 __IO uint32_t BTR;
JoaoJardim 6:00f820418d01 697 __IO uint32_t EWL;
JoaoJardim 6:00f820418d01 698 __I uint32_t SR;
JoaoJardim 6:00f820418d01 699 __IO uint32_t RFS;
JoaoJardim 6:00f820418d01 700 __IO uint32_t RID;
JoaoJardim 6:00f820418d01 701 __IO uint32_t RDA;
JoaoJardim 6:00f820418d01 702 __IO uint32_t RDB;
JoaoJardim 6:00f820418d01 703 __IO uint32_t TFI1;
JoaoJardim 6:00f820418d01 704 __IO uint32_t TID1;
JoaoJardim 6:00f820418d01 705 __IO uint32_t TDA1;
JoaoJardim 6:00f820418d01 706 __IO uint32_t TDB1;
JoaoJardim 6:00f820418d01 707 __IO uint32_t TFI2;
JoaoJardim 6:00f820418d01 708 __IO uint32_t TID2;
JoaoJardim 6:00f820418d01 709 __IO uint32_t TDA2;
JoaoJardim 6:00f820418d01 710 __IO uint32_t TDB2;
JoaoJardim 6:00f820418d01 711 __IO uint32_t TFI3;
JoaoJardim 6:00f820418d01 712 __IO uint32_t TID3;
JoaoJardim 6:00f820418d01 713 __IO uint32_t TDA3;
JoaoJardim 6:00f820418d01 714 __IO uint32_t TDB3;
JoaoJardim 6:00f820418d01 715 } LPC_CAN_TypeDef;
JoaoJardim 6:00f820418d01 716
JoaoJardim 6:00f820418d01 717 /*------------- General Purpose Direct Memory Access (GPDMA) -----------------*/
JoaoJardim 6:00f820418d01 718 typedef struct /* Common Registers */
JoaoJardim 6:00f820418d01 719 {
JoaoJardim 6:00f820418d01 720 __I uint32_t DMACIntStat;
JoaoJardim 6:00f820418d01 721 __I uint32_t DMACIntTCStat;
JoaoJardim 6:00f820418d01 722 __O uint32_t DMACIntTCClear;
JoaoJardim 6:00f820418d01 723 __I uint32_t DMACIntErrStat;
JoaoJardim 6:00f820418d01 724 __O uint32_t DMACIntErrClr;
JoaoJardim 6:00f820418d01 725 __I uint32_t DMACRawIntTCStat;
JoaoJardim 6:00f820418d01 726 __I uint32_t DMACRawIntErrStat;
JoaoJardim 6:00f820418d01 727 __I uint32_t DMACEnbldChns;
JoaoJardim 6:00f820418d01 728 __IO uint32_t DMACSoftBReq;
JoaoJardim 6:00f820418d01 729 __IO uint32_t DMACSoftSReq;
JoaoJardim 6:00f820418d01 730 __IO uint32_t DMACSoftLBReq;
JoaoJardim 6:00f820418d01 731 __IO uint32_t DMACSoftLSReq;
JoaoJardim 6:00f820418d01 732 __IO uint32_t DMACConfig;
JoaoJardim 6:00f820418d01 733 __IO uint32_t DMACSync;
JoaoJardim 6:00f820418d01 734 } LPC_GPDMA_TypeDef;
JoaoJardim 6:00f820418d01 735
JoaoJardim 6:00f820418d01 736 typedef struct /* Channel Registers */
JoaoJardim 6:00f820418d01 737 {
JoaoJardim 6:00f820418d01 738 __IO uint32_t DMACCSrcAddr;
JoaoJardim 6:00f820418d01 739 __IO uint32_t DMACCDestAddr;
JoaoJardim 6:00f820418d01 740 __IO uint32_t DMACCLLI;
JoaoJardim 6:00f820418d01 741 __IO uint32_t DMACCControl;
JoaoJardim 6:00f820418d01 742 __IO uint32_t DMACCConfig;
JoaoJardim 6:00f820418d01 743 } LPC_GPDMACH_TypeDef;
JoaoJardim 6:00f820418d01 744
JoaoJardim 6:00f820418d01 745 /*------------- Universal Serial Bus (USB) -----------------------------------*/
JoaoJardim 6:00f820418d01 746 typedef struct
JoaoJardim 6:00f820418d01 747 {
JoaoJardim 6:00f820418d01 748 __I uint32_t HcRevision; /* USB Host Registers */
JoaoJardim 6:00f820418d01 749 __IO uint32_t HcControl;
JoaoJardim 6:00f820418d01 750 __IO uint32_t HcCommandStatus;
JoaoJardim 6:00f820418d01 751 __IO uint32_t HcInterruptStatus;
JoaoJardim 6:00f820418d01 752 __IO uint32_t HcInterruptEnable;
JoaoJardim 6:00f820418d01 753 __IO uint32_t HcInterruptDisable;
JoaoJardim 6:00f820418d01 754 __IO uint32_t HcHCCA;
JoaoJardim 6:00f820418d01 755 __I uint32_t HcPeriodCurrentED;
JoaoJardim 6:00f820418d01 756 __IO uint32_t HcControlHeadED;
JoaoJardim 6:00f820418d01 757 __IO uint32_t HcControlCurrentED;
JoaoJardim 6:00f820418d01 758 __IO uint32_t HcBulkHeadED;
JoaoJardim 6:00f820418d01 759 __IO uint32_t HcBulkCurrentED;
JoaoJardim 6:00f820418d01 760 __I uint32_t HcDoneHead;
JoaoJardim 6:00f820418d01 761 __IO uint32_t HcFmInterval;
JoaoJardim 6:00f820418d01 762 __I uint32_t HcFmRemaining;
JoaoJardim 6:00f820418d01 763 __I uint32_t HcFmNumber;
JoaoJardim 6:00f820418d01 764 __IO uint32_t HcPeriodicStart;
JoaoJardim 6:00f820418d01 765 __IO uint32_t HcLSTreshold;
JoaoJardim 6:00f820418d01 766 __IO uint32_t HcRhDescriptorA;
JoaoJardim 6:00f820418d01 767 __IO uint32_t HcRhDescriptorB;
JoaoJardim 6:00f820418d01 768 __IO uint32_t HcRhStatus;
JoaoJardim 6:00f820418d01 769 __IO uint32_t HcRhPortStatus1;
JoaoJardim 6:00f820418d01 770 __IO uint32_t HcRhPortStatus2;
JoaoJardim 6:00f820418d01 771 uint32_t RESERVED0[40];
JoaoJardim 6:00f820418d01 772 __I uint32_t Module_ID;
JoaoJardim 6:00f820418d01 773
JoaoJardim 6:00f820418d01 774 __I uint32_t OTGIntSt; /* USB On-The-Go Registers */
JoaoJardim 6:00f820418d01 775 __IO uint32_t OTGIntEn;
JoaoJardim 6:00f820418d01 776 __O uint32_t OTGIntSet;
JoaoJardim 6:00f820418d01 777 __O uint32_t OTGIntClr;
JoaoJardim 6:00f820418d01 778 __IO uint32_t OTGStCtrl;
JoaoJardim 6:00f820418d01 779 __IO uint32_t OTGTmr;
JoaoJardim 6:00f820418d01 780 uint32_t RESERVED1[58];
JoaoJardim 6:00f820418d01 781
JoaoJardim 6:00f820418d01 782 __I uint32_t USBDevIntSt; /* USB Device Interrupt Registers */
JoaoJardim 6:00f820418d01 783 __IO uint32_t USBDevIntEn;
JoaoJardim 6:00f820418d01 784 __O uint32_t USBDevIntClr;
JoaoJardim 6:00f820418d01 785 __O uint32_t USBDevIntSet;
JoaoJardim 6:00f820418d01 786
JoaoJardim 6:00f820418d01 787 __O uint32_t USBCmdCode; /* USB Device SIE Command Registers */
JoaoJardim 6:00f820418d01 788 __I uint32_t USBCmdData;
JoaoJardim 6:00f820418d01 789
JoaoJardim 6:00f820418d01 790 __I uint32_t USBRxData; /* USB Device Transfer Registers */
JoaoJardim 6:00f820418d01 791 __O uint32_t USBTxData;
JoaoJardim 6:00f820418d01 792 __I uint32_t USBRxPLen;
JoaoJardim 6:00f820418d01 793 __O uint32_t USBTxPLen;
JoaoJardim 6:00f820418d01 794 __IO uint32_t USBCtrl;
JoaoJardim 6:00f820418d01 795 __O uint32_t USBDevIntPri;
JoaoJardim 6:00f820418d01 796
JoaoJardim 6:00f820418d01 797 __I uint32_t USBEpIntSt; /* USB Device Endpoint Interrupt Regs */
JoaoJardim 6:00f820418d01 798 __IO uint32_t USBEpIntEn;
JoaoJardim 6:00f820418d01 799 __O uint32_t USBEpIntClr;
JoaoJardim 6:00f820418d01 800 __O uint32_t USBEpIntSet;
JoaoJardim 6:00f820418d01 801 __O uint32_t USBEpIntPri;
JoaoJardim 6:00f820418d01 802
JoaoJardim 6:00f820418d01 803 __IO uint32_t USBReEp; /* USB Device Endpoint Realization Reg*/
JoaoJardim 6:00f820418d01 804 __O uint32_t USBEpInd;
JoaoJardim 6:00f820418d01 805 __IO uint32_t USBMaxPSize;
JoaoJardim 6:00f820418d01 806
JoaoJardim 6:00f820418d01 807 __I uint32_t USBDMARSt; /* USB Device DMA Registers */
JoaoJardim 6:00f820418d01 808 __O uint32_t USBDMARClr;
JoaoJardim 6:00f820418d01 809 __O uint32_t USBDMARSet;
JoaoJardim 6:00f820418d01 810 uint32_t RESERVED2[9];
JoaoJardim 6:00f820418d01 811 __IO uint32_t USBUDCAH;
JoaoJardim 6:00f820418d01 812 __I uint32_t USBEpDMASt;
JoaoJardim 6:00f820418d01 813 __O uint32_t USBEpDMAEn;
JoaoJardim 6:00f820418d01 814 __O uint32_t USBEpDMADis;
JoaoJardim 6:00f820418d01 815 __I uint32_t USBDMAIntSt;
JoaoJardim 6:00f820418d01 816 __IO uint32_t USBDMAIntEn;
JoaoJardim 6:00f820418d01 817 uint32_t RESERVED3[2];
JoaoJardim 6:00f820418d01 818 __I uint32_t USBEoTIntSt;
JoaoJardim 6:00f820418d01 819 __O uint32_t USBEoTIntClr;
JoaoJardim 6:00f820418d01 820 __O uint32_t USBEoTIntSet;
JoaoJardim 6:00f820418d01 821 __I uint32_t USBNDDRIntSt;
JoaoJardim 6:00f820418d01 822 __O uint32_t USBNDDRIntClr;
JoaoJardim 6:00f820418d01 823 __O uint32_t USBNDDRIntSet;
JoaoJardim 6:00f820418d01 824 __I uint32_t USBSysErrIntSt;
JoaoJardim 6:00f820418d01 825 __O uint32_t USBSysErrIntClr;
JoaoJardim 6:00f820418d01 826 __O uint32_t USBSysErrIntSet;
JoaoJardim 6:00f820418d01 827 uint32_t RESERVED4[15];
JoaoJardim 6:00f820418d01 828
JoaoJardim 6:00f820418d01 829 union {
JoaoJardim 6:00f820418d01 830 __I uint32_t I2C_RX; /* USB OTG I2C Registers */
JoaoJardim 6:00f820418d01 831 __O uint32_t I2C_TX;
JoaoJardim 6:00f820418d01 832 };
JoaoJardim 6:00f820418d01 833 __I uint32_t I2C_STS;
JoaoJardim 6:00f820418d01 834 __IO uint32_t I2C_CTL;
JoaoJardim 6:00f820418d01 835 __IO uint32_t I2C_CLKHI;
JoaoJardim 6:00f820418d01 836 __O uint32_t I2C_CLKLO;
JoaoJardim 6:00f820418d01 837 uint32_t RESERVED5[824];
JoaoJardim 6:00f820418d01 838
JoaoJardim 6:00f820418d01 839 union {
JoaoJardim 6:00f820418d01 840 __IO uint32_t USBClkCtrl; /* USB Clock Control Registers */
JoaoJardim 6:00f820418d01 841 __IO uint32_t OTGClkCtrl;
JoaoJardim 6:00f820418d01 842 };
JoaoJardim 6:00f820418d01 843 union {
JoaoJardim 6:00f820418d01 844 __I uint32_t USBClkSt;
JoaoJardim 6:00f820418d01 845 __I uint32_t OTGClkSt;
JoaoJardim 6:00f820418d01 846 };
JoaoJardim 6:00f820418d01 847 } LPC_USB_TypeDef;
JoaoJardim 6:00f820418d01 848
JoaoJardim 6:00f820418d01 849 /*------------- Ethernet Media Access Controller (EMAC) ----------------------*/
JoaoJardim 6:00f820418d01 850 typedef struct
JoaoJardim 6:00f820418d01 851 {
JoaoJardim 6:00f820418d01 852 __IO uint32_t MAC1; /* MAC Registers */
JoaoJardim 6:00f820418d01 853 __IO uint32_t MAC2;
JoaoJardim 6:00f820418d01 854 __IO uint32_t IPGT;
JoaoJardim 6:00f820418d01 855 __IO uint32_t IPGR;
JoaoJardim 6:00f820418d01 856 __IO uint32_t CLRT;
JoaoJardim 6:00f820418d01 857 __IO uint32_t MAXF;
JoaoJardim 6:00f820418d01 858 __IO uint32_t SUPP;
JoaoJardim 6:00f820418d01 859 __IO uint32_t TEST;
JoaoJardim 6:00f820418d01 860 __IO uint32_t MCFG;
JoaoJardim 6:00f820418d01 861 __IO uint32_t MCMD;
JoaoJardim 6:00f820418d01 862 __IO uint32_t MADR;
JoaoJardim 6:00f820418d01 863 __O uint32_t MWTD;
JoaoJardim 6:00f820418d01 864 __I uint32_t MRDD;
JoaoJardim 6:00f820418d01 865 __I uint32_t MIND;
JoaoJardim 6:00f820418d01 866 uint32_t RESERVED0[2];
JoaoJardim 6:00f820418d01 867 __IO uint32_t SA0;
JoaoJardim 6:00f820418d01 868 __IO uint32_t SA1;
JoaoJardim 6:00f820418d01 869 __IO uint32_t SA2;
JoaoJardim 6:00f820418d01 870 uint32_t RESERVED1[45];
JoaoJardim 6:00f820418d01 871 __IO uint32_t Command; /* Control Registers */
JoaoJardim 6:00f820418d01 872 __I uint32_t Status;
JoaoJardim 6:00f820418d01 873 __IO uint32_t RxDescriptor;
JoaoJardim 6:00f820418d01 874 __IO uint32_t RxStatus;
JoaoJardim 6:00f820418d01 875 __IO uint32_t RxDescriptorNumber;
JoaoJardim 6:00f820418d01 876 __I uint32_t RxProduceIndex;
JoaoJardim 6:00f820418d01 877 __IO uint32_t RxConsumeIndex;
JoaoJardim 6:00f820418d01 878 __IO uint32_t TxDescriptor;
JoaoJardim 6:00f820418d01 879 __IO uint32_t TxStatus;
JoaoJardim 6:00f820418d01 880 __IO uint32_t TxDescriptorNumber;
JoaoJardim 6:00f820418d01 881 __IO uint32_t TxProduceIndex;
JoaoJardim 6:00f820418d01 882 __I uint32_t TxConsumeIndex;
JoaoJardim 6:00f820418d01 883 uint32_t RESERVED2[10];
JoaoJardim 6:00f820418d01 884 __I uint32_t TSV0;
JoaoJardim 6:00f820418d01 885 __I uint32_t TSV1;
JoaoJardim 6:00f820418d01 886 __I uint32_t RSV;
JoaoJardim 6:00f820418d01 887 uint32_t RESERVED3[3];
JoaoJardim 6:00f820418d01 888 __IO uint32_t FlowControlCounter;
JoaoJardim 6:00f820418d01 889 __I uint32_t FlowControlStatus;
JoaoJardim 6:00f820418d01 890 uint32_t RESERVED4[34];
JoaoJardim 6:00f820418d01 891 __IO uint32_t RxFilterCtrl; /* Rx Filter Registers */
JoaoJardim 6:00f820418d01 892 __IO uint32_t RxFilterWoLStatus;
JoaoJardim 6:00f820418d01 893 __IO uint32_t RxFilterWoLClear;
JoaoJardim 6:00f820418d01 894 uint32_t RESERVED5;
JoaoJardim 6:00f820418d01 895 __IO uint32_t HashFilterL;
JoaoJardim 6:00f820418d01 896 __IO uint32_t HashFilterH;
JoaoJardim 6:00f820418d01 897 uint32_t RESERVED6[882];
JoaoJardim 6:00f820418d01 898 __I uint32_t IntStatus; /* Module Control Registers */
JoaoJardim 6:00f820418d01 899 __IO uint32_t IntEnable;
JoaoJardim 6:00f820418d01 900 __O uint32_t IntClear;
JoaoJardim 6:00f820418d01 901 __O uint32_t IntSet;
JoaoJardim 6:00f820418d01 902 uint32_t RESERVED7;
JoaoJardim 6:00f820418d01 903 __IO uint32_t PowerDown;
JoaoJardim 6:00f820418d01 904 uint32_t RESERVED8;
JoaoJardim 6:00f820418d01 905 __IO uint32_t Module_ID;
JoaoJardim 6:00f820418d01 906 } LPC_EMAC_TypeDef;
JoaoJardim 6:00f820418d01 907
JoaoJardim 6:00f820418d01 908 #if defined ( __CC_ARM )
JoaoJardim 6:00f820418d01 909 #pragma no_anon_unions
JoaoJardim 6:00f820418d01 910 #endif
JoaoJardim 6:00f820418d01 911
JoaoJardim 6:00f820418d01 912
JoaoJardim 6:00f820418d01 913 /******************************************************************************/
JoaoJardim 6:00f820418d01 914 /* Peripheral memory map */
JoaoJardim 6:00f820418d01 915 /******************************************************************************/
JoaoJardim 6:00f820418d01 916 /* Base addresses */
JoaoJardim 6:00f820418d01 917 #define LPC_FLASH_BASE (0x00000000UL)
JoaoJardim 6:00f820418d01 918 #define LPC_RAM_BASE (0x10000000UL)
JoaoJardim 6:00f820418d01 919 #define LPC_GPIO_BASE (0x2009C000UL)
JoaoJardim 6:00f820418d01 920 #define LPC_APB0_BASE (0x40000000UL)
JoaoJardim 6:00f820418d01 921 #define LPC_APB1_BASE (0x40080000UL)
JoaoJardim 6:00f820418d01 922 #define LPC_AHB_BASE (0x50000000UL)
JoaoJardim 6:00f820418d01 923 #define LPC_CM3_BASE (0xE0000000UL)
JoaoJardim 6:00f820418d01 924
JoaoJardim 6:00f820418d01 925 /* APB0 peripherals */
JoaoJardim 6:00f820418d01 926 #define LPC_WDT_BASE (LPC_APB0_BASE + 0x00000)
JoaoJardim 6:00f820418d01 927 #define LPC_TIM0_BASE (LPC_APB0_BASE + 0x04000)
JoaoJardim 6:00f820418d01 928 #define LPC_TIM1_BASE (LPC_APB0_BASE + 0x08000)
JoaoJardim 6:00f820418d01 929 #define LPC_UART0_BASE (LPC_APB0_BASE + 0x0C000)
JoaoJardim 6:00f820418d01 930 #define LPC_UART1_BASE (LPC_APB0_BASE + 0x10000)
JoaoJardim 6:00f820418d01 931 #define LPC_PWM1_BASE (LPC_APB0_BASE + 0x18000)
JoaoJardim 6:00f820418d01 932 #define LPC_I2C0_BASE (LPC_APB0_BASE + 0x1C000)
JoaoJardim 6:00f820418d01 933 #define LPC_SPI_BASE (LPC_APB0_BASE + 0x20000)
JoaoJardim 6:00f820418d01 934 #define LPC_RTC_BASE (LPC_APB0_BASE + 0x24000)
JoaoJardim 6:00f820418d01 935 #define LPC_GPIOINT_BASE (LPC_APB0_BASE + 0x28080)
JoaoJardim 6:00f820418d01 936 #define LPC_PINCON_BASE (LPC_APB0_BASE + 0x2C000)
JoaoJardim 6:00f820418d01 937 #define LPC_SSP1_BASE (LPC_APB0_BASE + 0x30000)
JoaoJardim 6:00f820418d01 938 #define LPC_ADC_BASE (LPC_APB0_BASE + 0x34000)
JoaoJardim 6:00f820418d01 939 #define LPC_CANAF_RAM_BASE (LPC_APB0_BASE + 0x38000)
JoaoJardim 6:00f820418d01 940 #define LPC_CANAF_BASE (LPC_APB0_BASE + 0x3C000)
JoaoJardim 6:00f820418d01 941 #define LPC_CANCR_BASE (LPC_APB0_BASE + 0x40000)
JoaoJardim 6:00f820418d01 942 #define LPC_CAN1_BASE (LPC_APB0_BASE + 0x44000)
JoaoJardim 6:00f820418d01 943 #define LPC_CAN2_BASE (LPC_APB0_BASE + 0x48000)
JoaoJardim 6:00f820418d01 944 #define LPC_I2C1_BASE (LPC_APB0_BASE + 0x5C000)
JoaoJardim 6:00f820418d01 945
JoaoJardim 6:00f820418d01 946 /* APB1 peripherals */
JoaoJardim 6:00f820418d01 947 #define LPC_SSP0_BASE (LPC_APB1_BASE + 0x08000)
JoaoJardim 6:00f820418d01 948 #define LPC_DAC_BASE (LPC_APB1_BASE + 0x0C000)
JoaoJardim 6:00f820418d01 949 #define LPC_TIM2_BASE (LPC_APB1_BASE + 0x10000)
JoaoJardim 6:00f820418d01 950 #define LPC_TIM3_BASE (LPC_APB1_BASE + 0x14000)
JoaoJardim 6:00f820418d01 951 #define LPC_UART2_BASE (LPC_APB1_BASE + 0x18000)
JoaoJardim 6:00f820418d01 952 #define LPC_UART3_BASE (LPC_APB1_BASE + 0x1C000)
JoaoJardim 6:00f820418d01 953 #define LPC_I2C2_BASE (LPC_APB1_BASE + 0x20000)
JoaoJardim 6:00f820418d01 954 #define LPC_I2S_BASE (LPC_APB1_BASE + 0x28000)
JoaoJardim 6:00f820418d01 955 #define LPC_RIT_BASE (LPC_APB1_BASE + 0x30000)
JoaoJardim 6:00f820418d01 956 #define LPC_MCPWM_BASE (LPC_APB1_BASE + 0x38000)
JoaoJardim 6:00f820418d01 957 #define LPC_QEI_BASE (LPC_APB1_BASE + 0x3C000)
JoaoJardim 6:00f820418d01 958 #define LPC_SC_BASE (LPC_APB1_BASE + 0x7C000)
JoaoJardim 6:00f820418d01 959
JoaoJardim 6:00f820418d01 960 /* AHB peripherals */
JoaoJardim 6:00f820418d01 961 #define LPC_EMAC_BASE (LPC_AHB_BASE + 0x00000)
JoaoJardim 6:00f820418d01 962 #define LPC_GPDMA_BASE (LPC_AHB_BASE + 0x04000)
JoaoJardim 6:00f820418d01 963 #define LPC_GPDMACH0_BASE (LPC_AHB_BASE + 0x04100)
JoaoJardim 6:00f820418d01 964 #define LPC_GPDMACH1_BASE (LPC_AHB_BASE + 0x04120)
JoaoJardim 6:00f820418d01 965 #define LPC_GPDMACH2_BASE (LPC_AHB_BASE + 0x04140)
JoaoJardim 6:00f820418d01 966 #define LPC_GPDMACH3_BASE (LPC_AHB_BASE + 0x04160)
JoaoJardim 6:00f820418d01 967 #define LPC_GPDMACH4_BASE (LPC_AHB_BASE + 0x04180)
JoaoJardim 6:00f820418d01 968 #define LPC_GPDMACH5_BASE (LPC_AHB_BASE + 0x041A0)
JoaoJardim 6:00f820418d01 969 #define LPC_GPDMACH6_BASE (LPC_AHB_BASE + 0x041C0)
JoaoJardim 6:00f820418d01 970 #define LPC_GPDMACH7_BASE (LPC_AHB_BASE + 0x041E0)
JoaoJardim 6:00f820418d01 971 #define LPC_USB_BASE (LPC_AHB_BASE + 0x0C000)
JoaoJardim 6:00f820418d01 972
JoaoJardim 6:00f820418d01 973 /* GPIOs */
JoaoJardim 6:00f820418d01 974 #define LPC_GPIO0_BASE (LPC_GPIO_BASE + 0x00000)
JoaoJardim 6:00f820418d01 975 #define LPC_GPIO1_BASE (LPC_GPIO_BASE + 0x00020)
JoaoJardim 6:00f820418d01 976 #define LPC_GPIO2_BASE (LPC_GPIO_BASE + 0x00040)
JoaoJardim 6:00f820418d01 977 #define LPC_GPIO3_BASE (LPC_GPIO_BASE + 0x00060)
JoaoJardim 6:00f820418d01 978 #define LPC_GPIO4_BASE (LPC_GPIO_BASE + 0x00080)
JoaoJardim 6:00f820418d01 979
JoaoJardim 6:00f820418d01 980
JoaoJardim 6:00f820418d01 981 /******************************************************************************/
JoaoJardim 6:00f820418d01 982 /* Peripheral declaration */
JoaoJardim 6:00f820418d01 983 /******************************************************************************/
JoaoJardim 6:00f820418d01 984 #define LPC_SC ((LPC_SC_TypeDef *) LPC_SC_BASE )
JoaoJardim 6:00f820418d01 985 #define LPC_GPIO0 ((LPC_GPIO_TypeDef *) LPC_GPIO0_BASE )
JoaoJardim 6:00f820418d01 986 #define LPC_GPIO1 ((LPC_GPIO_TypeDef *) LPC_GPIO1_BASE )
JoaoJardim 6:00f820418d01 987 #define LPC_GPIO2 ((LPC_GPIO_TypeDef *) LPC_GPIO2_BASE )
JoaoJardim 6:00f820418d01 988 #define LPC_GPIO3 ((LPC_GPIO_TypeDef *) LPC_GPIO3_BASE )
JoaoJardim 6:00f820418d01 989 #define LPC_GPIO4 ((LPC_GPIO_TypeDef *) LPC_GPIO4_BASE )
JoaoJardim 6:00f820418d01 990 #define LPC_WDT ((LPC_WDT_TypeDef *) LPC_WDT_BASE )
JoaoJardim 6:00f820418d01 991 #define LPC_TIM0 ((LPC_TIM_TypeDef *) LPC_TIM0_BASE )
JoaoJardim 6:00f820418d01 992 #define LPC_TIM1 ((LPC_TIM_TypeDef *) LPC_TIM1_BASE )
JoaoJardim 6:00f820418d01 993 #define LPC_TIM2 ((LPC_TIM_TypeDef *) LPC_TIM2_BASE )
JoaoJardim 6:00f820418d01 994 #define LPC_TIM3 ((LPC_TIM_TypeDef *) LPC_TIM3_BASE )
JoaoJardim 6:00f820418d01 995 #define LPC_RIT ((LPC_RIT_TypeDef *) LPC_RIT_BASE )
JoaoJardim 6:00f820418d01 996 #define LPC_UART0 ((LPC_UART0_TypeDef *) LPC_UART0_BASE )
JoaoJardim 6:00f820418d01 997 #define LPC_UART1 ((LPC_UART1_TypeDef *) LPC_UART1_BASE )
JoaoJardim 6:00f820418d01 998 #define LPC_UART2 ((LPC_UART_TypeDef *) LPC_UART2_BASE )
JoaoJardim 6:00f820418d01 999 #define LPC_UART3 ((LPC_UART_TypeDef *) LPC_UART3_BASE )
JoaoJardim 6:00f820418d01 1000 #define LPC_PWM1 ((LPC_PWM_TypeDef *) LPC_PWM1_BASE )
JoaoJardim 6:00f820418d01 1001 #define LPC_I2C0 ((LPC_I2C_TypeDef *) LPC_I2C0_BASE )
JoaoJardim 6:00f820418d01 1002 #define LPC_I2C1 ((LPC_I2C_TypeDef *) LPC_I2C1_BASE )
JoaoJardim 6:00f820418d01 1003 #define LPC_I2C2 ((LPC_I2C_TypeDef *) LPC_I2C2_BASE )
JoaoJardim 6:00f820418d01 1004 #define LPC_I2S ((LPC_I2S_TypeDef *) LPC_I2S_BASE )
JoaoJardim 6:00f820418d01 1005 #define LPC_SPI ((LPC_SPI_TypeDef *) LPC_SPI_BASE )
JoaoJardim 6:00f820418d01 1006 #define LPC_RTC ((LPC_RTC_TypeDef *) LPC_RTC_BASE )
JoaoJardim 6:00f820418d01 1007 #define LPC_GPIOINT ((LPC_GPIOINT_TypeDef *) LPC_GPIOINT_BASE )
JoaoJardim 6:00f820418d01 1008 #define LPC_PINCON ((LPC_PINCON_TypeDef *) LPC_PINCON_BASE )
JoaoJardim 6:00f820418d01 1009 #define LPC_SSP0 ((LPC_SSP_TypeDef *) LPC_SSP0_BASE )
JoaoJardim 6:00f820418d01 1010 #define LPC_SSP1 ((LPC_SSP_TypeDef *) LPC_SSP1_BASE )
JoaoJardim 6:00f820418d01 1011 #define LPC_ADC ((LPC_ADC_TypeDef *) LPC_ADC_BASE )
JoaoJardim 6:00f820418d01 1012 #define LPC_DAC ((LPC_DAC_TypeDef *) LPC_DAC_BASE )
JoaoJardim 6:00f820418d01 1013 #define LPC_CANAF_RAM ((LPC_CANAF_RAM_TypeDef *) LPC_CANAF_RAM_BASE)
JoaoJardim 6:00f820418d01 1014 #define LPC_CANAF ((LPC_CANAF_TypeDef *) LPC_CANAF_BASE )
JoaoJardim 6:00f820418d01 1015 #define LPC_CANCR ((LPC_CANCR_TypeDef *) LPC_CANCR_BASE )
JoaoJardim 6:00f820418d01 1016 #define LPC_CAN1 ((LPC_CAN_TypeDef *) LPC_CAN1_BASE )
JoaoJardim 6:00f820418d01 1017 #define LPC_CAN2 ((LPC_CAN_TypeDef *) LPC_CAN2_BASE )
JoaoJardim 6:00f820418d01 1018 #define LPC_MCPWM ((LPC_MCPWM_TypeDef *) LPC_MCPWM_BASE )
JoaoJardim 6:00f820418d01 1019 #define LPC_QEI ((LPC_QEI_TypeDef *) LPC_QEI_BASE )
JoaoJardim 6:00f820418d01 1020 #define LPC_EMAC ((LPC_EMAC_TypeDef *) LPC_EMAC_BASE )
JoaoJardim 6:00f820418d01 1021 #define LPC_GPDMA ((LPC_GPDMA_TypeDef *) LPC_GPDMA_BASE )
JoaoJardim 6:00f820418d01 1022 #define LPC_GPDMACH0 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH0_BASE )
JoaoJardim 6:00f820418d01 1023 #define LPC_GPDMACH1 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH1_BASE )
JoaoJardim 6:00f820418d01 1024 #define LPC_GPDMACH2 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH2_BASE )
JoaoJardim 6:00f820418d01 1025 #define LPC_GPDMACH3 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH3_BASE )
JoaoJardim 6:00f820418d01 1026 #define LPC_GPDMACH4 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH4_BASE )
JoaoJardim 6:00f820418d01 1027 #define LPC_GPDMACH5 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH5_BASE )
JoaoJardim 6:00f820418d01 1028 #define LPC_GPDMACH6 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH6_BASE )
JoaoJardim 6:00f820418d01 1029 #define LPC_GPDMACH7 ((LPC_GPDMACH_TypeDef *) LPC_GPDMACH7_BASE )
JoaoJardim 6:00f820418d01 1030 #define LPC_USB ((LPC_USB_TypeDef *) LPC_USB_BASE )
JoaoJardim 6:00f820418d01 1031
JoaoJardim 6:00f820418d01 1032 #endif // __LPC17xx_H__
JoaoJardim 6:00f820418d01 1033