Library
Fork of mbed by
PeripheralNames.h@1:b749145a7bb1, 2013-10-04 (annotated)
- Committer:
- itotaka
- Date:
- Fri Oct 04 12:17:02 2013 +0000
- Revision:
- 1:b749145a7bb1
- Parent:
- 0:a8fa94490a0a
changed Max_Arg to 80
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gokmenascioglu | 0:a8fa94490a0a | 1 | /* mbed Microcontroller Library - PeripheralNames |
gokmenascioglu | 0:a8fa94490a0a | 2 | * Copyright (C) 2008-2011 ARM Limited. All rights reserved. |
gokmenascioglu | 0:a8fa94490a0a | 3 | * |
gokmenascioglu | 0:a8fa94490a0a | 4 | * Provides the mappings for peripherals |
gokmenascioglu | 0:a8fa94490a0a | 5 | */ |
gokmenascioglu | 0:a8fa94490a0a | 6 | |
gokmenascioglu | 0:a8fa94490a0a | 7 | #ifndef MBED_PERIPHERALNAMES_H |
gokmenascioglu | 0:a8fa94490a0a | 8 | #define MBED_PERIPHERALNAMES_H |
gokmenascioglu | 0:a8fa94490a0a | 9 | |
gokmenascioglu | 0:a8fa94490a0a | 10 | #include "cmsis.h" |
gokmenascioglu | 0:a8fa94490a0a | 11 | |
gokmenascioglu | 0:a8fa94490a0a | 12 | #ifdef __cplusplus |
gokmenascioglu | 0:a8fa94490a0a | 13 | extern "C" { |
gokmenascioglu | 0:a8fa94490a0a | 14 | #endif |
gokmenascioglu | 0:a8fa94490a0a | 15 | |
gokmenascioglu | 0:a8fa94490a0a | 16 | #if defined(TARGET_LPC1768) || defined(TARGET_LPC2368) |
gokmenascioglu | 0:a8fa94490a0a | 17 | |
gokmenascioglu | 0:a8fa94490a0a | 18 | enum UARTName { |
gokmenascioglu | 0:a8fa94490a0a | 19 | UART_0 = (int)LPC_UART0_BASE |
gokmenascioglu | 0:a8fa94490a0a | 20 | , UART_1 = (int)LPC_UART1_BASE |
gokmenascioglu | 0:a8fa94490a0a | 21 | , UART_2 = (int)LPC_UART2_BASE |
gokmenascioglu | 0:a8fa94490a0a | 22 | , UART_3 = (int)LPC_UART3_BASE |
gokmenascioglu | 0:a8fa94490a0a | 23 | }; |
gokmenascioglu | 0:a8fa94490a0a | 24 | typedef enum UARTName UARTName; |
gokmenascioglu | 0:a8fa94490a0a | 25 | |
gokmenascioglu | 0:a8fa94490a0a | 26 | enum ADCName { |
gokmenascioglu | 0:a8fa94490a0a | 27 | ADC0_0 = 0 |
gokmenascioglu | 0:a8fa94490a0a | 28 | , ADC0_1 |
gokmenascioglu | 0:a8fa94490a0a | 29 | , ADC0_2 |
gokmenascioglu | 0:a8fa94490a0a | 30 | , ADC0_3 |
gokmenascioglu | 0:a8fa94490a0a | 31 | , ADC0_4 |
gokmenascioglu | 0:a8fa94490a0a | 32 | , ADC0_5 |
gokmenascioglu | 0:a8fa94490a0a | 33 | , ADC0_6 |
gokmenascioglu | 0:a8fa94490a0a | 34 | , ADC0_7 |
gokmenascioglu | 0:a8fa94490a0a | 35 | }; |
gokmenascioglu | 0:a8fa94490a0a | 36 | typedef enum ADCName ADCName; |
gokmenascioglu | 0:a8fa94490a0a | 37 | |
gokmenascioglu | 0:a8fa94490a0a | 38 | enum DACName { |
gokmenascioglu | 0:a8fa94490a0a | 39 | DAC_0 = 0 |
gokmenascioglu | 0:a8fa94490a0a | 40 | }; |
gokmenascioglu | 0:a8fa94490a0a | 41 | typedef enum DACName DACName; |
gokmenascioglu | 0:a8fa94490a0a | 42 | |
gokmenascioglu | 0:a8fa94490a0a | 43 | enum SPIName { |
gokmenascioglu | 0:a8fa94490a0a | 44 | SPI_0 = (int)LPC_SSP0_BASE |
gokmenascioglu | 0:a8fa94490a0a | 45 | , SPI_1 = (int)LPC_SSP1_BASE |
gokmenascioglu | 0:a8fa94490a0a | 46 | }; |
gokmenascioglu | 0:a8fa94490a0a | 47 | typedef enum SPIName SPIName; |
gokmenascioglu | 0:a8fa94490a0a | 48 | |
gokmenascioglu | 0:a8fa94490a0a | 49 | enum I2CName { |
gokmenascioglu | 0:a8fa94490a0a | 50 | I2C_0 = (int)LPC_I2C0_BASE |
gokmenascioglu | 0:a8fa94490a0a | 51 | , I2C_1 = (int)LPC_I2C1_BASE |
gokmenascioglu | 0:a8fa94490a0a | 52 | , I2C_2 = (int)LPC_I2C2_BASE |
gokmenascioglu | 0:a8fa94490a0a | 53 | }; |
gokmenascioglu | 0:a8fa94490a0a | 54 | typedef enum I2CName I2CName; |
gokmenascioglu | 0:a8fa94490a0a | 55 | |
gokmenascioglu | 0:a8fa94490a0a | 56 | enum PWMName { |
gokmenascioglu | 0:a8fa94490a0a | 57 | PWM_1 = 1 |
gokmenascioglu | 0:a8fa94490a0a | 58 | , PWM_2 |
gokmenascioglu | 0:a8fa94490a0a | 59 | , PWM_3 |
gokmenascioglu | 0:a8fa94490a0a | 60 | , PWM_4 |
gokmenascioglu | 0:a8fa94490a0a | 61 | , PWM_5 |
gokmenascioglu | 0:a8fa94490a0a | 62 | , PWM_6 |
gokmenascioglu | 0:a8fa94490a0a | 63 | }; |
gokmenascioglu | 0:a8fa94490a0a | 64 | typedef enum PWMName PWMName; |
gokmenascioglu | 0:a8fa94490a0a | 65 | |
gokmenascioglu | 0:a8fa94490a0a | 66 | enum TimerName { |
gokmenascioglu | 0:a8fa94490a0a | 67 | TIMER_0 = (int)LPC_TIM0_BASE |
gokmenascioglu | 0:a8fa94490a0a | 68 | , TIMER_1 = (int)LPC_TIM1_BASE |
gokmenascioglu | 0:a8fa94490a0a | 69 | , TIMER_2 = (int)LPC_TIM2_BASE |
gokmenascioglu | 0:a8fa94490a0a | 70 | , TIMER_3 = (int)LPC_TIM3_BASE |
gokmenascioglu | 0:a8fa94490a0a | 71 | }; |
gokmenascioglu | 0:a8fa94490a0a | 72 | typedef enum TimerName TimerName; |
gokmenascioglu | 0:a8fa94490a0a | 73 | |
gokmenascioglu | 0:a8fa94490a0a | 74 | enum CANName { |
gokmenascioglu | 0:a8fa94490a0a | 75 | CAN_1 = (int)LPC_CAN1_BASE, |
gokmenascioglu | 0:a8fa94490a0a | 76 | CAN_2 = (int)LPC_CAN2_BASE |
gokmenascioglu | 0:a8fa94490a0a | 77 | }; |
gokmenascioglu | 0:a8fa94490a0a | 78 | typedef enum CANName CANName; |
gokmenascioglu | 0:a8fa94490a0a | 79 | |
gokmenascioglu | 0:a8fa94490a0a | 80 | #define US_TICKER_TIMER TIMER_3 |
gokmenascioglu | 0:a8fa94490a0a | 81 | #define US_TICKER_TIMER_IRQn TIMER3_IRQn |
gokmenascioglu | 0:a8fa94490a0a | 82 | |
gokmenascioglu | 0:a8fa94490a0a | 83 | #elif defined(TARGET_LPC11U24) |
gokmenascioglu | 0:a8fa94490a0a | 84 | |
gokmenascioglu | 0:a8fa94490a0a | 85 | enum UARTName { |
gokmenascioglu | 0:a8fa94490a0a | 86 | UART_0 = (int)LPC_USART_BASE |
gokmenascioglu | 0:a8fa94490a0a | 87 | }; |
gokmenascioglu | 0:a8fa94490a0a | 88 | typedef enum UARTName UARTName; |
gokmenascioglu | 0:a8fa94490a0a | 89 | |
gokmenascioglu | 0:a8fa94490a0a | 90 | enum I2CName { |
gokmenascioglu | 0:a8fa94490a0a | 91 | I2C_0 = (int)LPC_I2C_BASE |
gokmenascioglu | 0:a8fa94490a0a | 92 | }; |
gokmenascioglu | 0:a8fa94490a0a | 93 | typedef enum I2CName I2CName; |
gokmenascioglu | 0:a8fa94490a0a | 94 | |
gokmenascioglu | 0:a8fa94490a0a | 95 | enum TimerName { |
gokmenascioglu | 0:a8fa94490a0a | 96 | TIMER_0 = (int)LPC_CT32B0_BASE |
gokmenascioglu | 0:a8fa94490a0a | 97 | , TIMER_1 = (int)LPC_CT32B1_BASE |
gokmenascioglu | 0:a8fa94490a0a | 98 | }; |
gokmenascioglu | 0:a8fa94490a0a | 99 | typedef enum TimerName TimerName; |
gokmenascioglu | 0:a8fa94490a0a | 100 | |
gokmenascioglu | 0:a8fa94490a0a | 101 | enum ADCName { |
gokmenascioglu | 0:a8fa94490a0a | 102 | ADC0_0 = 0 |
gokmenascioglu | 0:a8fa94490a0a | 103 | , ADC0_1 |
gokmenascioglu | 0:a8fa94490a0a | 104 | , ADC0_2 |
gokmenascioglu | 0:a8fa94490a0a | 105 | , ADC0_3 |
gokmenascioglu | 0:a8fa94490a0a | 106 | , ADC0_4 |
gokmenascioglu | 0:a8fa94490a0a | 107 | , ADC0_5 |
gokmenascioglu | 0:a8fa94490a0a | 108 | , ADC0_6 |
gokmenascioglu | 0:a8fa94490a0a | 109 | , ADC0_7 |
gokmenascioglu | 0:a8fa94490a0a | 110 | }; |
gokmenascioglu | 0:a8fa94490a0a | 111 | typedef enum ADCName ADCName; |
gokmenascioglu | 0:a8fa94490a0a | 112 | |
gokmenascioglu | 0:a8fa94490a0a | 113 | enum SPIName { |
gokmenascioglu | 0:a8fa94490a0a | 114 | SPI_0 = (int)LPC_SSP0_BASE |
gokmenascioglu | 0:a8fa94490a0a | 115 | , SPI_1 = (int)LPC_SSP1_BASE |
gokmenascioglu | 0:a8fa94490a0a | 116 | }; |
gokmenascioglu | 0:a8fa94490a0a | 117 | typedef enum SPIName SPIName; |
gokmenascioglu | 0:a8fa94490a0a | 118 | |
gokmenascioglu | 0:a8fa94490a0a | 119 | #define US_TICKER_TIMER TIMER_1 |
gokmenascioglu | 0:a8fa94490a0a | 120 | #define US_TICKER_TIMER_IRQn TIMER_32_1_IRQn |
gokmenascioglu | 0:a8fa94490a0a | 121 | |
gokmenascioglu | 0:a8fa94490a0a | 122 | typedef enum PWMName { |
gokmenascioglu | 0:a8fa94490a0a | 123 | PWM_1 = 0 |
gokmenascioglu | 0:a8fa94490a0a | 124 | , PWM_2 |
gokmenascioglu | 0:a8fa94490a0a | 125 | , PWM_3 |
gokmenascioglu | 0:a8fa94490a0a | 126 | , PWM_4 |
gokmenascioglu | 0:a8fa94490a0a | 127 | , PWM_5 |
gokmenascioglu | 0:a8fa94490a0a | 128 | , PWM_6 |
gokmenascioglu | 0:a8fa94490a0a | 129 | , PWM_7 |
gokmenascioglu | 0:a8fa94490a0a | 130 | , PWM_8 |
gokmenascioglu | 0:a8fa94490a0a | 131 | , PWM_9 |
gokmenascioglu | 0:a8fa94490a0a | 132 | , PWM_10 |
gokmenascioglu | 0:a8fa94490a0a | 133 | , PWM_11 |
gokmenascioglu | 0:a8fa94490a0a | 134 | } PWMName; |
gokmenascioglu | 0:a8fa94490a0a | 135 | |
gokmenascioglu | 0:a8fa94490a0a | 136 | #endif |
gokmenascioglu | 0:a8fa94490a0a | 137 | |
gokmenascioglu | 0:a8fa94490a0a | 138 | #define STDIO_UART_TX USBTX |
gokmenascioglu | 0:a8fa94490a0a | 139 | #define STDIO_UART_RX USBRX |
gokmenascioglu | 0:a8fa94490a0a | 140 | #define STDIO_UART UART_0 |
gokmenascioglu | 0:a8fa94490a0a | 141 | |
gokmenascioglu | 0:a8fa94490a0a | 142 | #ifdef __cplusplus |
gokmenascioglu | 0:a8fa94490a0a | 143 | } |
gokmenascioglu | 0:a8fa94490a0a | 144 | #endif |
gokmenascioglu | 0:a8fa94490a0a | 145 | |
gokmenascioglu | 0:a8fa94490a0a | 146 | #endif |