fix LPC812 PWM
Fork of mbed-dev by
targets/hal/TARGET_NXP/TARGET_LPC15XX/PinNames.h@0:9b334a45a8ff, 2015-10-01 (annotated)
- Committer:
- bogdanm
- Date:
- Thu Oct 01 15:25:22 2015 +0300
- Revision:
- 0:9b334a45a8ff
Initial commit on mbed-dev
Replaces mbed-src (now inactive)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bogdanm | 0:9b334a45a8ff | 1 | /* mbed Microcontroller Library |
bogdanm | 0:9b334a45a8ff | 2 | * Copyright (c) 2006-2014 ARM Limited |
bogdanm | 0:9b334a45a8ff | 3 | * |
bogdanm | 0:9b334a45a8ff | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
bogdanm | 0:9b334a45a8ff | 5 | * you may not use this file except in compliance with the License. |
bogdanm | 0:9b334a45a8ff | 6 | * You may obtain a copy of the License at |
bogdanm | 0:9b334a45a8ff | 7 | * |
bogdanm | 0:9b334a45a8ff | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
bogdanm | 0:9b334a45a8ff | 9 | * |
bogdanm | 0:9b334a45a8ff | 10 | * Unless required by applicable law or agreed to in writing, software |
bogdanm | 0:9b334a45a8ff | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
bogdanm | 0:9b334a45a8ff | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
bogdanm | 0:9b334a45a8ff | 13 | * See the License for the specific language governing permissions and |
bogdanm | 0:9b334a45a8ff | 14 | * limitations under the License. |
bogdanm | 0:9b334a45a8ff | 15 | */ |
bogdanm | 0:9b334a45a8ff | 16 | #ifndef MBED_PINNAMES_H |
bogdanm | 0:9b334a45a8ff | 17 | #define MBED_PINNAMES_H |
bogdanm | 0:9b334a45a8ff | 18 | |
bogdanm | 0:9b334a45a8ff | 19 | #include "cmsis.h" |
bogdanm | 0:9b334a45a8ff | 20 | |
bogdanm | 0:9b334a45a8ff | 21 | #ifdef __cplusplus |
bogdanm | 0:9b334a45a8ff | 22 | extern "C" { |
bogdanm | 0:9b334a45a8ff | 23 | #endif |
bogdanm | 0:9b334a45a8ff | 24 | |
bogdanm | 0:9b334a45a8ff | 25 | typedef enum { |
bogdanm | 0:9b334a45a8ff | 26 | PIN_INPUT, |
bogdanm | 0:9b334a45a8ff | 27 | PIN_OUTPUT |
bogdanm | 0:9b334a45a8ff | 28 | } PinDirection; |
bogdanm | 0:9b334a45a8ff | 29 | |
bogdanm | 0:9b334a45a8ff | 30 | typedef enum { |
bogdanm | 0:9b334a45a8ff | 31 | // LPC Pin Names |
bogdanm | 0:9b334a45a8ff | 32 | P0_0 = 0, |
bogdanm | 0:9b334a45a8ff | 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, |
bogdanm | 0:9b334a45a8ff | 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, |
bogdanm | 0:9b334a45a8ff | 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, |
bogdanm | 0:9b334a45a8ff | 36 | |
bogdanm | 0:9b334a45a8ff | 37 | LED_RED = P0_25, |
bogdanm | 0:9b334a45a8ff | 38 | LED_GREEN = P0_3, |
bogdanm | 0:9b334a45a8ff | 39 | LED_BLUE = P1_1, |
bogdanm | 0:9b334a45a8ff | 40 | |
bogdanm | 0:9b334a45a8ff | 41 | // mbed original LED naming |
bogdanm | 0:9b334a45a8ff | 42 | LED1 = LED_RED, |
bogdanm | 0:9b334a45a8ff | 43 | LED2 = LED_GREEN, |
bogdanm | 0:9b334a45a8ff | 44 | LED3 = LED_BLUE, |
bogdanm | 0:9b334a45a8ff | 45 | LED4 = LED_BLUE, |
bogdanm | 0:9b334a45a8ff | 46 | |
bogdanm | 0:9b334a45a8ff | 47 | // Serial to USB pins |
bogdanm | 0:9b334a45a8ff | 48 | USBTX = P0_18, |
bogdanm | 0:9b334a45a8ff | 49 | USBRX = P0_13, |
bogdanm | 0:9b334a45a8ff | 50 | |
bogdanm | 0:9b334a45a8ff | 51 | // Arduino Shield Receptacles Names |
bogdanm | 0:9b334a45a8ff | 52 | D0 = P0_13, |
bogdanm | 0:9b334a45a8ff | 53 | D1 = P0_18, |
bogdanm | 0:9b334a45a8ff | 54 | D2 = P0_29, |
bogdanm | 0:9b334a45a8ff | 55 | D3 = P0_9, |
bogdanm | 0:9b334a45a8ff | 56 | D4 = P0_10, |
bogdanm | 0:9b334a45a8ff | 57 | D5 = P0_16, // same port as D13 |
bogdanm | 0:9b334a45a8ff | 58 | D6 = P1_3, |
bogdanm | 0:9b334a45a8ff | 59 | D7 = P0_0, |
bogdanm | 0:9b334a45a8ff | 60 | D8 = P0_24, |
bogdanm | 0:9b334a45a8ff | 61 | D9 = P1_0, |
bogdanm | 0:9b334a45a8ff | 62 | D10= P0_27, |
bogdanm | 0:9b334a45a8ff | 63 | D11= P0_28, |
bogdanm | 0:9b334a45a8ff | 64 | D12= P0_12, |
bogdanm | 0:9b334a45a8ff | 65 | D13= P0_16, // same port as D5 |
bogdanm | 0:9b334a45a8ff | 66 | D14= P0_23, |
bogdanm | 0:9b334a45a8ff | 67 | D15= P0_22, |
bogdanm | 0:9b334a45a8ff | 68 | |
bogdanm | 0:9b334a45a8ff | 69 | A0 = P0_8, |
bogdanm | 0:9b334a45a8ff | 70 | A1 = P0_7, |
bogdanm | 0:9b334a45a8ff | 71 | A2 = P0_6, |
bogdanm | 0:9b334a45a8ff | 72 | A3 = P0_5, |
bogdanm | 0:9b334a45a8ff | 73 | A4 = P0_23, // same port as SDA |
bogdanm | 0:9b334a45a8ff | 74 | A5 = P0_22, // same port as SCL |
bogdanm | 0:9b334a45a8ff | 75 | SDA= P0_23, // same port as A4 |
bogdanm | 0:9b334a45a8ff | 76 | SCL= P0_22, // same port as A5 |
bogdanm | 0:9b334a45a8ff | 77 | |
bogdanm | 0:9b334a45a8ff | 78 | // Not connected |
bogdanm | 0:9b334a45a8ff | 79 | NC = (int)0xFFFFFFFF, |
bogdanm | 0:9b334a45a8ff | 80 | } PinName; |
bogdanm | 0:9b334a45a8ff | 81 | |
bogdanm | 0:9b334a45a8ff | 82 | typedef enum { |
bogdanm | 0:9b334a45a8ff | 83 | PullUp = 2, |
bogdanm | 0:9b334a45a8ff | 84 | PullDown = 1, |
bogdanm | 0:9b334a45a8ff | 85 | PullNone = 0, |
bogdanm | 0:9b334a45a8ff | 86 | Repeater = 3, |
bogdanm | 0:9b334a45a8ff | 87 | OpenDrain = 4, |
bogdanm | 0:9b334a45a8ff | 88 | PullDefault = PullDown |
bogdanm | 0:9b334a45a8ff | 89 | } PinMode; |
bogdanm | 0:9b334a45a8ff | 90 | |
bogdanm | 0:9b334a45a8ff | 91 | #define STDIO_UART_TX USBTX |
bogdanm | 0:9b334a45a8ff | 92 | #define STDIO_UART_RX USBRX |
bogdanm | 0:9b334a45a8ff | 93 | |
bogdanm | 0:9b334a45a8ff | 94 | typedef struct { |
bogdanm | 0:9b334a45a8ff | 95 | unsigned char n; |
bogdanm | 0:9b334a45a8ff | 96 | unsigned char offset; |
bogdanm | 0:9b334a45a8ff | 97 | } SWM_Map; |
bogdanm | 0:9b334a45a8ff | 98 | |
bogdanm | 0:9b334a45a8ff | 99 | #ifdef __cplusplus |
bogdanm | 0:9b334a45a8ff | 100 | } |
bogdanm | 0:9b334a45a8ff | 101 | #endif |
bogdanm | 0:9b334a45a8ff | 102 | |
bogdanm | 0:9b334a45a8ff | 103 | #endif |