"""Client library types. See LPC17xx CMSIS-Compliant Standard Peripheral
Firmware Driver Library documentation.
"""

from internals import RoboCaller, cstruct

__author__ =			"Neil MacMunn"
__email__ =				"neil@gumstix.com"
__copyright__ = 	"Copyright 2010, Gumstix Inc"
__license__ = 		"BSD 2-Clause"
__version__ =			"0.1"

LPC_AHBRAM0_BASE = (0x2007C000)
LPC_AHBRAM1_BASE = (0x20080000)
LPC_GPIO_BASE = (0x2009C000)
LPC_APB0_BASE = (0x40000000)
LPC_APB1_BASE = (0x40080000)
LPC_AHB_BASE = (0x50000000)
LPC_CM3_BASE = (0xE0000000)
LPC_WDT_BASE = (LPC_APB0_BASE + 0x00000)
LPC_TIM0_BASE = (LPC_APB0_BASE + 0x04000)
LPC_TIM1_BASE = (LPC_APB0_BASE + 0x08000)
LPC_UART0_BASE = (LPC_APB0_BASE + 0x0C000)
LPC_UART1_BASE = (LPC_APB0_BASE + 0x10000)
LPC_PWM1_BASE = (LPC_APB0_BASE + 0x18000)
LPC_I2C0_BASE = (LPC_APB0_BASE + 0x1C000)
LPC_SPI_BASE = (LPC_APB0_BASE + 0x20000)
LPC_RTC_BASE = (LPC_APB0_BASE + 0x24000)
LPC_GPIOINT_BASE = (LPC_APB0_BASE + 0x28080)
LPC_PINCON_BASE = (LPC_APB0_BASE + 0x2C000)
LPC_SSP1_BASE = (LPC_APB0_BASE + 0x30000)
LPC_ADC_BASE = (LPC_APB0_BASE + 0x34000)
LPC_CANAF_RAM_BASE = (LPC_APB0_BASE + 0x38000)
LPC_CANAF_BASE = (LPC_APB0_BASE + 0x3C000)
LPC_CANCR_BASE = (LPC_APB0_BASE + 0x40000)
LPC_CAN1_BASE = (LPC_APB0_BASE + 0x44000)
LPC_CAN2_BASE = (LPC_APB0_BASE + 0x48000)
LPC_I2C1_BASE = (LPC_APB0_BASE + 0x5C000)
LPC_SSP0_BASE = (LPC_APB1_BASE + 0x08000)
LPC_DAC_BASE = (LPC_APB1_BASE + 0x0C000)
LPC_TIM2_BASE = (LPC_APB1_BASE + 0x10000)
LPC_TIM3_BASE = (LPC_APB1_BASE + 0x14000)
LPC_UART2_BASE = (LPC_APB1_BASE + 0x18000)
LPC_UART3_BASE = (LPC_APB1_BASE + 0x1C000)
LPC_I2C2_BASE = (LPC_APB1_BASE + 0x20000)
LPC_I2S_BASE = (LPC_APB1_BASE + 0x28000)
LPC_RIT_BASE = (LPC_APB1_BASE + 0x30000)
LPC_MCPWM_BASE = (LPC_APB1_BASE + 0x38000)
LPC_QEI_BASE = (LPC_APB1_BASE + 0x3C000)
LPC_SC_BASE = (LPC_APB1_BASE + 0x7C000)
LPC_EMAC_BASE = (LPC_AHB_BASE  + 0x00000)
LPC_GPDMA_BASE = (LPC_AHB_BASE  + 0x04000)
LPC_GPDMACH0_BASE = (LPC_AHB_BASE  + 0x04100)
LPC_GPDMACH1_BASE = (LPC_AHB_BASE  + 0x04120)
LPC_GPDMACH2_BASE = (LPC_AHB_BASE  + 0x04140)
LPC_GPDMACH3_BASE = (LPC_AHB_BASE  + 0x04160)
LPC_GPDMACH4_BASE = (LPC_AHB_BASE  + 0x04180)
LPC_GPDMACH5_BASE = (LPC_AHB_BASE  + 0x041A0)
LPC_GPDMACH6_BASE = (LPC_AHB_BASE  + 0x041C0)
LPC_GPDMACH7_BASE = (LPC_AHB_BASE  + 0x041E0)
LPC_USB_BASE = (LPC_AHB_BASE  + 0x0C000)
LPC_GPIO0_BASE = (LPC_GPIO_BASE + 0x00000)
LPC_GPIO1_BASE = (LPC_GPIO_BASE + 0x00020)
LPC_GPIO2_BASE = (LPC_GPIO_BASE + 0x00040)
LPC_GPIO3_BASE = (LPC_GPIO_BASE + 0x00060)
LPC_GPIO4_BASE = (LPC_GPIO_BASE + 0x00080)
LPC_SC = LPC_SC_BASE
LPC_GPIO0 = LPC_GPIO0_BASE
LPC_GPIO1 = LPC_GPIO1_BASE
LPC_GPIO2 = LPC_GPIO2_BASE
LPC_GPIO3 = LPC_GPIO3_BASE
LPC_GPIO4 = LPC_GPIO4_BASE
LPC_WDT = LPC_WDT_BASE
LPC_TIM0 = LPC_TIM0_BASE
LPC_TIM1 = LPC_TIM1_BASE
LPC_TIM2 = LPC_TIM2_BASE
LPC_TIM3 = LPC_TIM3_BASE
LPC_RIT = LPC_RIT_BASE
LPC_UART0 = LPC_UART0_BASE
LPC_UART1 = LPC_UART1_BASE
LPC_UART2 = LPC_UART2_BASE
LPC_UART3 = LPC_UART3_BASE
LPC_PWM1 = LPC_PWM1_BASE
LPC_I2C0 = LPC_I2C0_BASE
LPC_I2C1 = LPC_I2C1_BASE
LPC_I2C2 = LPC_I2C2_BASE
LPC_I2S = LPC_I2S_BASE
LPC_SPI = LPC_SPI_BASE
LPC_RTC = LPC_RTC_BASE
LPC_GPIOINT = LPC_GPIOINT_BASE
LPC_PINCON = LPC_PINCON_BASE
LPC_SSP0 = LPC_SSP0_BASE
LPC_SSP1 = LPC_SSP1_BASE
LPC_ADC = LPC_ADC_BASE
LPC_DAC = LPC_DAC_BASE
LPC_CANAF_RAM = LPC_CANAF_RAM_BASE
LPC_CANAF = LPC_CANAF_BASE
LPC_CANCR = LPC_CANCR_BASE
LPC_CAN1 = LPC_CAN1_BASE
LPC_CAN2 = LPC_CAN2_BASE
LPC_MCPWM = LPC_MCPWM_BASE
LPC_QEI = LPC_QEI_BASE
LPC_EMAC = LPC_EMAC_BASE
LPC_GPDMA = LPC_GPDMA_BASE
DMAREQSEL = 0x4000C1C4
LPC_GPDMACH0 =  LPC_GPDMACH0_BASE
LPC_GPDMACH1 =  LPC_GPDMACH1_BASE
LPC_GPDMACH2 = LPC_GPDMACH2_BASE
LPC_GPDMACH3 =  LPC_GPDMACH3_BASE
LPC_GPDMACH4 =  LPC_GPDMACH4_BASE
LPC_GPDMACH5 =  LPC_GPDMACH5_BASE
LPC_GPDMACH6 =  LPC_GPDMACH6_BASE
LPC_GPDMACH7 =  LPC_GPDMACH7_BASE
LPC_USB =  LPC_USB_BASE


