A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.

Dependencies:   C12832

Committer:
tushki7
Date:
Sun Apr 12 15:45:52 2015 +0000
Revision:
1:eb68c94a8ee5
Parent:
0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;

Who changed what in which revision?

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