Mouse code for the MacroRat
mbed-dev/targets/TARGET_NXP/TARGET_LPC82X/TARGET_LPC824/PinNames.h@18:6a4db94011d3, 2017-05-14 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sun May 14 23:18:57 2017 +0000
- Revision:
- 18:6a4db94011d3
Publishing again
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /* mbed Microcontroller Library |
sahilmgandhi | 18:6a4db94011d3 | 2 | * Copyright (c) 2006-2013 ARM Limited |
sahilmgandhi | 18:6a4db94011d3 | 3 | * |
sahilmgandhi | 18:6a4db94011d3 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
sahilmgandhi | 18:6a4db94011d3 | 5 | * you may not use this file except in compliance with the License. |
sahilmgandhi | 18:6a4db94011d3 | 6 | * You may obtain a copy of the License at |
sahilmgandhi | 18:6a4db94011d3 | 7 | * |
sahilmgandhi | 18:6a4db94011d3 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
sahilmgandhi | 18:6a4db94011d3 | 9 | * |
sahilmgandhi | 18:6a4db94011d3 | 10 | * Unless required by applicable law or agreed to in writing, software |
sahilmgandhi | 18:6a4db94011d3 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
sahilmgandhi | 18:6a4db94011d3 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
sahilmgandhi | 18:6a4db94011d3 | 13 | * See the License for the specific language governing permissions and |
sahilmgandhi | 18:6a4db94011d3 | 14 | * limitations under the License. |
sahilmgandhi | 18:6a4db94011d3 | 15 | */ |
sahilmgandhi | 18:6a4db94011d3 | 16 | #ifndef MBED_PINNAMES_H |
sahilmgandhi | 18:6a4db94011d3 | 17 | #define MBED_PINNAMES_H |
sahilmgandhi | 18:6a4db94011d3 | 18 | |
sahilmgandhi | 18:6a4db94011d3 | 19 | #include "cmsis.h" |
sahilmgandhi | 18:6a4db94011d3 | 20 | |
sahilmgandhi | 18:6a4db94011d3 | 21 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 22 | extern "C" { |
sahilmgandhi | 18:6a4db94011d3 | 23 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 24 | |
sahilmgandhi | 18:6a4db94011d3 | 25 | typedef enum { |
sahilmgandhi | 18:6a4db94011d3 | 26 | PIN_INPUT, |
sahilmgandhi | 18:6a4db94011d3 | 27 | PIN_OUTPUT |
sahilmgandhi | 18:6a4db94011d3 | 28 | } PinDirection; |
sahilmgandhi | 18:6a4db94011d3 | 29 | |
sahilmgandhi | 18:6a4db94011d3 | 30 | #define PIN_SHIFT 8 |
sahilmgandhi | 18:6a4db94011d3 | 31 | |
sahilmgandhi | 18:6a4db94011d3 | 32 | typedef enum { |
sahilmgandhi | 18:6a4db94011d3 | 33 | // LPC824 Pin Names (PIN[11:8] + IOCON offset[7:0]) |
sahilmgandhi | 18:6a4db94011d3 | 34 | |
sahilmgandhi | 18:6a4db94011d3 | 35 | P0_0 = ( 0 << PIN_SHIFT) | 0x44, |
sahilmgandhi | 18:6a4db94011d3 | 36 | P0_1 = ( 1 << PIN_SHIFT) | 0x2C, |
sahilmgandhi | 18:6a4db94011d3 | 37 | P0_2 = ( 2 << PIN_SHIFT) | 0x18, |
sahilmgandhi | 18:6a4db94011d3 | 38 | P0_3 = ( 3 << PIN_SHIFT) | 0x14, |
sahilmgandhi | 18:6a4db94011d3 | 39 | P0_4 = ( 4 << PIN_SHIFT) | 0x10, |
sahilmgandhi | 18:6a4db94011d3 | 40 | P0_5 = ( 5 << PIN_SHIFT) | 0x0C, |
sahilmgandhi | 18:6a4db94011d3 | 41 | P0_6 = ( 6 << PIN_SHIFT) | 0x40, |
sahilmgandhi | 18:6a4db94011d3 | 42 | P0_7 = ( 7 << PIN_SHIFT) | 0x3C, |
sahilmgandhi | 18:6a4db94011d3 | 43 | P0_8 = ( 8 << PIN_SHIFT) | 0x38, |
sahilmgandhi | 18:6a4db94011d3 | 44 | P0_9 = ( 9 << PIN_SHIFT) | 0x34, |
sahilmgandhi | 18:6a4db94011d3 | 45 | P0_10 = (10 << PIN_SHIFT) | 0x20, |
sahilmgandhi | 18:6a4db94011d3 | 46 | P0_11 = (11 << PIN_SHIFT) | 0x1C, |
sahilmgandhi | 18:6a4db94011d3 | 47 | P0_12 = (12 << PIN_SHIFT) | 0x08, |
sahilmgandhi | 18:6a4db94011d3 | 48 | P0_13 = (13 << PIN_SHIFT) | 0x04, |
sahilmgandhi | 18:6a4db94011d3 | 49 | P0_14 = (14 << PIN_SHIFT) | 0x48, |
sahilmgandhi | 18:6a4db94011d3 | 50 | P0_15 = (15 << PIN_SHIFT) | 0x28, |
sahilmgandhi | 18:6a4db94011d3 | 51 | P0_16 = (16 << PIN_SHIFT) | 0x24, |
sahilmgandhi | 18:6a4db94011d3 | 52 | P0_17 = (17 << PIN_SHIFT) | 0x00, |
sahilmgandhi | 18:6a4db94011d3 | 53 | P0_18 = (18 << PIN_SHIFT) | 0x78, |
sahilmgandhi | 18:6a4db94011d3 | 54 | P0_19 = (19 << PIN_SHIFT) | 0x74, |
sahilmgandhi | 18:6a4db94011d3 | 55 | P0_20 = (20 << PIN_SHIFT) | 0x70, |
sahilmgandhi | 18:6a4db94011d3 | 56 | P0_21 = (21 << PIN_SHIFT) | 0x6C, |
sahilmgandhi | 18:6a4db94011d3 | 57 | P0_22 = (22 << PIN_SHIFT) | 0x68, |
sahilmgandhi | 18:6a4db94011d3 | 58 | P0_23 = (23 << PIN_SHIFT) | 0x64, |
sahilmgandhi | 18:6a4db94011d3 | 59 | P0_24 = (24 << PIN_SHIFT) | 0x60, |
sahilmgandhi | 18:6a4db94011d3 | 60 | P0_25 = (25 << PIN_SHIFT) | 0x5C, |
sahilmgandhi | 18:6a4db94011d3 | 61 | P0_26 = (26 << PIN_SHIFT) | 0x58, |
sahilmgandhi | 18:6a4db94011d3 | 62 | P0_27 = (27 << PIN_SHIFT) | 0x54, |
sahilmgandhi | 18:6a4db94011d3 | 63 | P0_28 = (28 << PIN_SHIFT) | 0x50, |
sahilmgandhi | 18:6a4db94011d3 | 64 | |
sahilmgandhi | 18:6a4db94011d3 | 65 | D0 = P0_0, |
sahilmgandhi | 18:6a4db94011d3 | 66 | D1 = P0_4, |
sahilmgandhi | 18:6a4db94011d3 | 67 | D2 = P0_19, |
sahilmgandhi | 18:6a4db94011d3 | 68 | D3 = P0_12, // LED_RED |
sahilmgandhi | 18:6a4db94011d3 | 69 | D4 = P0_18, |
sahilmgandhi | 18:6a4db94011d3 | 70 | D5 = P0_28, |
sahilmgandhi | 18:6a4db94011d3 | 71 | D6 = P0_16, // LED_GREEN |
sahilmgandhi | 18:6a4db94011d3 | 72 | D7 = P0_17, |
sahilmgandhi | 18:6a4db94011d3 | 73 | D8 = P0_13, |
sahilmgandhi | 18:6a4db94011d3 | 74 | D9 = P0_27, // LED_BLUE |
sahilmgandhi | 18:6a4db94011d3 | 75 | D10 = P0_15, |
sahilmgandhi | 18:6a4db94011d3 | 76 | D11 = P0_26, |
sahilmgandhi | 18:6a4db94011d3 | 77 | D12 = P0_25, |
sahilmgandhi | 18:6a4db94011d3 | 78 | D13 = P0_24, |
sahilmgandhi | 18:6a4db94011d3 | 79 | D14 = P0_11, |
sahilmgandhi | 18:6a4db94011d3 | 80 | D15 = P0_10, |
sahilmgandhi | 18:6a4db94011d3 | 81 | |
sahilmgandhi | 18:6a4db94011d3 | 82 | A0 = P0_6, |
sahilmgandhi | 18:6a4db94011d3 | 83 | A1 = P0_14, |
sahilmgandhi | 18:6a4db94011d3 | 84 | A2 = P0_23, |
sahilmgandhi | 18:6a4db94011d3 | 85 | A3 = P0_22, |
sahilmgandhi | 18:6a4db94011d3 | 86 | A4 = P0_21, |
sahilmgandhi | 18:6a4db94011d3 | 87 | A5 = P0_20, |
sahilmgandhi | 18:6a4db94011d3 | 88 | |
sahilmgandhi | 18:6a4db94011d3 | 89 | // LPC824-MAX board |
sahilmgandhi | 18:6a4db94011d3 | 90 | LED_RED = P0_12, |
sahilmgandhi | 18:6a4db94011d3 | 91 | LED_GREEN = P0_16, |
sahilmgandhi | 18:6a4db94011d3 | 92 | LED_BLUE = P0_27, |
sahilmgandhi | 18:6a4db94011d3 | 93 | |
sahilmgandhi | 18:6a4db94011d3 | 94 | // mbed original LED naming |
sahilmgandhi | 18:6a4db94011d3 | 95 | LED1 = LED_RED, |
sahilmgandhi | 18:6a4db94011d3 | 96 | LED2 = LED_GREEN, |
sahilmgandhi | 18:6a4db94011d3 | 97 | LED3 = LED_BLUE, |
sahilmgandhi | 18:6a4db94011d3 | 98 | LED4 = LED_BLUE, |
sahilmgandhi | 18:6a4db94011d3 | 99 | |
sahilmgandhi | 18:6a4db94011d3 | 100 | // Serial to USB pins |
sahilmgandhi | 18:6a4db94011d3 | 101 | USBTX = P0_7, |
sahilmgandhi | 18:6a4db94011d3 | 102 | USBRX = P0_18, |
sahilmgandhi | 18:6a4db94011d3 | 103 | |
sahilmgandhi | 18:6a4db94011d3 | 104 | // I2C pins |
sahilmgandhi | 18:6a4db94011d3 | 105 | SCL = P0_10, |
sahilmgandhi | 18:6a4db94011d3 | 106 | SDA = P0_11, |
sahilmgandhi | 18:6a4db94011d3 | 107 | I2C_SCL = P0_10, |
sahilmgandhi | 18:6a4db94011d3 | 108 | I2C_SDA = P0_11, |
sahilmgandhi | 18:6a4db94011d3 | 109 | |
sahilmgandhi | 18:6a4db94011d3 | 110 | // Not connected |
sahilmgandhi | 18:6a4db94011d3 | 111 | NC = (int)0xFFFFFFFF, |
sahilmgandhi | 18:6a4db94011d3 | 112 | } PinName; |
sahilmgandhi | 18:6a4db94011d3 | 113 | |
sahilmgandhi | 18:6a4db94011d3 | 114 | typedef enum { |
sahilmgandhi | 18:6a4db94011d3 | 115 | PullUp = 2, |
sahilmgandhi | 18:6a4db94011d3 | 116 | PullDown = 1, |
sahilmgandhi | 18:6a4db94011d3 | 117 | PullNone = 0, |
sahilmgandhi | 18:6a4db94011d3 | 118 | Repeater = 3, |
sahilmgandhi | 18:6a4db94011d3 | 119 | OpenDrain = 4, |
sahilmgandhi | 18:6a4db94011d3 | 120 | PullDefault = PullDown |
sahilmgandhi | 18:6a4db94011d3 | 121 | } PinMode; |
sahilmgandhi | 18:6a4db94011d3 | 122 | |
sahilmgandhi | 18:6a4db94011d3 | 123 | #define STDIO_UART_TX USBTX |
sahilmgandhi | 18:6a4db94011d3 | 124 | #define STDIO_UART_RX USBRX |
sahilmgandhi | 18:6a4db94011d3 | 125 | |
sahilmgandhi | 18:6a4db94011d3 | 126 | typedef struct { |
sahilmgandhi | 18:6a4db94011d3 | 127 | unsigned char n; |
sahilmgandhi | 18:6a4db94011d3 | 128 | unsigned char offset; |
sahilmgandhi | 18:6a4db94011d3 | 129 | } SWM_Map; |
sahilmgandhi | 18:6a4db94011d3 | 130 | |
sahilmgandhi | 18:6a4db94011d3 | 131 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 132 | } |
sahilmgandhi | 18:6a4db94011d3 | 133 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 134 | |
sahilmgandhi | 18:6a4db94011d3 | 135 | #endif |