The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.
Dependents: hello SerialTestv11 SerialTestv12 Sierpinski ... more
mbed 2
This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.
TARGET_KL43Z/TOOLCHAIN_ARM_STD/PinNames.h@172:65be27845400, 2019-02-20 (annotated)
- Committer:
- AnnaBridge
- Date:
- Wed Feb 20 20:53:29 2019 +0000
- Revision:
- 172:65be27845400
- Parent:
- 171:3a7713b1edbc
mbed library release version 165
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
AnnaBridge | 171:3a7713b1edbc | 1 | /* mbed Microcontroller Library |
AnnaBridge | 171:3a7713b1edbc | 2 | * Copyright (c) 2006-2013 ARM Limited |
AnnaBridge | 171:3a7713b1edbc | 3 | * |
AnnaBridge | 171:3a7713b1edbc | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
AnnaBridge | 171:3a7713b1edbc | 5 | * you may not use this file except in compliance with the License. |
AnnaBridge | 171:3a7713b1edbc | 6 | * You may obtain a copy of the License at |
AnnaBridge | 171:3a7713b1edbc | 7 | * |
AnnaBridge | 171:3a7713b1edbc | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
AnnaBridge | 171:3a7713b1edbc | 9 | * |
AnnaBridge | 171:3a7713b1edbc | 10 | * Unless required by applicable law or agreed to in writing, software |
AnnaBridge | 171:3a7713b1edbc | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
AnnaBridge | 171:3a7713b1edbc | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
AnnaBridge | 171:3a7713b1edbc | 13 | * See the License for the specific language governing permissions and |
AnnaBridge | 171:3a7713b1edbc | 14 | * limitations under the License. |
AnnaBridge | 171:3a7713b1edbc | 15 | */ |
AnnaBridge | 171:3a7713b1edbc | 16 | #ifndef MBED_PINNAMES_H |
AnnaBridge | 171:3a7713b1edbc | 17 | #define MBED_PINNAMES_H |
AnnaBridge | 171:3a7713b1edbc | 18 | |
AnnaBridge | 171:3a7713b1edbc | 19 | #include "cmsis.h" |
AnnaBridge | 171:3a7713b1edbc | 20 | |
AnnaBridge | 171:3a7713b1edbc | 21 | #ifdef __cplusplus |
AnnaBridge | 171:3a7713b1edbc | 22 | extern "C" { |
AnnaBridge | 171:3a7713b1edbc | 23 | #endif |
AnnaBridge | 171:3a7713b1edbc | 24 | |
AnnaBridge | 171:3a7713b1edbc | 25 | typedef enum { |
AnnaBridge | 171:3a7713b1edbc | 26 | PIN_INPUT, |
AnnaBridge | 171:3a7713b1edbc | 27 | PIN_OUTPUT |
AnnaBridge | 171:3a7713b1edbc | 28 | } PinDirection; |
AnnaBridge | 171:3a7713b1edbc | 29 | |
AnnaBridge | 171:3a7713b1edbc | 30 | #define GPIO_PORT_SHIFT 12 |
AnnaBridge | 171:3a7713b1edbc | 31 | |
AnnaBridge | 171:3a7713b1edbc | 32 | typedef enum { |
AnnaBridge | 171:3a7713b1edbc | 33 | PTA0 = (0 << GPIO_PORT_SHIFT | 0 ), |
AnnaBridge | 171:3a7713b1edbc | 34 | PTA1 = (0 << GPIO_PORT_SHIFT | 1 ), |
AnnaBridge | 171:3a7713b1edbc | 35 | PTA2 = (0 << GPIO_PORT_SHIFT | 2 ), |
AnnaBridge | 171:3a7713b1edbc | 36 | PTA3 = (0 << GPIO_PORT_SHIFT | 3 ), |
AnnaBridge | 171:3a7713b1edbc | 37 | PTA4 = (0 << GPIO_PORT_SHIFT | 4 ), |
AnnaBridge | 171:3a7713b1edbc | 38 | PTA5 = (0 << GPIO_PORT_SHIFT | 5 ), |
AnnaBridge | 171:3a7713b1edbc | 39 | PTA12 = (0 << GPIO_PORT_SHIFT | 12), |
AnnaBridge | 171:3a7713b1edbc | 40 | PTA13 = (0 << GPIO_PORT_SHIFT | 13), |
AnnaBridge | 171:3a7713b1edbc | 41 | PTA18 = (0 << GPIO_PORT_SHIFT | 18), |
AnnaBridge | 171:3a7713b1edbc | 42 | PTA19 = (0 << GPIO_PORT_SHIFT | 19), |
AnnaBridge | 171:3a7713b1edbc | 43 | PTA20 = (0 << GPIO_PORT_SHIFT | 20), |
AnnaBridge | 171:3a7713b1edbc | 44 | PTB0 = (1 << GPIO_PORT_SHIFT | 0 ), |
AnnaBridge | 171:3a7713b1edbc | 45 | PTB1 = (1 << GPIO_PORT_SHIFT | 1 ), |
AnnaBridge | 171:3a7713b1edbc | 46 | PTB2 = (1 << GPIO_PORT_SHIFT | 2 ), |
AnnaBridge | 171:3a7713b1edbc | 47 | PTB3 = (1 << GPIO_PORT_SHIFT | 3 ), |
AnnaBridge | 171:3a7713b1edbc | 48 | PTB16 = (1 << GPIO_PORT_SHIFT | 16), |
AnnaBridge | 171:3a7713b1edbc | 49 | PTB17 = (1 << GPIO_PORT_SHIFT | 17), |
AnnaBridge | 171:3a7713b1edbc | 50 | PTB18 = (1 << GPIO_PORT_SHIFT | 18), |
AnnaBridge | 171:3a7713b1edbc | 51 | PTB19 = (1 << GPIO_PORT_SHIFT | 19), |
AnnaBridge | 171:3a7713b1edbc | 52 | PTC0 = (2 << GPIO_PORT_SHIFT | 0 ), |
AnnaBridge | 171:3a7713b1edbc | 53 | PTC1 = (2 << GPIO_PORT_SHIFT | 1 ), |
AnnaBridge | 171:3a7713b1edbc | 54 | PTC2 = (2 << GPIO_PORT_SHIFT | 2 ), |
AnnaBridge | 171:3a7713b1edbc | 55 | PTC3 = (2 << GPIO_PORT_SHIFT | 3 ), |
AnnaBridge | 171:3a7713b1edbc | 56 | PTC4 = (2 << GPIO_PORT_SHIFT | 4 ), |
AnnaBridge | 171:3a7713b1edbc | 57 | PTC5 = (2 << GPIO_PORT_SHIFT | 5 ), |
AnnaBridge | 171:3a7713b1edbc | 58 | PTC6 = (2 << GPIO_PORT_SHIFT | 6 ), |
AnnaBridge | 171:3a7713b1edbc | 59 | PTC7 = (2 << GPIO_PORT_SHIFT | 7 ), |
AnnaBridge | 171:3a7713b1edbc | 60 | PTC8 = (2 << GPIO_PORT_SHIFT | 8 ), |
AnnaBridge | 171:3a7713b1edbc | 61 | PTC9 = (2 << GPIO_PORT_SHIFT | 9 ), |
AnnaBridge | 171:3a7713b1edbc | 62 | PTC10 = (2 << GPIO_PORT_SHIFT | 10), |
AnnaBridge | 171:3a7713b1edbc | 63 | PTC11 = (2 << GPIO_PORT_SHIFT | 11), |
AnnaBridge | 171:3a7713b1edbc | 64 | PTD0 = (3 << GPIO_PORT_SHIFT | 0 ), |
AnnaBridge | 171:3a7713b1edbc | 65 | PTD1 = (3 << GPIO_PORT_SHIFT | 1 ), |
AnnaBridge | 171:3a7713b1edbc | 66 | PTD2 = (3 << GPIO_PORT_SHIFT | 2 ), |
AnnaBridge | 171:3a7713b1edbc | 67 | PTD3 = (3 << GPIO_PORT_SHIFT | 3 ), |
AnnaBridge | 171:3a7713b1edbc | 68 | PTD4 = (3 << GPIO_PORT_SHIFT | 4 ), |
AnnaBridge | 171:3a7713b1edbc | 69 | PTD5 = (3 << GPIO_PORT_SHIFT | 5 ), |
AnnaBridge | 171:3a7713b1edbc | 70 | PTD6 = (3 << GPIO_PORT_SHIFT | 6 ), |
AnnaBridge | 171:3a7713b1edbc | 71 | PTD7 = (3 << GPIO_PORT_SHIFT | 7 ), |
AnnaBridge | 171:3a7713b1edbc | 72 | PTE0 = (4 << GPIO_PORT_SHIFT | 0 ), |
AnnaBridge | 171:3a7713b1edbc | 73 | PTE1 = (4 << GPIO_PORT_SHIFT | 1 ), |
AnnaBridge | 171:3a7713b1edbc | 74 | PTE16 = (4 << GPIO_PORT_SHIFT | 16), |
AnnaBridge | 171:3a7713b1edbc | 75 | PTE17 = (4 << GPIO_PORT_SHIFT | 17), |
AnnaBridge | 171:3a7713b1edbc | 76 | PTE18 = (4 << GPIO_PORT_SHIFT | 18), |
AnnaBridge | 171:3a7713b1edbc | 77 | PTE19 = (4 << GPIO_PORT_SHIFT | 19), |
AnnaBridge | 171:3a7713b1edbc | 78 | PTE20 = (4 << GPIO_PORT_SHIFT | 20), |
AnnaBridge | 171:3a7713b1edbc | 79 | PTE21 = (4 << GPIO_PORT_SHIFT | 21), |
AnnaBridge | 171:3a7713b1edbc | 80 | PTE22 = (4 << GPIO_PORT_SHIFT | 22), |
AnnaBridge | 171:3a7713b1edbc | 81 | PTE23 = (4 << GPIO_PORT_SHIFT | 23), |
AnnaBridge | 171:3a7713b1edbc | 82 | PTE24 = (4 << GPIO_PORT_SHIFT | 24), |
AnnaBridge | 171:3a7713b1edbc | 83 | PTE25 = (4 << GPIO_PORT_SHIFT | 25), |
AnnaBridge | 171:3a7713b1edbc | 84 | PTE29 = (4 << GPIO_PORT_SHIFT | 29), |
AnnaBridge | 171:3a7713b1edbc | 85 | PTE30 = (4 << GPIO_PORT_SHIFT | 30), |
AnnaBridge | 171:3a7713b1edbc | 86 | PTE31 = (4 << GPIO_PORT_SHIFT | 31), |
AnnaBridge | 171:3a7713b1edbc | 87 | |
AnnaBridge | 171:3a7713b1edbc | 88 | LED_RED = PTE31, |
AnnaBridge | 171:3a7713b1edbc | 89 | LED_GREEN = PTD5, |
AnnaBridge | 171:3a7713b1edbc | 90 | |
AnnaBridge | 171:3a7713b1edbc | 91 | // mbed original LED naming |
AnnaBridge | 171:3a7713b1edbc | 92 | LED1 = LED_GREEN, |
AnnaBridge | 171:3a7713b1edbc | 93 | LED2 = LED_RED, |
AnnaBridge | 171:3a7713b1edbc | 94 | LED3 = LED_GREEN, |
AnnaBridge | 171:3a7713b1edbc | 95 | LED4 = LED_RED, |
AnnaBridge | 171:3a7713b1edbc | 96 | |
AnnaBridge | 171:3a7713b1edbc | 97 | //Push buttons |
AnnaBridge | 171:3a7713b1edbc | 98 | SW1 = PTA4, |
AnnaBridge | 171:3a7713b1edbc | 99 | SW3 = PTC3, |
AnnaBridge | 171:3a7713b1edbc | 100 | // Standardized button names |
AnnaBridge | 171:3a7713b1edbc | 101 | BUTTON1 = SW1, |
AnnaBridge | 171:3a7713b1edbc | 102 | BUTTON2 = SW3, |
AnnaBridge | 171:3a7713b1edbc | 103 | |
AnnaBridge | 171:3a7713b1edbc | 104 | // USB Pins |
AnnaBridge | 171:3a7713b1edbc | 105 | USBTX = PTA2, |
AnnaBridge | 171:3a7713b1edbc | 106 | USBRX = PTA1, |
AnnaBridge | 171:3a7713b1edbc | 107 | |
AnnaBridge | 171:3a7713b1edbc | 108 | // Arduino Headers |
AnnaBridge | 171:3a7713b1edbc | 109 | |
AnnaBridge | 171:3a7713b1edbc | 110 | D0 = PTA1, |
AnnaBridge | 171:3a7713b1edbc | 111 | D1 = PTA2, |
AnnaBridge | 171:3a7713b1edbc | 112 | D2 = PTD3, |
AnnaBridge | 171:3a7713b1edbc | 113 | D3 = PTA12, |
AnnaBridge | 171:3a7713b1edbc | 114 | D4 = PTA4, |
AnnaBridge | 171:3a7713b1edbc | 115 | D5 = PTA5, |
AnnaBridge | 171:3a7713b1edbc | 116 | D6 = PTE29, |
AnnaBridge | 171:3a7713b1edbc | 117 | D7 = PTE30, |
AnnaBridge | 171:3a7713b1edbc | 118 | D8 = PTA13, |
AnnaBridge | 171:3a7713b1edbc | 119 | D9 = PTD2, |
AnnaBridge | 171:3a7713b1edbc | 120 | D10 = PTD4, |
AnnaBridge | 171:3a7713b1edbc | 121 | D11 = PTD6, |
AnnaBridge | 171:3a7713b1edbc | 122 | D12 = PTD7, |
AnnaBridge | 171:3a7713b1edbc | 123 | D13 = PTD5, |
AnnaBridge | 171:3a7713b1edbc | 124 | D14 = PTE0, |
AnnaBridge | 171:3a7713b1edbc | 125 | D15 = PTE1, |
AnnaBridge | 171:3a7713b1edbc | 126 | |
AnnaBridge | 171:3a7713b1edbc | 127 | I2C_SCL = D15, |
AnnaBridge | 171:3a7713b1edbc | 128 | I2C_SDA = D14, |
AnnaBridge | 171:3a7713b1edbc | 129 | |
AnnaBridge | 171:3a7713b1edbc | 130 | A0 = PTB0, |
AnnaBridge | 171:3a7713b1edbc | 131 | A1 = PTB1, |
AnnaBridge | 171:3a7713b1edbc | 132 | A2 = PTB2, |
AnnaBridge | 171:3a7713b1edbc | 133 | A3 = PTB3, |
AnnaBridge | 171:3a7713b1edbc | 134 | A4 = PTC2, |
AnnaBridge | 171:3a7713b1edbc | 135 | A5 = PTC1, |
AnnaBridge | 171:3a7713b1edbc | 136 | |
AnnaBridge | 171:3a7713b1edbc | 137 | // Not connected |
AnnaBridge | 171:3a7713b1edbc | 138 | NC = (int)0xFFFFFFFF |
AnnaBridge | 171:3a7713b1edbc | 139 | } PinName; |
AnnaBridge | 171:3a7713b1edbc | 140 | |
AnnaBridge | 171:3a7713b1edbc | 141 | |
AnnaBridge | 171:3a7713b1edbc | 142 | typedef enum { |
AnnaBridge | 171:3a7713b1edbc | 143 | PullNone = 0, |
AnnaBridge | 171:3a7713b1edbc | 144 | PullDown = 1, |
AnnaBridge | 171:3a7713b1edbc | 145 | PullUp = 2, |
AnnaBridge | 171:3a7713b1edbc | 146 | PullDefault = PullUp |
AnnaBridge | 171:3a7713b1edbc | 147 | } PinMode; |
AnnaBridge | 171:3a7713b1edbc | 148 | |
AnnaBridge | 171:3a7713b1edbc | 149 | #ifdef __cplusplus |
AnnaBridge | 171:3a7713b1edbc | 150 | } |
AnnaBridge | 171:3a7713b1edbc | 151 | #endif |
AnnaBridge | 171:3a7713b1edbc | 152 | |
AnnaBridge | 171:3a7713b1edbc | 153 | #endif |