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.

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?

UserRevisionLine numberNew contents of line
Anna Bridge 169:a7c7b631e539 1 /* mbed Microcontroller Library
Anna Bridge 169:a7c7b631e539 2 * Copyright (c) 2015 Nordic Semiconductor
Anna Bridge 169:a7c7b631e539 3 *
Anna Bridge 169:a7c7b631e539 4 * Licensed under the Apache License, Version 2.0 (the "License");
Anna Bridge 169:a7c7b631e539 5 * you may not use this file except in compliance with the License.
Anna Bridge 169:a7c7b631e539 6 * You may obtain a copy of the License at
Anna Bridge 169:a7c7b631e539 7 *
Anna Bridge 169:a7c7b631e539 8 * http://www.apache.org/licenses/LICENSE-2.0
Anna Bridge 169:a7c7b631e539 9 *
Anna Bridge 169:a7c7b631e539 10 * Unless required by applicable law or agreed to in writing, software
Anna Bridge 169:a7c7b631e539 11 * distributed under the License is distributed on an "AS IS" BASIS,
Anna Bridge 169:a7c7b631e539 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Anna Bridge 169:a7c7b631e539 13 * See the License for the specific language governing permissions and
Anna Bridge 169:a7c7b631e539 14 * limitations under the License.
Anna Bridge 169:a7c7b631e539 15 */
Anna Bridge 169:a7c7b631e539 16 #ifndef MBED_PINNAMES_H
Anna Bridge 169:a7c7b631e539 17 #define MBED_PINNAMES_H
Anna Bridge 169:a7c7b631e539 18
Anna Bridge 169:a7c7b631e539 19 #include "cmsis.h"
Anna Bridge 169:a7c7b631e539 20
Anna Bridge 169:a7c7b631e539 21 #ifdef __cplusplus
Anna Bridge 169:a7c7b631e539 22 extern "C" {
Anna Bridge 169:a7c7b631e539 23 #endif
Anna Bridge 169:a7c7b631e539 24
Anna Bridge 169:a7c7b631e539 25 typedef enum {
Anna Bridge 169:a7c7b631e539 26 PIN_INPUT,
Anna Bridge 169:a7c7b631e539 27 PIN_OUTPUT
Anna Bridge 169:a7c7b631e539 28 } PinDirection;
Anna Bridge 169:a7c7b631e539 29
Anna Bridge 169:a7c7b631e539 30 #define PORT_SHIFT 3
Anna Bridge 169:a7c7b631e539 31
Anna Bridge 169:a7c7b631e539 32 typedef enum {
Anna Bridge 169:a7c7b631e539 33 p0 = 0,
Anna Bridge 169:a7c7b631e539 34 p1 = 1,
Anna Bridge 169:a7c7b631e539 35 p2 = 2,
Anna Bridge 169:a7c7b631e539 36 p3 = 3,
Anna Bridge 169:a7c7b631e539 37 p4 = 4,
Anna Bridge 169:a7c7b631e539 38 p5 = 5,
Anna Bridge 169:a7c7b631e539 39 p6 = 6,
Anna Bridge 169:a7c7b631e539 40 p7 = 7,
Anna Bridge 169:a7c7b631e539 41 p8 = 8,
Anna Bridge 169:a7c7b631e539 42 p9 = 9,
Anna Bridge 169:a7c7b631e539 43 p10 = 10,
Anna Bridge 169:a7c7b631e539 44 p11 = 11,
Anna Bridge 169:a7c7b631e539 45 p12 = 12,
Anna Bridge 169:a7c7b631e539 46 p13 = 13,
Anna Bridge 169:a7c7b631e539 47 p14 = 14,
Anna Bridge 169:a7c7b631e539 48 p15 = 15,
Anna Bridge 169:a7c7b631e539 49 p16 = 16,
Anna Bridge 169:a7c7b631e539 50 p17 = 17,
Anna Bridge 169:a7c7b631e539 51 p18 = 18,
Anna Bridge 169:a7c7b631e539 52 p19 = 19,
Anna Bridge 169:a7c7b631e539 53 p20 = 20,
Anna Bridge 169:a7c7b631e539 54 p21 = 21,
Anna Bridge 169:a7c7b631e539 55 p22 = 22,
Anna Bridge 169:a7c7b631e539 56 p23 = 23,
Anna Bridge 169:a7c7b631e539 57 p24 = 24,
Anna Bridge 169:a7c7b631e539 58 p25 = 25,
Anna Bridge 169:a7c7b631e539 59 p26 = 26,
Anna Bridge 169:a7c7b631e539 60 p27 = 27,
Anna Bridge 169:a7c7b631e539 61 p28 = 28,
Anna Bridge 169:a7c7b631e539 62 p29 = 29,
Anna Bridge 169:a7c7b631e539 63 p30 = 30,
Anna Bridge 169:a7c7b631e539 64
Anna Bridge 169:a7c7b631e539 65 P0_0 = p0,
Anna Bridge 169:a7c7b631e539 66 P0_1 = p1,
Anna Bridge 169:a7c7b631e539 67 P0_2 = p2,
Anna Bridge 169:a7c7b631e539 68 P0_3 = p3,
Anna Bridge 169:a7c7b631e539 69 P0_4 = p4,
Anna Bridge 169:a7c7b631e539 70 P0_5 = p5,
Anna Bridge 169:a7c7b631e539 71 P0_6 = p6,
Anna Bridge 169:a7c7b631e539 72 P0_7 = p7,
Anna Bridge 169:a7c7b631e539 73
Anna Bridge 169:a7c7b631e539 74 P0_8 = p8,
Anna Bridge 169:a7c7b631e539 75 P0_9 = p9,
Anna Bridge 169:a7c7b631e539 76 P0_10 = p10,
Anna Bridge 169:a7c7b631e539 77 P0_11 = p11,
Anna Bridge 169:a7c7b631e539 78 P0_12 = p12,
Anna Bridge 169:a7c7b631e539 79 P0_13 = p13,
Anna Bridge 169:a7c7b631e539 80 P0_14 = p14,
Anna Bridge 169:a7c7b631e539 81 P0_15 = p15,
Anna Bridge 169:a7c7b631e539 82
Anna Bridge 169:a7c7b631e539 83 P0_16 = p16,
Anna Bridge 169:a7c7b631e539 84 P0_17 = p17,
Anna Bridge 169:a7c7b631e539 85 P0_18 = p18,
Anna Bridge 169:a7c7b631e539 86 P0_19 = p19,
Anna Bridge 169:a7c7b631e539 87 P0_20 = p20,
Anna Bridge 169:a7c7b631e539 88 P0_21 = p21,
Anna Bridge 169:a7c7b631e539 89 P0_22 = p22,
Anna Bridge 169:a7c7b631e539 90 P0_23 = p23,
Anna Bridge 169:a7c7b631e539 91
Anna Bridge 169:a7c7b631e539 92 P0_24 = p24,
Anna Bridge 169:a7c7b631e539 93 P0_25 = p25,
Anna Bridge 169:a7c7b631e539 94 P0_26 = p26,
Anna Bridge 169:a7c7b631e539 95 P0_27 = p27,
Anna Bridge 169:a7c7b631e539 96 P0_28 = p28,
Anna Bridge 169:a7c7b631e539 97 P0_29 = p29,
Anna Bridge 169:a7c7b631e539 98 P0_30 = p30,
Anna Bridge 169:a7c7b631e539 99
Anna Bridge 169:a7c7b631e539 100 LED1 = p21,
Anna Bridge 169:a7c7b631e539 101 LED2 = p22,
Anna Bridge 169:a7c7b631e539 102 LED3 = p23,
Anna Bridge 169:a7c7b631e539 103 LED4 = p24,
Anna Bridge 169:a7c7b631e539 104
Anna Bridge 169:a7c7b631e539 105 BUTTON1 = p17,
Anna Bridge 169:a7c7b631e539 106 BUTTON2 = p18,
Anna Bridge 169:a7c7b631e539 107 BUTTON3 = p19,
Anna Bridge 169:a7c7b631e539 108 BUTTON4 = p20,
Anna Bridge 169:a7c7b631e539 109
Anna Bridge 169:a7c7b631e539 110 RX_PIN_NUMBER = p11,
Anna Bridge 169:a7c7b631e539 111 TX_PIN_NUMBER = p9,
Anna Bridge 169:a7c7b631e539 112 CTS_PIN_NUMBER = p10,
Anna Bridge 169:a7c7b631e539 113 RTS_PIN_NUMBER = p8,
Anna Bridge 169:a7c7b631e539 114
Anna Bridge 169:a7c7b631e539 115 // mBed interface Pins
Anna Bridge 169:a7c7b631e539 116 USBTX = TX_PIN_NUMBER,
Anna Bridge 169:a7c7b631e539 117 USBRX = RX_PIN_NUMBER,
Anna Bridge 169:a7c7b631e539 118
Anna Bridge 169:a7c7b631e539 119 SPI_PSELMOSI0 = p25,
Anna Bridge 169:a7c7b631e539 120 SPI_PSELMISO0 = p28,
Anna Bridge 169:a7c7b631e539 121 SPI_PSELSS0 = p24,
Anna Bridge 169:a7c7b631e539 122 SPI_PSELSCK0 = p29,
Anna Bridge 169:a7c7b631e539 123
Anna Bridge 169:a7c7b631e539 124 SPI_PSELMOSI1 = p13,
Anna Bridge 169:a7c7b631e539 125 SPI_PSELMISO1 = p14,
Anna Bridge 169:a7c7b631e539 126 SPI_PSELSS1 = p12,
Anna Bridge 169:a7c7b631e539 127 SPI_PSELSCK1 = p15,
Anna Bridge 169:a7c7b631e539 128
Anna Bridge 169:a7c7b631e539 129 SPIS_PSELMOSI = p13,
Anna Bridge 169:a7c7b631e539 130 SPIS_PSELMISO = p14,
Anna Bridge 169:a7c7b631e539 131 SPIS_PSELSS = p12,
Anna Bridge 169:a7c7b631e539 132 SPIS_PSELSCK = p15,
Anna Bridge 169:a7c7b631e539 133
Anna Bridge 169:a7c7b631e539 134 I2C_SDA0 = p30,
Anna Bridge 169:a7c7b631e539 135 I2C_SCL0 = p7,
Anna Bridge 169:a7c7b631e539 136
Anna Bridge 169:a7c7b631e539 137 D0 = p12,
Anna Bridge 169:a7c7b631e539 138 D1 = p13,
Anna Bridge 169:a7c7b631e539 139 D2 = p14,
Anna Bridge 169:a7c7b631e539 140 D3 = p15,
Anna Bridge 169:a7c7b631e539 141 D4 = p16,
Anna Bridge 169:a7c7b631e539 142 D5 = p17,
Anna Bridge 169:a7c7b631e539 143 D6 = p18,
Anna Bridge 169:a7c7b631e539 144 D7 = p19,
Anna Bridge 169:a7c7b631e539 145
Anna Bridge 169:a7c7b631e539 146 D8 = p20,
Anna Bridge 169:a7c7b631e539 147 D9 = p23,
Anna Bridge 169:a7c7b631e539 148 D10 = p24,
Anna Bridge 169:a7c7b631e539 149 D11 = p25,
Anna Bridge 169:a7c7b631e539 150 D12 = p28,
Anna Bridge 169:a7c7b631e539 151 D13 = p29,
Anna Bridge 169:a7c7b631e539 152
Anna Bridge 169:a7c7b631e539 153 D14 = p30,
Anna Bridge 169:a7c7b631e539 154 D15 = p7,
Anna Bridge 169:a7c7b631e539 155
Anna Bridge 169:a7c7b631e539 156 A0 = p1,
Anna Bridge 169:a7c7b631e539 157 A1 = p2,
Anna Bridge 169:a7c7b631e539 158 A2 = p3,
Anna Bridge 169:a7c7b631e539 159 A3 = p4,
Anna Bridge 169:a7c7b631e539 160 A4 = p5,
Anna Bridge 169:a7c7b631e539 161 A5 = p6,
Anna Bridge 169:a7c7b631e539 162
Anna Bridge 169:a7c7b631e539 163 // Not connected
Anna Bridge 169:a7c7b631e539 164 NC = (int)0xFFFFFFFF
Anna Bridge 169:a7c7b631e539 165 } PinName;
Anna Bridge 169:a7c7b631e539 166
Anna Bridge 169:a7c7b631e539 167 typedef enum {
Anna Bridge 169:a7c7b631e539 168 PullNone = 0,
Anna Bridge 169:a7c7b631e539 169 PullDown = 1,
Anna Bridge 169:a7c7b631e539 170 PullUp = 3,
Anna Bridge 169:a7c7b631e539 171 PullDefault = PullUp
Anna Bridge 169:a7c7b631e539 172 } PinMode;
Anna Bridge 169:a7c7b631e539 173
Anna Bridge 169:a7c7b631e539 174 #ifdef __cplusplus
Anna Bridge 169:a7c7b631e539 175 }
Anna Bridge 169:a7c7b631e539 176 #endif
Anna Bridge 169:a7c7b631e539 177
Anna Bridge 169:a7c7b631e539 178 #endif