class IRQn_Type:
	NonMaskableInt_IRQn = -14
	MemoryManagement_IRQn = -12
	BusFault_IRQn = -11
	UsageFault_IRQn = -10
	SVCall_IRQn = -5
	DebugMonitor_IRQn = -4
	PendSV_IRQn = -2
	SysTick_IRQn = -1
	WDT_IRQn = 0
	TIMER0_IRQn = 1
	TIMER1_IRQn = 2
	TIMER2_IRQn = 3
	TIMER3_IRQn = 4
	UART0_IRQn = 5
	UART1_IRQn = 6
	UART2_IRQn = 7
	UART3_IRQn = 8
	PWM1_IRQn = 9
	I2C0_IRQn = 10
	I2C1_IRQn = 11
	I2C2_IRQn = 12
	SPI_IRQn = 13
	SSP0_IRQn = 14
	SSP1_IRQn = 15
	PLL0_IRQn = 16
	RTC_IRQn = 17
	EINT0_IRQn = 18
	EINT1_IRQn = 19
	EINT2_IRQn = 20
	EINT3_IRQn = 21
	ADC_IRQn = 22
	BOD_IRQn = 23
	USB_IRQn = 24
	CAN_IRQn = 25
	DMA_IRQn = 26
	I2S_IRQn = 27
	ENET_IRQn = 28
	RIT_IRQn = 29
	MCPWM_IRQn = 30
	QEI_IRQn = 31
	PLL1_IRQn = 32
	USBActivity_IRQn = 33
	CANActivity_IRQn = 34

