mbed-os
Fork of mbed-os by
targets/TARGET_NXP/TARGET_LPC15XX/PinNames.h@1:3deb71413561, 2017-07-20 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
elessair | 0:f269e3021894 | 1 | /* mbed Microcontroller Library |
elessair | 0:f269e3021894 | 2 | * Copyright (c) 2006-2014 ARM Limited |
elessair | 0:f269e3021894 | 3 | * |
elessair | 0:f269e3021894 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
elessair | 0:f269e3021894 | 5 | * you may not use this file except in compliance with the License. |
elessair | 0:f269e3021894 | 6 | * You may obtain a copy of the License at |
elessair | 0:f269e3021894 | 7 | * |
elessair | 0:f269e3021894 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
elessair | 0:f269e3021894 | 9 | * |
elessair | 0:f269e3021894 | 10 | * Unless required by applicable law or agreed to in writing, software |
elessair | 0:f269e3021894 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
elessair | 0:f269e3021894 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
elessair | 0:f269e3021894 | 13 | * See the License for the specific language governing permissions and |
elessair | 0:f269e3021894 | 14 | * limitations under the License. |
elessair | 0:f269e3021894 | 15 | */ |
elessair | 0:f269e3021894 | 16 | #ifndef MBED_PINNAMES_H |
elessair | 0:f269e3021894 | 17 | #define MBED_PINNAMES_H |
elessair | 0:f269e3021894 | 18 | |
elessair | 0:f269e3021894 | 19 | #include "cmsis.h" |
elessair | 0:f269e3021894 | 20 | |
elessair | 0:f269e3021894 | 21 | #ifdef __cplusplus |
elessair | 0:f269e3021894 | 22 | extern "C" { |
elessair | 0:f269e3021894 | 23 | #endif |
elessair | 0:f269e3021894 | 24 | |
elessair | 0:f269e3021894 | 25 | typedef enum { |
elessair | 0:f269e3021894 | 26 | PIN_INPUT, |
elessair | 0:f269e3021894 | 27 | PIN_OUTPUT |
elessair | 0:f269e3021894 | 28 | } PinDirection; |
elessair | 0:f269e3021894 | 29 | |
elessair | 0:f269e3021894 | 30 | typedef enum { |
elessair | 0:f269e3021894 | 31 | // LPC Pin Names |
elessair | 0:f269e3021894 | 32 | P0_0 = 0, |
elessair | 0:f269e3021894 | 33 | P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7, P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15, P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23, P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31, |
elessair | 0:f269e3021894 | 34 | P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7, P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15, P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23, P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31, |
elessair | 0:f269e3021894 | 35 | P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7, P2_8, P2_9, P2_10, P2_11, P2_12, |
elessair | 0:f269e3021894 | 36 | |
elessair | 0:f269e3021894 | 37 | LED_RED = P0_25, |
elessair | 0:f269e3021894 | 38 | LED_GREEN = P0_3, |
elessair | 0:f269e3021894 | 39 | LED_BLUE = P1_1, |
elessair | 0:f269e3021894 | 40 | |
elessair | 0:f269e3021894 | 41 | // mbed original LED naming |
elessair | 0:f269e3021894 | 42 | LED1 = LED_RED, |
elessair | 0:f269e3021894 | 43 | LED2 = LED_GREEN, |
elessair | 0:f269e3021894 | 44 | LED3 = LED_BLUE, |
elessair | 0:f269e3021894 | 45 | LED4 = LED_BLUE, |
elessair | 0:f269e3021894 | 46 | |
elessair | 0:f269e3021894 | 47 | // Serial to USB pins |
elessair | 0:f269e3021894 | 48 | USBTX = P0_18, |
elessair | 0:f269e3021894 | 49 | USBRX = P0_13, |
elessair | 0:f269e3021894 | 50 | |
elessair | 0:f269e3021894 | 51 | // Arduino Shield Receptacles Names |
elessair | 0:f269e3021894 | 52 | D0 = P0_13, |
elessair | 0:f269e3021894 | 53 | D1 = P0_18, |
elessair | 0:f269e3021894 | 54 | D2 = P0_29, |
elessair | 0:f269e3021894 | 55 | D3 = P0_9, |
elessair | 0:f269e3021894 | 56 | D4 = P0_10, |
elessair | 0:f269e3021894 | 57 | D5 = P0_16, // same port as D13 |
elessair | 0:f269e3021894 | 58 | D6 = P1_3, |
elessair | 0:f269e3021894 | 59 | D7 = P0_0, |
elessair | 0:f269e3021894 | 60 | D8 = P0_24, |
elessair | 0:f269e3021894 | 61 | D9 = P1_0, |
elessair | 0:f269e3021894 | 62 | D10= P0_27, |
elessair | 0:f269e3021894 | 63 | D11= P0_28, |
elessair | 0:f269e3021894 | 64 | D12= P0_12, |
elessair | 0:f269e3021894 | 65 | D13= P0_16, // same port as D5 |
elessair | 0:f269e3021894 | 66 | D14= P0_23, |
elessair | 0:f269e3021894 | 67 | D15= P0_22, |
elessair | 0:f269e3021894 | 68 | |
elessair | 0:f269e3021894 | 69 | A0 = P0_8, |
elessair | 0:f269e3021894 | 70 | A1 = P0_7, |
elessair | 0:f269e3021894 | 71 | A2 = P0_6, |
elessair | 0:f269e3021894 | 72 | A3 = P0_5, |
elessair | 0:f269e3021894 | 73 | A4 = P0_23, // same port as SDA |
elessair | 0:f269e3021894 | 74 | A5 = P0_22, // same port as SCL |
elessair | 0:f269e3021894 | 75 | SDA= P0_23, // same port as A4 |
elessair | 0:f269e3021894 | 76 | SCL= P0_22, // same port as A5 |
elessair | 0:f269e3021894 | 77 | |
elessair | 0:f269e3021894 | 78 | // Not connected |
elessair | 0:f269e3021894 | 79 | NC = (int)0xFFFFFFFF, |
elessair | 0:f269e3021894 | 80 | } PinName; |
elessair | 0:f269e3021894 | 81 | |
elessair | 0:f269e3021894 | 82 | typedef enum { |
elessair | 0:f269e3021894 | 83 | PullUp = 2, |
elessair | 0:f269e3021894 | 84 | PullDown = 1, |
elessair | 0:f269e3021894 | 85 | PullNone = 0, |
elessair | 0:f269e3021894 | 86 | Repeater = 3, |
elessair | 0:f269e3021894 | 87 | OpenDrain = 4, |
elessair | 0:f269e3021894 | 88 | PullDefault = PullDown |
elessair | 0:f269e3021894 | 89 | } PinMode; |
elessair | 0:f269e3021894 | 90 | |
elessair | 0:f269e3021894 | 91 | #define STDIO_UART_TX USBTX |
elessair | 0:f269e3021894 | 92 | #define STDIO_UART_RX USBRX |
elessair | 0:f269e3021894 | 93 | |
elessair | 0:f269e3021894 | 94 | typedef struct { |
elessair | 0:f269e3021894 | 95 | unsigned char n; |
elessair | 0:f269e3021894 | 96 | unsigned char offset; |
elessair | 0:f269e3021894 | 97 | } SWM_Map; |
elessair | 0:f269e3021894 | 98 | |
elessair | 0:f269e3021894 | 99 | #ifdef __cplusplus |
elessair | 0:f269e3021894 | 100 | } |
elessair | 0:f269e3021894 | 101 | #endif |
elessair | 0:f269e3021894 | 102 | |
elessair | 0:f269e3021894 | 103 | #endif |