mbed-os

Fork of mbed-os by erkin yucel

Committer:
xuaner
Date:
Thu Jul 20 14:26:57 2017 +0000
Revision:
1:3deb71413561
Parent:
0:f269e3021894
mbed_os

Who changed what in which revision?

UserRevisionLine numberNew contents of line
elessair 0:f269e3021894 1 /****************************************************************************
elessair 0:f269e3021894 2 * $Id:: LPC8xx.h 6437 2012-10-31 11:06:06Z dep00694 $
elessair 0:f269e3021894 3 * Project: NXP LPC8xx software example
elessair 0:f269e3021894 4 *
elessair 0:f269e3021894 5 * Description:
elessair 0:f269e3021894 6 * CMSIS Cortex-M0+ Core Peripheral Access Layer Header File for
elessair 0:f269e3021894 7 * NXP LPC800 Device Series
elessair 0:f269e3021894 8 *
elessair 0:f269e3021894 9 ****************************************************************************
elessair 0:f269e3021894 10 * Software that is described herein is for illustrative purposes only
elessair 0:f269e3021894 11 * which provides customers with programming information regarding the
elessair 0:f269e3021894 12 * products. This software is supplied "AS IS" without any warranties.
elessair 0:f269e3021894 13 * NXP Semiconductors assumes no responsibility or liability for the
elessair 0:f269e3021894 14 * use of the software, conveys no license or title under any patent,
elessair 0:f269e3021894 15 * copyright, or mask work right to the product. NXP Semiconductors
elessair 0:f269e3021894 16 * reserves the right to make changes in the software without
elessair 0:f269e3021894 17 * notification. NXP Semiconductors also make no representation or
elessair 0:f269e3021894 18 * warranty that such application will be suitable for the specified
elessair 0:f269e3021894 19 * use without further testing or modification.
elessair 0:f269e3021894 20
elessair 0:f269e3021894 21 * Permission to use, copy, modify, and distribute this software and its
elessair 0:f269e3021894 22 * documentation is hereby granted, under NXP Semiconductors'
elessair 0:f269e3021894 23 * relevant copyright in the software, without fee, provided that it
elessair 0:f269e3021894 24 * is used in conjunction with NXP Semiconductors microcontrollers. This
elessair 0:f269e3021894 25 * copyright, permission, and disclaimer notice must appear in all copies of
elessair 0:f269e3021894 26 * this code.
elessair 0:f269e3021894 27 ****************************************************************************/
elessair 0:f269e3021894 28 #ifndef __LPC8xx_H__
elessair 0:f269e3021894 29 #define __LPC8xx_H__
elessair 0:f269e3021894 30
elessair 0:f269e3021894 31 #ifdef __cplusplus
elessair 0:f269e3021894 32 extern "C" {
elessair 0:f269e3021894 33 #endif
elessair 0:f269e3021894 34
elessair 0:f269e3021894 35 /** @addtogroup LPC8xx_Definitions LPC8xx Definitions
elessair 0:f269e3021894 36 This file defines all structures and symbols for LPC8xx:
elessair 0:f269e3021894 37 - Registers and bitfields
elessair 0:f269e3021894 38 - peripheral base address
elessair 0:f269e3021894 39 - PIO definitions
elessair 0:f269e3021894 40 @{
elessair 0:f269e3021894 41 */
elessair 0:f269e3021894 42
elessair 0:f269e3021894 43
elessair 0:f269e3021894 44 /******************************************************************************/
elessair 0:f269e3021894 45 /* Processor and Core Peripherals */
elessair 0:f269e3021894 46 /******************************************************************************/
elessair 0:f269e3021894 47 /** @addtogroup LPC8xx_CMSIS LPC8xx CMSIS Definitions
elessair 0:f269e3021894 48 Configuration of the Cortex-M0+ Processor and Core Peripherals
elessair 0:f269e3021894 49 @{
elessair 0:f269e3021894 50 */
elessair 0:f269e3021894 51
elessair 0:f269e3021894 52 /*
elessair 0:f269e3021894 53 * ==========================================================================
elessair 0:f269e3021894 54 * ---------- Interrupt Number Definition -----------------------------------
elessair 0:f269e3021894 55 * ==========================================================================
elessair 0:f269e3021894 56 */
elessair 0:f269e3021894 57 typedef enum IRQn
elessair 0:f269e3021894 58 {
elessair 0:f269e3021894 59 /****** Cortex-M0 Processor Exceptions Numbers ***************************************************/
elessair 0:f269e3021894 60 Reset_IRQn = -15, /*!< 1 Reset Vector, invoked on Power up and warm reset*/
elessair 0:f269e3021894 61 NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
elessair 0:f269e3021894 62 HardFault_IRQn = -13, /*!< 3 Cortex-M0 Hard Fault Interrupt */
elessair 0:f269e3021894 63 SVCall_IRQn = -5, /*!< 11 Cortex-M0 SV Call Interrupt */
elessair 0:f269e3021894 64 PendSV_IRQn = -2, /*!< 14 Cortex-M0 Pend SV Interrupt */
elessair 0:f269e3021894 65 SysTick_IRQn = -1, /*!< 15 Cortex-M0 System Tick Interrupt */
elessair 0:f269e3021894 66
elessair 0:f269e3021894 67 /****** LPC8xx Specific Interrupt Numbers ********************************************************/
elessair 0:f269e3021894 68 SPI0_IRQn = 0, /*!< SPI0 */
elessair 0:f269e3021894 69 SPI1_IRQn = 1, /*!< SPI1 */
elessair 0:f269e3021894 70 Reserved0_IRQn = 2, /*!< Reserved Interrupt */
elessair 0:f269e3021894 71 UART0_IRQn = 3, /*!< USART0 */
elessair 0:f269e3021894 72 UART1_IRQn = 4, /*!< USART1 */
elessair 0:f269e3021894 73 UART2_IRQn = 5, /*!< USART2 */
elessair 0:f269e3021894 74 Reserved1_IRQn = 6, /*!< Reserved Interrupt */
elessair 0:f269e3021894 75 Reserved2_IRQn = 7, /*!< Reserved Interrupt */
elessair 0:f269e3021894 76 I2C_IRQn = 8, /*!< I2C */
elessair 0:f269e3021894 77 SCT_IRQn = 9, /*!< SCT */
elessair 0:f269e3021894 78 MRT_IRQn = 10, /*!< MRT */
elessair 0:f269e3021894 79 CMP_IRQn = 11, /*!< CMP */
elessair 0:f269e3021894 80 WDT_IRQn = 12, /*!< WDT */
elessair 0:f269e3021894 81 BOD_IRQn = 13, /*!< BOD */
elessair 0:f269e3021894 82 Reserved3_IRQn = 14, /*!< Reserved Interrupt */
elessair 0:f269e3021894 83 WKT_IRQn = 15, /*!< WKT Interrupt */
elessair 0:f269e3021894 84 Reserved4_IRQn = 16, /*!< Reserved Interrupt */
elessair 0:f269e3021894 85 Reserved5_IRQn = 17, /*!< Reserved Interrupt */
elessair 0:f269e3021894 86 Reserved6_IRQn = 18, /*!< Reserved Interrupt */
elessair 0:f269e3021894 87 Reserved7_IRQn = 19, /*!< Reserved Interrupt */
elessair 0:f269e3021894 88 Reserved8_IRQn = 20, /*!< Reserved Interrupt */
elessair 0:f269e3021894 89 Reserved9_IRQn = 21, /*!< Reserved Interrupt */
elessair 0:f269e3021894 90 Reserved10_IRQn = 22, /*!< Reserved Interrupt */
elessair 0:f269e3021894 91 Reserved11_IRQn = 23, /*!< Reserved Interrupt */
elessair 0:f269e3021894 92 PININT0_IRQn = 24, /*!< External Interrupt 0 */
elessair 0:f269e3021894 93 PININT1_IRQn = 25, /*!< External Interrupt 1 */
elessair 0:f269e3021894 94 PININT2_IRQn = 26, /*!< External Interrupt 2 */
elessair 0:f269e3021894 95 PININT3_IRQn = 27, /*!< External Interrupt 3 */
elessair 0:f269e3021894 96 PININT4_IRQn = 28, /*!< External Interrupt 4 */
elessair 0:f269e3021894 97 PININT5_IRQn = 29, /*!< External Interrupt 5 */
elessair 0:f269e3021894 98 PININT6_IRQn = 30, /*!< External Interrupt 6 */
elessair 0:f269e3021894 99 PININT7_IRQn = 31, /*!< External Interrupt 7 */
elessair 0:f269e3021894 100 } IRQn_Type;
elessair 0:f269e3021894 101
elessair 0:f269e3021894 102 /*
elessair 0:f269e3021894 103 * ==========================================================================
elessair 0:f269e3021894 104 * ----------- Processor and Core Peripheral Section ------------------------
elessair 0:f269e3021894 105 * ==========================================================================
elessair 0:f269e3021894 106 */
elessair 0:f269e3021894 107
elessair 0:f269e3021894 108 /* Configuration of the Cortex-M0+ Processor and Core Peripherals */
elessair 0:f269e3021894 109 #define __MPU_PRESENT 0 /*!< MPU present or not */
elessair 0:f269e3021894 110 #define __VTOR_PRESENT 1 /**< Defines if an VTOR is present or not */
elessair 0:f269e3021894 111 #define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */
elessair 0:f269e3021894 112 #define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
elessair 0:f269e3021894 113
elessair 0:f269e3021894 114 /*@}*/ /* end of group LPC8xx_CMSIS */
elessair 0:f269e3021894 115
elessair 0:f269e3021894 116
elessair 0:f269e3021894 117 #include "core_cm0plus.h" /* Cortex-M0+ processor and core peripherals */
elessair 0:f269e3021894 118 #include "system_LPC8xx.h" /* System Header */
elessair 0:f269e3021894 119
elessair 0:f269e3021894 120
elessair 0:f269e3021894 121 /******************************************************************************/
elessair 0:f269e3021894 122 /* Device Specific Peripheral Registers structures */
elessair 0:f269e3021894 123 /******************************************************************************/
elessair 0:f269e3021894 124
elessair 0:f269e3021894 125 #if defined ( __CC_ARM )
elessair 0:f269e3021894 126 #pragma anon_unions
elessair 0:f269e3021894 127 #endif
elessair 0:f269e3021894 128
elessair 0:f269e3021894 129 /*------------- System Control (SYSCON) --------------------------------------*/
elessair 0:f269e3021894 130 /** @addtogroup LPC8xx_SYSCON LPC8xx System Control Block
elessair 0:f269e3021894 131 @{
elessair 0:f269e3021894 132 */
elessair 0:f269e3021894 133 typedef struct
elessair 0:f269e3021894 134 {
elessair 0:f269e3021894 135 __IO uint32_t SYSMEMREMAP; /*!< Offset: 0x000 System memory remap (R/W) */
elessair 0:f269e3021894 136 __IO uint32_t PRESETCTRL; /*!< Offset: 0x004 Peripheral reset control (R/W) */
elessair 0:f269e3021894 137 __IO uint32_t SYSPLLCTRL; /*!< Offset: 0x008 System PLL control (R/W) */
elessair 0:f269e3021894 138 __IO uint32_t SYSPLLSTAT; /*!< Offset: 0x00C System PLL status (R/W ) */
elessair 0:f269e3021894 139 uint32_t RESERVED0[4];
elessair 0:f269e3021894 140
elessair 0:f269e3021894 141 __IO uint32_t SYSOSCCTRL; /*!< Offset: 0x020 System oscillator control (R/W) */
elessair 0:f269e3021894 142 __IO uint32_t WDTOSCCTRL; /*!< Offset: 0x024 Watchdog oscillator control (R/W) */
elessair 0:f269e3021894 143 uint32_t RESERVED1[2];
elessair 0:f269e3021894 144 __IO uint32_t SYSRSTSTAT; /*!< Offset: 0x030 System reset status Register (R/W ) */
elessair 0:f269e3021894 145 uint32_t RESERVED2[3];
elessair 0:f269e3021894 146 __IO uint32_t SYSPLLCLKSEL; /*!< Offset: 0x040 System PLL clock source select (R/W) */
elessair 0:f269e3021894 147 __IO uint32_t SYSPLLCLKUEN; /*!< Offset: 0x044 System PLL clock source update enable (R/W) */
elessair 0:f269e3021894 148 uint32_t RESERVED3[10];
elessair 0:f269e3021894 149
elessair 0:f269e3021894 150 __IO uint32_t MAINCLKSEL; /*!< Offset: 0x070 Main clock source select (R/W) */
elessair 0:f269e3021894 151 __IO uint32_t MAINCLKUEN; /*!< Offset: 0x074 Main clock source update enable (R/W) */
elessair 0:f269e3021894 152 __IO uint32_t SYSAHBCLKDIV; /*!< Offset: 0x078 System AHB clock divider (R/W) */
elessair 0:f269e3021894 153 uint32_t RESERVED4[1];
elessair 0:f269e3021894 154
elessair 0:f269e3021894 155 __IO uint32_t SYSAHBCLKCTRL; /*!< Offset: 0x080 System AHB clock control (R/W) */
elessair 0:f269e3021894 156 uint32_t RESERVED5[4];
elessair 0:f269e3021894 157 __IO uint32_t UARTCLKDIV; /*!< Offset: 0x094 UART clock divider (R/W) */
elessair 0:f269e3021894 158 uint32_t RESERVED6[18];
elessair 0:f269e3021894 159
elessair 0:f269e3021894 160 __IO uint32_t CLKOUTSEL; /*!< Offset: 0x0E0 CLKOUT clock source select (R/W) */
elessair 0:f269e3021894 161 __IO uint32_t CLKOUTUEN; /*!< Offset: 0x0E4 CLKOUT clock source update enable (R/W) */
elessair 0:f269e3021894 162 __IO uint32_t CLKOUTDIV; /*!< Offset: 0x0E8 CLKOUT clock divider (R/W) */
elessair 0:f269e3021894 163 uint32_t RESERVED7;
elessair 0:f269e3021894 164 __IO uint32_t UARTFRGDIV; /*!< Offset: 0x0F0 UART fractional divider SUB(R/W) */
elessair 0:f269e3021894 165 __IO uint32_t UARTFRGMULT; /*!< Offset: 0x0F4 UART fractional divider ADD(R/W) */
elessair 0:f269e3021894 166 uint32_t RESERVED8[1];
elessair 0:f269e3021894 167 __IO uint32_t EXTTRACECMD; /*!< (@ 0x400480FC) External trace buffer command register */
elessair 0:f269e3021894 168 __IO uint32_t PIOPORCAP0; /*!< Offset: 0x100 POR captured PIO status 0 (R/ ) */
elessair 0:f269e3021894 169 uint32_t RESERVED9[12];
elessair 0:f269e3021894 170 __IO uint32_t IOCONCLKDIV[7]; /*!< (@0x40048134-14C) Peripheral clock x to the IOCON block for programmable glitch filter */
elessair 0:f269e3021894 171 __IO uint32_t BODCTRL; /*!< Offset: 0x150 BOD control (R/W) */
elessair 0:f269e3021894 172 __IO uint32_t SYSTCKCAL; /*!< Offset: 0x154 System tick counter calibration (R/W) */
elessair 0:f269e3021894 173 uint32_t RESERVED10[6];
elessair 0:f269e3021894 174 __IO uint32_t IRQLATENCY; /*!< (@ 0x40048170) IRQ delay */
elessair 0:f269e3021894 175 __IO uint32_t NMISRC; /*!< (@ 0x40048174) NMI Source Control */
elessair 0:f269e3021894 176 __IO uint32_t PINTSEL[8]; /*!< (@ 0x40048178) GPIO Pin Interrupt Select register 0 */
elessair 0:f269e3021894 177 uint32_t RESERVED11[27];
elessair 0:f269e3021894 178 __IO uint32_t STARTERP0; /*!< Offset: 0x204 Start logic signal enable Register 0 (R/W) */
elessair 0:f269e3021894 179 uint32_t RESERVED12[3];
elessair 0:f269e3021894 180 __IO uint32_t STARTERP1; /*!< Offset: 0x214 Start logic signal enable Register 0 (R/W) */
elessair 0:f269e3021894 181 uint32_t RESERVED13[6];
elessair 0:f269e3021894 182 __IO uint32_t PDSLEEPCFG; /*!< Offset: 0x230 Power-down states in Deep-sleep mode (R/W) */
elessair 0:f269e3021894 183 __IO uint32_t PDAWAKECFG; /*!< Offset: 0x234 Power-down states after wake-up (R/W) */
elessair 0:f269e3021894 184 __IO uint32_t PDRUNCFG; /*!< Offset: 0x238 Power-down configuration Register (R/W) */
elessair 0:f269e3021894 185 uint32_t RESERVED14[110];
elessair 0:f269e3021894 186 __I uint32_t DEVICE_ID; /*!< Offset: 0x3F4 Device ID (R/ ) */
elessair 0:f269e3021894 187 } LPC_SYSCON_TypeDef;
elessair 0:f269e3021894 188 /*@}*/ /* end of group LPC8xx_SYSCON */
elessair 0:f269e3021894 189
elessair 0:f269e3021894 190
elessair 0:f269e3021894 191 /**
elessair 0:f269e3021894 192 * @brief Product name title=UM10462 Chapter title=LPC8xx I/O configuration Modification date=3/16/2011 Major revision=0 Minor revision=3 (IOCONFIG)
elessair 0:f269e3021894 193 */
elessair 0:f269e3021894 194
elessair 0:f269e3021894 195 typedef struct { /*!< (@ 0x40044000) IOCONFIG Structure */
elessair 0:f269e3021894 196 __IO uint32_t PIO0_17; /*!< (@ 0x40044000) I/O configuration for pin PIO0_17 */
elessair 0:f269e3021894 197 __IO uint32_t PIO0_13; /*!< (@ 0x40044004) I/O configuration for pin PIO0_13 */
elessair 0:f269e3021894 198 __IO uint32_t PIO0_12; /*!< (@ 0x40044008) I/O configuration for pin PIO0_12 */
elessair 0:f269e3021894 199 __IO uint32_t PIO0_5; /*!< (@ 0x4004400C) I/O configuration for pin PIO0_5 */
elessair 0:f269e3021894 200 __IO uint32_t PIO0_4; /*!< (@ 0x40044010) I/O configuration for pin PIO0_4 */
elessair 0:f269e3021894 201 __IO uint32_t PIO0_3; /*!< (@ 0x40044014) I/O configuration for pin PIO0_3 */
elessair 0:f269e3021894 202 __IO uint32_t PIO0_2; /*!< (@ 0x40044018) I/O configuration for pin PIO0_2 */
elessair 0:f269e3021894 203 __IO uint32_t PIO0_11; /*!< (@ 0x4004401C) I/O configuration for pin PIO0_11 */
elessair 0:f269e3021894 204 __IO uint32_t PIO0_10; /*!< (@ 0x40044020) I/O configuration for pin PIO0_10 */
elessair 0:f269e3021894 205 __IO uint32_t PIO0_16; /*!< (@ 0x40044024) I/O configuration for pin PIO0_16 */
elessair 0:f269e3021894 206 __IO uint32_t PIO0_15; /*!< (@ 0x40044028) I/O configuration for pin PIO0_15 */
elessair 0:f269e3021894 207 __IO uint32_t PIO0_1; /*!< (@ 0x4004402C) I/O configuration for pin PIO0_1 */
elessair 0:f269e3021894 208 __IO uint32_t Reserved; /*!< (@ 0x40044030) I/O configuration for pin (Reserved) */
elessair 0:f269e3021894 209 __IO uint32_t PIO0_9; /*!< (@ 0x40044034) I/O configuration for pin PIO0_9 */
elessair 0:f269e3021894 210 __IO uint32_t PIO0_8; /*!< (@ 0x40044038) I/O configuration for pin PIO0_8 */
elessair 0:f269e3021894 211 __IO uint32_t PIO0_7; /*!< (@ 0x4004403C) I/O configuration for pin PIO0_7 */
elessair 0:f269e3021894 212 __IO uint32_t PIO0_6; /*!< (@ 0x40044040) I/O configuration for pin PIO0_6 */
elessair 0:f269e3021894 213 __IO uint32_t PIO0_0; /*!< (@ 0x40044044) I/O configuration for pin PIO0_0 */
elessair 0:f269e3021894 214 __IO uint32_t PIO0_14; /*!< (@ 0x40044048) I/O configuration for pin PIO0_14 */
elessair 0:f269e3021894 215 } LPC_IOCON_TypeDef;
elessair 0:f269e3021894 216 /*@}*/ /* end of group LPC8xx_IOCON */
elessair 0:f269e3021894 217
elessair 0:f269e3021894 218 /**
elessair 0:f269e3021894 219 * @brief Product name title=UM10462 Chapter title=LPC8xx Flash programming firmware Major revision=0 Minor revision=3 (FLASHCTRL)
elessair 0:f269e3021894 220 */
elessair 0:f269e3021894 221 typedef struct { /*!< (@ 0x40040000) FLASHCTRL Structure */
elessair 0:f269e3021894 222 __I uint32_t RESERVED0[4];
elessair 0:f269e3021894 223 __IO uint32_t FLASHCFG; /*!< (@ 0x40040010) Flash configuration register */
elessair 0:f269e3021894 224 __I uint32_t RESERVED1[3];
elessair 0:f269e3021894 225 __IO uint32_t FMSSTART; /*!< (@ 0x40040020) Signature start address register */
elessair 0:f269e3021894 226 __IO uint32_t FMSSTOP; /*!< (@ 0x40040024) Signature stop-address register */
elessair 0:f269e3021894 227 __I uint32_t RESERVED2;
elessair 0:f269e3021894 228 __I uint32_t FMSW0;
elessair 0:f269e3021894 229 } LPC_FLASHCTRL_TypeDef;
elessair 0:f269e3021894 230 /*@}*/ /* end of group LPC8xx_FLASHCTRL */
elessair 0:f269e3021894 231
elessair 0:f269e3021894 232
elessair 0:f269e3021894 233 /*------------- Power Management Unit (PMU) --------------------------*/
elessair 0:f269e3021894 234 /** @addtogroup LPC8xx_PMU LPC8xx Power Management Unit
elessair 0:f269e3021894 235 @{
elessair 0:f269e3021894 236 */
elessair 0:f269e3021894 237 typedef struct
elessair 0:f269e3021894 238 {
elessair 0:f269e3021894 239 __IO uint32_t PCON; /*!< Offset: 0x000 Power control Register (R/W) */
elessair 0:f269e3021894 240 __IO uint32_t GPREG0; /*!< Offset: 0x004 General purpose Register 0 (R/W) */
elessair 0:f269e3021894 241 __IO uint32_t GPREG1; /*!< Offset: 0x008 General purpose Register 1 (R/W) */
elessair 0:f269e3021894 242 __IO uint32_t GPREG2; /*!< Offset: 0x00C General purpose Register 2 (R/W) */
elessair 0:f269e3021894 243 __IO uint32_t GPREG3; /*!< Offset: 0x010 General purpose Register 3 (R/W) */
elessair 0:f269e3021894 244 __IO uint32_t DPDCTRL; /*!< Offset: 0x014 Deep power-down control register (R/W) */
elessair 0:f269e3021894 245 } LPC_PMU_TypeDef;
elessair 0:f269e3021894 246 /*@}*/ /* end of group LPC8xx_PMU */
elessair 0:f269e3021894 247
elessair 0:f269e3021894 248
elessair 0:f269e3021894 249 /*------------- Switch Matrix Port --------------------------*/
elessair 0:f269e3021894 250 /** @addtogroup LPC8xx_SWM LPC8xx Switch Matrix Port
elessair 0:f269e3021894 251 @{
elessair 0:f269e3021894 252 */
elessair 0:f269e3021894 253 typedef struct
elessair 0:f269e3021894 254 {
elessair 0:f269e3021894 255 union {
elessair 0:f269e3021894 256 __IO uint32_t PINASSIGN[9];
elessair 0:f269e3021894 257 struct {
elessair 0:f269e3021894 258 __IO uint32_t PINASSIGN0;
elessair 0:f269e3021894 259 __IO uint32_t PINASSIGN1;
elessair 0:f269e3021894 260 __IO uint32_t PINASSIGN2;
elessair 0:f269e3021894 261 __IO uint32_t PINASSIGN3;
elessair 0:f269e3021894 262 __IO uint32_t PINASSIGN4;
elessair 0:f269e3021894 263 __IO uint32_t PINASSIGN5;
elessair 0:f269e3021894 264 __IO uint32_t PINASSIGN6;
elessair 0:f269e3021894 265 __IO uint32_t PINASSIGN7;
elessair 0:f269e3021894 266 __IO uint32_t PINASSIGN8;
elessair 0:f269e3021894 267 };
elessair 0:f269e3021894 268 };
elessair 0:f269e3021894 269 __I uint32_t RESERVED0[103];
elessair 0:f269e3021894 270 __IO uint32_t PINENABLE0;
elessair 0:f269e3021894 271 } LPC_SWM_TypeDef;
elessair 0:f269e3021894 272 /*@}*/ /* end of group LPC8xx_SWM */
elessair 0:f269e3021894 273
elessair 0:f269e3021894 274
elessair 0:f269e3021894 275 // ------------------------------------------------------------------------------------------------
elessair 0:f269e3021894 276 // ----- GPIO_PORT -----
elessair 0:f269e3021894 277 // ------------------------------------------------------------------------------------------------
elessair 0:f269e3021894 278
elessair 0:f269e3021894 279 /**
elessair 0:f269e3021894 280 * @brief Product name title=UM10462 Chapter title=LPC8xx GPIO Modification date=3/17/2011 Major revision=0 Minor revision=3 (GPIO_PORT)
elessair 0:f269e3021894 281 */
elessair 0:f269e3021894 282
elessair 0:f269e3021894 283 typedef struct {
elessair 0:f269e3021894 284 __IO uint8_t B0[18]; /*!< (@ 0xA0000000) Byte pin registers port 0 */
elessair 0:f269e3021894 285 __I uint16_t RESERVED0[2039];
elessair 0:f269e3021894 286 __IO uint32_t W0[18]; /*!< (@ 0xA0001000) Word pin registers port 0 */
elessair 0:f269e3021894 287 uint32_t RESERVED1[1006];
elessair 0:f269e3021894 288 __IO uint32_t DIR0; /* 0x2000 */
elessair 0:f269e3021894 289 uint32_t RESERVED2[31];
elessair 0:f269e3021894 290 __IO uint32_t MASK0; /* 0x2080 */
elessair 0:f269e3021894 291 uint32_t RESERVED3[31];
elessair 0:f269e3021894 292 __IO uint32_t PIN0; /* 0x2100 */
elessair 0:f269e3021894 293 uint32_t RESERVED4[31];
elessair 0:f269e3021894 294 __IO uint32_t MPIN0; /* 0x2180 */
elessair 0:f269e3021894 295 uint32_t RESERVED5[31];
elessair 0:f269e3021894 296 __IO uint32_t SET0; /* 0x2200 */
elessair 0:f269e3021894 297 uint32_t RESERVED6[31];
elessair 0:f269e3021894 298 __O uint32_t CLR0; /* 0x2280 */
elessair 0:f269e3021894 299 uint32_t RESERVED7[31];
elessair 0:f269e3021894 300 __O uint32_t NOT0; /* 0x2300 */
elessair 0:f269e3021894 301
elessair 0:f269e3021894 302 } LPC_GPIO_PORT_TypeDef;
elessair 0:f269e3021894 303
elessair 0:f269e3021894 304
elessair 0:f269e3021894 305 // ------------------------------------------------------------------------------------------------
elessair 0:f269e3021894 306 // ----- PIN_INT -----
elessair 0:f269e3021894 307 // ------------------------------------------------------------------------------------------------
elessair 0:f269e3021894 308
elessair 0:f269e3021894 309 /**
elessair 0:f269e3021894 310 * @brief Product name title=UM10462 Chapter title=LPC8xx GPIO Modification date=3/17/2011 Major revision=0 Minor revision=3 (PIN_INT)
elessair 0:f269e3021894 311 */
elessair 0:f269e3021894 312
elessair 0:f269e3021894 313 typedef struct { /*!< (@ 0xA0004000) PIN_INT Structure */
elessair 0:f269e3021894 314 __IO uint32_t ISEL; /*!< (@ 0xA0004000) Pin Interrupt Mode register */
elessair 0:f269e3021894 315 __IO uint32_t IENR; /*!< (@ 0xA0004004) Pin Interrupt Enable (Rising) register */
elessair 0:f269e3021894 316 __IO uint32_t SIENR; /*!< (@ 0xA0004008) Set Pin Interrupt Enable (Rising) register */
elessair 0:f269e3021894 317 __IO uint32_t CIENR; /*!< (@ 0xA000400C) Clear Pin Interrupt Enable (Rising) register */
elessair 0:f269e3021894 318 __IO uint32_t IENF; /*!< (@ 0xA0004010) Pin Interrupt Enable Falling Edge / Active Level register */
elessair 0:f269e3021894 319 __IO uint32_t SIENF; /*!< (@ 0xA0004014) Set Pin Interrupt Enable Falling Edge / Active Level register */
elessair 0:f269e3021894 320 __IO uint32_t CIENF; /*!< (@ 0xA0004018) Clear Pin Interrupt Enable Falling Edge / Active Level address */
elessair 0:f269e3021894 321 __IO uint32_t RISE; /*!< (@ 0xA000401C) Pin Interrupt Rising Edge register */
elessair 0:f269e3021894 322 __IO uint32_t FALL; /*!< (@ 0xA0004020) Pin Interrupt Falling Edge register */
elessair 0:f269e3021894 323 __IO uint32_t IST; /*!< (@ 0xA0004024) Pin Interrupt Status register */
elessair 0:f269e3021894 324 __IO uint32_t PMCTRL; /*!< (@ 0xA0004028) GPIO pattern match interrupt control register */
elessair 0:f269e3021894 325 __IO uint32_t PMSRC; /*!< (@ 0xA000402C) GPIO pattern match interrupt bit-slice source register */
elessair 0:f269e3021894 326 __IO uint32_t PMCFG; /*!< (@ 0xA0004030) GPIO pattern match interrupt bit slice configuration register */
elessair 0:f269e3021894 327 } LPC_PIN_INT_TypeDef;
elessair 0:f269e3021894 328
elessair 0:f269e3021894 329
elessair 0:f269e3021894 330 /*------------- CRC Engine (CRC) -----------------------------------------*/
elessair 0:f269e3021894 331 /** @addtogroup LPC8xx_CRC
elessair 0:f269e3021894 332 @{
elessair 0:f269e3021894 333 */
elessair 0:f269e3021894 334 typedef struct
elessair 0:f269e3021894 335 {
elessair 0:f269e3021894 336 __IO uint32_t MODE;
elessair 0:f269e3021894 337 __IO uint32_t SEED;
elessair 0:f269e3021894 338 union {
elessair 0:f269e3021894 339 __I uint32_t SUM;
elessair 0:f269e3021894 340 __O uint32_t WR_DATA_DWORD;
elessair 0:f269e3021894 341 __O uint16_t WR_DATA_WORD;
elessair 0:f269e3021894 342 uint16_t RESERVED_WORD;
elessair 0:f269e3021894 343 __O uint8_t WR_DATA_BYTE;
elessair 0:f269e3021894 344 uint8_t RESERVED_BYTE[3];
elessair 0:f269e3021894 345 };
elessair 0:f269e3021894 346 } LPC_CRC_TypeDef;
elessair 0:f269e3021894 347 /*@}*/ /* end of group LPC8xx_CRC */
elessair 0:f269e3021894 348
elessair 0:f269e3021894 349 /*------------- Comparator (CMP) --------------------------------------------------*/
elessair 0:f269e3021894 350 /** @addtogroup LPC8xx_CMP LPC8xx Comparator
elessair 0:f269e3021894 351 @{
elessair 0:f269e3021894 352 */
elessair 0:f269e3021894 353 typedef struct { /*!< (@ 0x40024000) CMP Structure */
elessair 0:f269e3021894 354 __IO uint32_t CTRL; /*!< (@ 0x40024000) Comparator control register */
elessair 0:f269e3021894 355 __IO uint32_t LAD; /*!< (@ 0x40024004) Voltage ladder register */
elessair 0:f269e3021894 356 } LPC_CMP_TypeDef;
elessair 0:f269e3021894 357 /*@}*/ /* end of group LPC8xx_CMP */
elessair 0:f269e3021894 358
elessair 0:f269e3021894 359
elessair 0:f269e3021894 360 /*------------- Wakeup Timer (WKT) --------------------------------------------------*/
elessair 0:f269e3021894 361 /** @addtogroup LPC8xx_WKT
elessair 0:f269e3021894 362 @{
elessair 0:f269e3021894 363 */
elessair 0:f269e3021894 364 typedef struct { /*!< (@ 0x40028000) WKT Structure */
elessair 0:f269e3021894 365 __IO uint32_t CTRL; /*!< (@ 0x40028000) Alarm/Wakeup Timer Control register */
elessair 0:f269e3021894 366 uint32_t Reserved[2];
elessair 0:f269e3021894 367 __IO uint32_t COUNT; /*!< (@ 0x4002800C) Alarm/Wakeup TImer counter register */
elessair 0:f269e3021894 368 } LPC_WKT_TypeDef;
elessair 0:f269e3021894 369 /*@}*/ /* end of group LPC8xx_WKT */
elessair 0:f269e3021894 370
elessair 0:f269e3021894 371 /*------------- Multi-Rate Timer(MRT) --------------------------------------------------*/
elessair 0:f269e3021894 372 //New, Copied from lpc824
elessair 0:f269e3021894 373 /**
elessair 0:f269e3021894 374 * @brief Multi-Rate Timer (MRT) (MRT)
elessair 0:f269e3021894 375 */
elessair 0:f269e3021894 376 typedef struct { /*!< (@ 0x40004000) MRT Structure */
elessair 0:f269e3021894 377 __IO uint32_t INTVAL0; /*!< (@ 0x40004000) MRT0 Time interval value register. This value
elessair 0:f269e3021894 378 is loaded into the TIMER0 register. */
elessair 0:f269e3021894 379 __I uint32_t TIMER0; /*!< (@ 0x40004004) MRT0 Timer register. This register reads the
elessair 0:f269e3021894 380 value of the down-counter. */
elessair 0:f269e3021894 381 __IO uint32_t CTRL0; /*!< (@ 0x40004008) MRT0 Control register. This register controls
elessair 0:f269e3021894 382 the MRT0 modes. */
elessair 0:f269e3021894 383 __IO uint32_t STAT0; /*!< (@ 0x4000400C) MRT0 Status register. */
elessair 0:f269e3021894 384 __IO uint32_t INTVAL1; /*!< (@ 0x40004010) MRT0 Time interval value register. This value
elessair 0:f269e3021894 385 is loaded into the TIMER0 register. */
elessair 0:f269e3021894 386 __I uint32_t TIMER1; /*!< (@ 0x40004014) MRT0 Timer register. This register reads the
elessair 0:f269e3021894 387 value of the down-counter. */
elessair 0:f269e3021894 388 __IO uint32_t CTRL1; /*!< (@ 0x40004018) MRT0 Control register. This register controls
elessair 0:f269e3021894 389 the MRT0 modes. */
elessair 0:f269e3021894 390 __IO uint32_t STAT1; /*!< (@ 0x4000401C) MRT0 Status register. */
elessair 0:f269e3021894 391 __IO uint32_t INTVAL2; /*!< (@ 0x40004020) MRT0 Time interval value register. This value
elessair 0:f269e3021894 392 is loaded into the TIMER0 register. */
elessair 0:f269e3021894 393 __I uint32_t TIMER2; /*!< (@ 0x40004024) MRT0 Timer register. This register reads the
elessair 0:f269e3021894 394 value of the down-counter. */
elessair 0:f269e3021894 395 __IO uint32_t CTRL2; /*!< (@ 0x40004028) MRT0 Control register. This register controls
elessair 0:f269e3021894 396 the MRT0 modes. */
elessair 0:f269e3021894 397 __IO uint32_t STAT2; /*!< (@ 0x4000402C) MRT0 Status register. */
elessair 0:f269e3021894 398 __IO uint32_t INTVAL3; /*!< (@ 0x40004030) MRT0 Time interval value register. This value
elessair 0:f269e3021894 399 is loaded into the TIMER0 register. */
elessair 0:f269e3021894 400 __I uint32_t TIMER3; /*!< (@ 0x40004034) MRT0 Timer register. This register reads the
elessair 0:f269e3021894 401 value of the down-counter. */
elessair 0:f269e3021894 402 __IO uint32_t CTRL3; /*!< (@ 0x40004038) MRT0 Control register. This register controls
elessair 0:f269e3021894 403 the MRT0 modes. */
elessair 0:f269e3021894 404 __IO uint32_t STAT3; /*!< (@ 0x4000403C) MRT0 Status register. */
elessair 0:f269e3021894 405 __I uint32_t RESERVED0[45];
elessair 0:f269e3021894 406 __I uint32_t IDLE_CH; /*!< (@ 0x400040F4) Idle channel register. This register returns
elessair 0:f269e3021894 407 the number of the first idle channel. */
elessair 0:f269e3021894 408 __IO uint32_t IRQ_FLAG; /*!< (@ 0x400040F8) Global interrupt flag register */
elessair 0:f269e3021894 409 } LPC_MRT_TypeDef;
elessair 0:f269e3021894 410
elessair 0:f269e3021894 411 /*------------- Universal Asynchronous Receiver Transmitter (USART) -----------*/
elessair 0:f269e3021894 412 /** @addtogroup LPC8xx_UART LPC8xx Universal Asynchronous Receiver/Transmitter
elessair 0:f269e3021894 413 @{
elessair 0:f269e3021894 414 */
elessair 0:f269e3021894 415 /**
elessair 0:f269e3021894 416 * @brief Product name title=LPC8xx MCU Chapter title=USART Modification date=4/18/2012 Major revision=0 Minor revision=9 (USART)
elessair 0:f269e3021894 417 */
elessair 0:f269e3021894 418 typedef struct
elessair 0:f269e3021894 419 {
elessair 0:f269e3021894 420 __IO uint32_t CFG; /* 0x00 */
elessair 0:f269e3021894 421 __IO uint32_t CTRL;
elessair 0:f269e3021894 422 __IO uint32_t STAT;
elessair 0:f269e3021894 423 __IO uint32_t INTENSET;
elessair 0:f269e3021894 424 __O uint32_t INTENCLR; /* 0x10 */
elessair 0:f269e3021894 425 __I uint32_t RXDATA;
elessair 0:f269e3021894 426 __I uint32_t RXDATA_STAT;
elessair 0:f269e3021894 427 __IO uint32_t TXDATA;
elessair 0:f269e3021894 428 __IO uint32_t BRG; /* 0x20 */
elessair 0:f269e3021894 429 __IO uint32_t INTSTAT;
elessair 0:f269e3021894 430 } LPC_USART_TypeDef;
elessair 0:f269e3021894 431
elessair 0:f269e3021894 432 /*@}*/ /* end of group LPC8xx_USART */
elessair 0:f269e3021894 433
elessair 0:f269e3021894 434
elessair 0:f269e3021894 435 /*------------- Synchronous Serial Interface Controller (SPI) -----------------------*/
elessair 0:f269e3021894 436 /** @addtogroup LPC8xx_SPI LPC8xx Synchronous Serial Port
elessair 0:f269e3021894 437 @{
elessair 0:f269e3021894 438 */
elessair 0:f269e3021894 439 typedef struct
elessair 0:f269e3021894 440 {
elessair 0:f269e3021894 441 __IO uint32_t CFG; /* 0x00 */
elessair 0:f269e3021894 442 __IO uint32_t DLY;
elessair 0:f269e3021894 443 __IO uint32_t STAT;
elessair 0:f269e3021894 444 __IO uint32_t INTENSET;
elessair 0:f269e3021894 445 __O uint32_t INTENCLR; /* 0x10 */
elessair 0:f269e3021894 446 __I uint32_t RXDAT;
elessair 0:f269e3021894 447 __IO uint32_t TXDATCTL;
elessair 0:f269e3021894 448 __IO uint32_t TXDAT;
elessair 0:f269e3021894 449 __IO uint32_t TXCTRL; /* 0x20 */
elessair 0:f269e3021894 450 __IO uint32_t DIV;
elessair 0:f269e3021894 451 __I uint32_t INTSTAT;
elessair 0:f269e3021894 452 } LPC_SPI_TypeDef;
elessair 0:f269e3021894 453 /*@}*/ /* end of group LPC8xx_SPI */
elessair 0:f269e3021894 454
elessair 0:f269e3021894 455
elessair 0:f269e3021894 456 /*------------- Inter-Integrated Circuit (I2C) -------------------------------*/
elessair 0:f269e3021894 457 /** @addtogroup LPC8xx_I2C I2C-Bus Interface
elessair 0:f269e3021894 458 @{
elessair 0:f269e3021894 459 */
elessair 0:f269e3021894 460 typedef struct
elessair 0:f269e3021894 461 {
elessair 0:f269e3021894 462 __IO uint32_t CFG; /* 0x00 */
elessair 0:f269e3021894 463 __IO uint32_t STAT;
elessair 0:f269e3021894 464 __IO uint32_t INTENSET;
elessair 0:f269e3021894 465 __O uint32_t INTENCLR;
elessair 0:f269e3021894 466 __IO uint32_t TIMEOUT; /* 0x10 */
elessair 0:f269e3021894 467 __IO uint32_t DIV;
elessair 0:f269e3021894 468 __IO uint32_t INTSTAT;
elessair 0:f269e3021894 469 uint32_t Reserved0[1];
elessair 0:f269e3021894 470 __IO uint32_t MSTCTL; /* 0x20 */
elessair 0:f269e3021894 471 __IO uint32_t MSTTIME;
elessair 0:f269e3021894 472 __IO uint32_t MSTDAT;
elessair 0:f269e3021894 473 uint32_t Reserved1[5];
elessair 0:f269e3021894 474 __IO uint32_t SLVCTL; /* 0x40 */
elessair 0:f269e3021894 475 __IO uint32_t SLVDAT;
elessair 0:f269e3021894 476 __IO uint32_t SLVADR0;
elessair 0:f269e3021894 477 __IO uint32_t SLVADR1;
elessair 0:f269e3021894 478 __IO uint32_t SLVADR2; /* 0x50 */
elessair 0:f269e3021894 479 __IO uint32_t SLVADR3;
elessair 0:f269e3021894 480 __IO uint32_t SLVQUAL0;
elessair 0:f269e3021894 481 uint32_t Reserved2[9];
elessair 0:f269e3021894 482 __I uint32_t MONRXDAT; /* 0x80 */
elessair 0:f269e3021894 483 } LPC_I2C_TypeDef;
elessair 0:f269e3021894 484
elessair 0:f269e3021894 485 /*@}*/ /* end of group LPC8xx_I2C */
elessair 0:f269e3021894 486
elessair 0:f269e3021894 487 /**
elessair 0:f269e3021894 488 * @brief State Configurable Timer (SCT) (SCT)
elessair 0:f269e3021894 489 */
elessair 0:f269e3021894 490
elessair 0:f269e3021894 491 /**
elessair 0:f269e3021894 492 * @brief Product name title=UM10430 Chapter title=LPC8xx State Configurable Timer (SCT) Modification date=1/18/2011 Major revision=0 Minor revision=7 (SCT)
elessair 0:f269e3021894 493 */
elessair 0:f269e3021894 494
elessair 0:f269e3021894 495 #define CONFIG_SCT_nEV (6) /* Number of events */
elessair 0:f269e3021894 496 #define CONFIG_SCT_nRG (5) /* Number of match/compare registers */
elessair 0:f269e3021894 497 #define CONFIG_SCT_nOU (4) /* Number of outputs */
elessair 0:f269e3021894 498
elessair 0:f269e3021894 499 typedef struct
elessair 0:f269e3021894 500 {
elessair 0:f269e3021894 501 __IO uint32_t CONFIG; /* 0x000 Configuration Register */
elessair 0:f269e3021894 502 union {
elessair 0:f269e3021894 503 __IO uint32_t CTRL_U; /* 0x004 Control Register */
elessair 0:f269e3021894 504 struct {
elessair 0:f269e3021894 505 __IO uint16_t CTRL_L; /* 0x004 low control register */
elessair 0:f269e3021894 506 __IO uint16_t CTRL_H; /* 0x006 high control register */
elessair 0:f269e3021894 507 };
elessair 0:f269e3021894 508 };
elessair 0:f269e3021894 509 __IO uint16_t LIMIT_L; /* 0x008 limit register for counter L */
elessair 0:f269e3021894 510 __IO uint16_t LIMIT_H; /* 0x00A limit register for counter H */
elessair 0:f269e3021894 511 __IO uint16_t HALT_L; /* 0x00C halt register for counter L */
elessair 0:f269e3021894 512 __IO uint16_t HALT_H; /* 0x00E halt register for counter H */
elessair 0:f269e3021894 513 __IO uint16_t STOP_L; /* 0x010 stop register for counter L */
elessair 0:f269e3021894 514 __IO uint16_t STOP_H; /* 0x012 stop register for counter H */
elessair 0:f269e3021894 515 __IO uint16_t START_L; /* 0x014 start register for counter L */
elessair 0:f269e3021894 516 __IO uint16_t START_H; /* 0x016 start register for counter H */
elessair 0:f269e3021894 517 uint32_t RESERVED1[10]; /* 0x018-0x03C reserved */
elessair 0:f269e3021894 518 union {
elessair 0:f269e3021894 519 __IO uint32_t COUNT_U; /* 0x040 counter register */
elessair 0:f269e3021894 520 struct {
elessair 0:f269e3021894 521 __IO uint16_t COUNT_L; /* 0x040 counter register for counter L */
elessair 0:f269e3021894 522 __IO uint16_t COUNT_H; /* 0x042 counter register for counter H */
elessair 0:f269e3021894 523 };
elessair 0:f269e3021894 524 };
elessair 0:f269e3021894 525 __IO uint16_t STATE_L; /* 0x044 state register for counter L */
elessair 0:f269e3021894 526 __IO uint16_t STATE_H; /* 0x046 state register for counter H */
elessair 0:f269e3021894 527 __I uint32_t INPUT; /* 0x048 input register */
elessair 0:f269e3021894 528 __IO uint16_t REGMODE_L; /* 0x04C match - capture registers mode register L */
elessair 0:f269e3021894 529 __IO uint16_t REGMODE_H; /* 0x04E match - capture registers mode register H */
elessair 0:f269e3021894 530 __IO uint32_t OUTPUT; /* 0x050 output register */
elessair 0:f269e3021894 531 __IO uint32_t OUTPUTDIRCTRL; /* 0x054 Output counter direction Control Register */
elessair 0:f269e3021894 532 __IO uint32_t RES; /* 0x058 conflict resolution register */
elessair 0:f269e3021894 533 uint32_t RESERVED2[37]; /* 0x05C-0x0EC reserved */
elessair 0:f269e3021894 534 __IO uint32_t EVEN; /* 0x0F0 event enable register */
elessair 0:f269e3021894 535 __IO uint32_t EVFLAG; /* 0x0F4 event flag register */
elessair 0:f269e3021894 536 __IO uint32_t CONEN; /* 0x0F8 conflict enable register */
elessair 0:f269e3021894 537 __IO uint32_t CONFLAG; /* 0x0FC conflict flag register */
elessair 0:f269e3021894 538
elessair 0:f269e3021894 539 union {
elessair 0:f269e3021894 540 __IO union { /* 0x100-... Match / Capture value */
elessair 0:f269e3021894 541 uint32_t U; /* SCTMATCH[i].U Unified 32-bit register */
elessair 0:f269e3021894 542 struct {
elessair 0:f269e3021894 543 uint16_t L; /* SCTMATCH[i].L Access to L value */
elessair 0:f269e3021894 544 uint16_t H; /* SCTMATCH[i].H Access to H value */
elessair 0:f269e3021894 545 };
elessair 0:f269e3021894 546 } MATCH[CONFIG_SCT_nRG];
elessair 0:f269e3021894 547 __I union {
elessair 0:f269e3021894 548 uint32_t U; /* SCTCAP[i].U Unified 32-bit register */
elessair 0:f269e3021894 549 struct {
elessair 0:f269e3021894 550 uint16_t L; /* SCTCAP[i].L Access to H value */
elessair 0:f269e3021894 551 uint16_t H; /* SCTCAP[i].H Access to H value */
elessair 0:f269e3021894 552 };
elessair 0:f269e3021894 553 } CAP[CONFIG_SCT_nRG];
elessair 0:f269e3021894 554 };
elessair 0:f269e3021894 555
elessair 0:f269e3021894 556
elessair 0:f269e3021894 557 uint32_t RESERVED3[32-CONFIG_SCT_nRG]; /* ...-0x17C reserved */
elessair 0:f269e3021894 558
elessair 0:f269e3021894 559 union {
elessair 0:f269e3021894 560 __IO uint16_t MATCH_L[CONFIG_SCT_nRG]; /* 0x180-... Match Value L counter */
elessair 0:f269e3021894 561 __I uint16_t CAP_L[CONFIG_SCT_nRG]; /* 0x180-... Capture Value L counter */
elessair 0:f269e3021894 562 };
elessair 0:f269e3021894 563 uint16_t RESERVED4[32-CONFIG_SCT_nRG]; /* ...-0x1BE reserved */
elessair 0:f269e3021894 564 union {
elessair 0:f269e3021894 565 __IO uint16_t MATCH_H[CONFIG_SCT_nRG]; /* 0x1C0-... Match Value H counter */
elessair 0:f269e3021894 566 __I uint16_t CAP_H[CONFIG_SCT_nRG]; /* 0x1C0-... Capture Value H counter */
elessair 0:f269e3021894 567 };
elessair 0:f269e3021894 568
elessair 0:f269e3021894 569 uint16_t RESERVED5[32-CONFIG_SCT_nRG]; /* ...-0x1FE reserved */
elessair 0:f269e3021894 570
elessair 0:f269e3021894 571
elessair 0:f269e3021894 572 union {
elessair 0:f269e3021894 573 __IO union { /* 0x200-... Match Reload / Capture Control value */
elessair 0:f269e3021894 574 uint32_t U; /* SCTMATCHREL[i].U Unified 32-bit register */
elessair 0:f269e3021894 575 struct {
elessair 0:f269e3021894 576 uint16_t L; /* SCTMATCHREL[i].L Access to L value */
elessair 0:f269e3021894 577 uint16_t H; /* SCTMATCHREL[i].H Access to H value */
elessair 0:f269e3021894 578 };
elessair 0:f269e3021894 579 } MATCHREL[CONFIG_SCT_nRG];
elessair 0:f269e3021894 580 __IO union {
elessair 0:f269e3021894 581 uint32_t U; /* SCTCAPCTRL[i].U Unified 32-bit register */
elessair 0:f269e3021894 582 struct {
elessair 0:f269e3021894 583 uint16_t L; /* SCTCAPCTRL[i].L Access to H value */
elessair 0:f269e3021894 584 uint16_t H; /* SCTCAPCTRL[i].H Access to H value */
elessair 0:f269e3021894 585 };
elessair 0:f269e3021894 586 } CAPCTRL[CONFIG_SCT_nRG];
elessair 0:f269e3021894 587 };
elessair 0:f269e3021894 588
elessair 0:f269e3021894 589 uint32_t RESERVED6[32-CONFIG_SCT_nRG]; /* ...-0x27C reserved */
elessair 0:f269e3021894 590
elessair 0:f269e3021894 591 union {
elessair 0:f269e3021894 592 __IO uint16_t MATCHREL_L[CONFIG_SCT_nRG]; /* 0x280-... Match Reload value L counter */
elessair 0:f269e3021894 593 __IO uint16_t CAPCTRL_L[CONFIG_SCT_nRG]; /* 0x280-... Capture Control value L counter */
elessair 0:f269e3021894 594 };
elessair 0:f269e3021894 595 uint16_t RESERVED7[32-CONFIG_SCT_nRG]; /* ...-0x2BE reserved */
elessair 0:f269e3021894 596 union {
elessair 0:f269e3021894 597 __IO uint16_t MATCHREL_H[CONFIG_SCT_nRG]; /* 0x2C0-... Match Reload value H counter */
elessair 0:f269e3021894 598 __IO uint16_t CAPCTRL_H[CONFIG_SCT_nRG]; /* 0x2C0-... Capture Control value H counter */
elessair 0:f269e3021894 599 };
elessair 0:f269e3021894 600 uint16_t RESERVED8[32-CONFIG_SCT_nRG]; /* ...-0x2FE reserved */
elessair 0:f269e3021894 601
elessair 0:f269e3021894 602 __IO struct { /* 0x300-0x3FC SCTEVENT[i].STATE / SCTEVENT[i].CTRL*/
elessair 0:f269e3021894 603 uint32_t STATE; /* Event State Register */
elessair 0:f269e3021894 604 uint32_t CTRL; /* Event Control Register */
elessair 0:f269e3021894 605 } EVENT[CONFIG_SCT_nEV];
elessair 0:f269e3021894 606
elessair 0:f269e3021894 607 uint32_t RESERVED9[128-2*CONFIG_SCT_nEV]; /* ...-0x4FC reserved */
elessair 0:f269e3021894 608
elessair 0:f269e3021894 609 __IO struct { /* 0x500-0x57C SCTOUT[i].SET / SCTOUT[i].CLR */
elessair 0:f269e3021894 610 uint32_t SET; /* Output n Set Register */
elessair 0:f269e3021894 611 uint32_t CLR; /* Output n Clear Register */
elessair 0:f269e3021894 612 } OUT[CONFIG_SCT_nOU];
elessair 0:f269e3021894 613
elessair 0:f269e3021894 614 uint32_t RESERVED10[191-2*CONFIG_SCT_nOU]; /* ...-0x7F8 reserved */
elessair 0:f269e3021894 615
elessair 0:f269e3021894 616 __I uint32_t MODULECONTENT; /* 0x7FC Module Content */
elessair 0:f269e3021894 617
elessair 0:f269e3021894 618 } LPC_SCT_TypeDef;
elessair 0:f269e3021894 619 /*@}*/ /* end of group LPC8xx_SCT */
elessair 0:f269e3021894 620
elessair 0:f269e3021894 621
elessair 0:f269e3021894 622 /*------------- Watchdog Timer (WWDT) -----------------------------------------*/
elessair 0:f269e3021894 623 /** @addtogroup LPC8xx_WDT LPC8xx WatchDog Timer
elessair 0:f269e3021894 624 @{
elessair 0:f269e3021894 625 */
elessair 0:f269e3021894 626 typedef struct
elessair 0:f269e3021894 627 {
elessair 0:f269e3021894 628 __IO uint32_t MOD; /*!< Offset: 0x000 Watchdog mode register (R/W) */
elessair 0:f269e3021894 629 __IO uint32_t TC; /*!< Offset: 0x004 Watchdog timer constant register (R/W) */
elessair 0:f269e3021894 630 __O uint32_t FEED; /*!< Offset: 0x008 Watchdog feed sequence register (W) */
elessair 0:f269e3021894 631 __I uint32_t TV; /*!< Offset: 0x00C Watchdog timer value register (R) */
elessair 0:f269e3021894 632 uint32_t RESERVED; /*!< Offset: 0x010 RESERVED */
elessair 0:f269e3021894 633 __IO uint32_t WARNINT; /*!< Offset: 0x014 Watchdog timer warning int. register (R/W) */
elessair 0:f269e3021894 634 __IO uint32_t WINDOW; /*!< Offset: 0x018 Watchdog timer window value register (R/W) */
elessair 0:f269e3021894 635 } LPC_WWDT_TypeDef;
elessair 0:f269e3021894 636 /*@}*/ /* end of group LPC8xx_WDT */
elessair 0:f269e3021894 637
elessair 0:f269e3021894 638
elessair 0:f269e3021894 639 #if defined ( __CC_ARM )
elessair 0:f269e3021894 640 #pragma no_anon_unions
elessair 0:f269e3021894 641 #endif
elessair 0:f269e3021894 642
elessair 0:f269e3021894 643 /******************************************************************************/
elessair 0:f269e3021894 644 /* Peripheral memory map */
elessair 0:f269e3021894 645 /******************************************************************************/
elessair 0:f269e3021894 646 /* Base addresses */
elessair 0:f269e3021894 647 #define LPC_FLASH_BASE (0x00000000UL)
elessair 0:f269e3021894 648 #define LPC_RAM_BASE (0x10000000UL)
elessair 0:f269e3021894 649 #define LPC_ROM_BASE (0x1FFF0000UL)
elessair 0:f269e3021894 650 #define LPC_APB0_BASE (0x40000000UL)
elessair 0:f269e3021894 651 #define LPC_AHB_BASE (0x50000000UL)
elessair 0:f269e3021894 652
elessair 0:f269e3021894 653 /* APB0 peripherals */
elessair 0:f269e3021894 654 #define LPC_WWDT_BASE (LPC_APB0_BASE + 0x00000)
elessair 0:f269e3021894 655 #define LPC_MRT_BASE (LPC_APB0_BASE + 0x04000)
elessair 0:f269e3021894 656 #define LPC_WKT_BASE (LPC_APB0_BASE + 0x08000)
elessair 0:f269e3021894 657 #define LPC_SWM_BASE (LPC_APB0_BASE + 0x0C000)
elessair 0:f269e3021894 658 #define LPC_PMU_BASE (LPC_APB0_BASE + 0x20000)
elessair 0:f269e3021894 659 #define LPC_CMP_BASE (LPC_APB0_BASE + 0x24000)
elessair 0:f269e3021894 660
elessair 0:f269e3021894 661 #define LPC_FLASHCTRL_BASE (LPC_APB0_BASE + 0x40000)
elessair 0:f269e3021894 662 #define LPC_IOCON_BASE (LPC_APB0_BASE + 0x44000)
elessair 0:f269e3021894 663 #define LPC_SYSCON_BASE (LPC_APB0_BASE + 0x48000)
elessair 0:f269e3021894 664 #define LPC_I2C_BASE (LPC_APB0_BASE + 0x50000)
elessair 0:f269e3021894 665 #define LPC_SPI0_BASE (LPC_APB0_BASE + 0x58000)
elessair 0:f269e3021894 666 #define LPC_SPI1_BASE (LPC_APB0_BASE + 0x5C000)
elessair 0:f269e3021894 667 #define LPC_USART0_BASE (LPC_APB0_BASE + 0x64000)
elessair 0:f269e3021894 668 #define LPC_USART1_BASE (LPC_APB0_BASE + 0x68000)
elessair 0:f269e3021894 669 #define LPC_USART2_BASE (LPC_APB0_BASE + 0x6C000)
elessair 0:f269e3021894 670
elessair 0:f269e3021894 671 /* AHB peripherals */
elessair 0:f269e3021894 672 #define LPC_CRC_BASE (LPC_AHB_BASE + 0x00000)
elessair 0:f269e3021894 673 #define LPC_SCT_BASE (LPC_AHB_BASE + 0x04000)
elessair 0:f269e3021894 674
elessair 0:f269e3021894 675 #define LPC_GPIO_PORT_BASE (0xA0000000)
elessair 0:f269e3021894 676 #define LPC_PIN_INT_BASE (LPC_GPIO_PORT_BASE + 0x4000)
elessair 0:f269e3021894 677
elessair 0:f269e3021894 678 /******************************************************************************/
elessair 0:f269e3021894 679 /* Peripheral declaration */
elessair 0:f269e3021894 680 /******************************************************************************/
elessair 0:f269e3021894 681 #define LPC_WWDT ((LPC_WWDT_TypeDef *) LPC_WWDT_BASE )
elessair 0:f269e3021894 682 #define LPC_MRT ((LPC_MRT_TypeDef *) LPC_MRT_BASE )
elessair 0:f269e3021894 683
elessair 0:f269e3021894 684
elessair 0:f269e3021894 685 #define LPC_WKT ((LPC_WKT_TypeDef *) LPC_WKT_BASE )
elessair 0:f269e3021894 686 #define LPC_SWM ((LPC_SWM_TypeDef *) LPC_SWM_BASE )
elessair 0:f269e3021894 687 #define LPC_PMU ((LPC_PMU_TypeDef *) LPC_PMU_BASE )
elessair 0:f269e3021894 688 #define LPC_CMP ((LPC_CMP_TypeDef *) LPC_CMP_BASE )
elessair 0:f269e3021894 689
elessair 0:f269e3021894 690 #define LPC_FLASHCTRL ((LPC_FLASHCTRL_TypeDef *) LPC_FLASHCTRL_BASE )
elessair 0:f269e3021894 691 #define LPC_IOCON ((LPC_IOCON_TypeDef *) LPC_IOCON_BASE )
elessair 0:f269e3021894 692 #define LPC_SYSCON ((LPC_SYSCON_TypeDef *) LPC_SYSCON_BASE)
elessair 0:f269e3021894 693 #define LPC_I2C ((LPC_I2C_TypeDef *) LPC_I2C_BASE )
elessair 0:f269e3021894 694 #define LPC_SPI0 ((LPC_SPI_TypeDef *) LPC_SPI0_BASE )
elessair 0:f269e3021894 695 #define LPC_SPI1 ((LPC_SPI_TypeDef *) LPC_SPI1_BASE )
elessair 0:f269e3021894 696 #define LPC_USART0 ((LPC_USART_TypeDef *) LPC_USART0_BASE )
elessair 0:f269e3021894 697 #define LPC_USART1 ((LPC_USART_TypeDef *) LPC_USART1_BASE )
elessair 0:f269e3021894 698 #define LPC_USART2 ((LPC_USART_TypeDef *) LPC_USART2_BASE )
elessair 0:f269e3021894 699
elessair 0:f269e3021894 700 #define LPC_CRC ((LPC_CRC_TypeDef *) LPC_CRC_BASE )
elessair 0:f269e3021894 701 #define LPC_SCT ((LPC_SCT_TypeDef *) LPC_SCT_BASE )
elessair 0:f269e3021894 702
elessair 0:f269e3021894 703 #define LPC_GPIO_PORT ((LPC_GPIO_PORT_TypeDef *) LPC_GPIO_PORT_BASE )
elessair 0:f269e3021894 704 #define LPC_PIN_INT ((LPC_PIN_INT_TypeDef *) LPC_PIN_INT_BASE )
elessair 0:f269e3021894 705
elessair 0:f269e3021894 706 #ifdef __cplusplus
elessair 0:f269e3021894 707 }
elessair 0:f269e3021894 708 #endif
elessair 0:f269e3021894 709
elessair 0:f269e3021894 710 #endif /* __LPC8xx_H__ */