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
AnnaBridge 171:3a7713b1edbc 1 /* mbed Microcontroller Library
AnnaBridge 171:3a7713b1edbc 2 * Copyright (c) 2013 Nordic Semiconductor
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 PORT_SHIFT 3
AnnaBridge 171:3a7713b1edbc 31
AnnaBridge 171:3a7713b1edbc 32 typedef enum {
AnnaBridge 171:3a7713b1edbc 33 p0 = 0,
AnnaBridge 171:3a7713b1edbc 34 p1 = 1,
AnnaBridge 171:3a7713b1edbc 35 p2 = 2,
AnnaBridge 171:3a7713b1edbc 36 p3 = 3,
AnnaBridge 171:3a7713b1edbc 37 p4 = 4,
AnnaBridge 171:3a7713b1edbc 38 p5 = 5,
AnnaBridge 171:3a7713b1edbc 39 p6 = 6,
AnnaBridge 171:3a7713b1edbc 40 p7 = 7,
AnnaBridge 171:3a7713b1edbc 41 p8 = 8,
AnnaBridge 171:3a7713b1edbc 42 p9 = 9,
AnnaBridge 171:3a7713b1edbc 43 p10 = 10,
AnnaBridge 171:3a7713b1edbc 44 p11 = 11,
AnnaBridge 171:3a7713b1edbc 45 p12 = 12,
AnnaBridge 171:3a7713b1edbc 46 p13 = 13,
AnnaBridge 171:3a7713b1edbc 47 p14 = 14,
AnnaBridge 171:3a7713b1edbc 48 p15 = 15,
AnnaBridge 171:3a7713b1edbc 49 p16 = 16,
AnnaBridge 171:3a7713b1edbc 50 p17 = 17,
AnnaBridge 171:3a7713b1edbc 51 p18 = 18,
AnnaBridge 171:3a7713b1edbc 52 p19 = 19,
AnnaBridge 171:3a7713b1edbc 53 p20 = 20,
AnnaBridge 171:3a7713b1edbc 54 p21 = 21,
AnnaBridge 171:3a7713b1edbc 55 p22 = 22,
AnnaBridge 171:3a7713b1edbc 56 p23 = 23,
AnnaBridge 171:3a7713b1edbc 57 p24 = 24,
AnnaBridge 171:3a7713b1edbc 58 p25 = 25,
AnnaBridge 171:3a7713b1edbc 59 p26 = 26,
AnnaBridge 171:3a7713b1edbc 60 p27 = 27,
AnnaBridge 171:3a7713b1edbc 61 p28 = 28,
AnnaBridge 171:3a7713b1edbc 62 p29 = 29,
AnnaBridge 171:3a7713b1edbc 63 p30 = 30,
AnnaBridge 171:3a7713b1edbc 64 // p31=31,
AnnaBridge 171:3a7713b1edbc 65
AnnaBridge 171:3a7713b1edbc 66 P0_0 = p0,
AnnaBridge 171:3a7713b1edbc 67 P0_1 = p1,
AnnaBridge 171:3a7713b1edbc 68 P0_2 = p2,
AnnaBridge 171:3a7713b1edbc 69 P0_3 = p3,
AnnaBridge 171:3a7713b1edbc 70 P0_4 = p4,
AnnaBridge 171:3a7713b1edbc 71 P0_5 = p5,
AnnaBridge 171:3a7713b1edbc 72 P0_6 = p6,
AnnaBridge 171:3a7713b1edbc 73 P0_7 = p7,
AnnaBridge 171:3a7713b1edbc 74
AnnaBridge 171:3a7713b1edbc 75 P0_8 = p8,
AnnaBridge 171:3a7713b1edbc 76 P0_9 = p9,
AnnaBridge 171:3a7713b1edbc 77 P0_10 = p10,
AnnaBridge 171:3a7713b1edbc 78 P0_11 = p11,
AnnaBridge 171:3a7713b1edbc 79 P0_12 = p12,
AnnaBridge 171:3a7713b1edbc 80 P0_13 = p13,
AnnaBridge 171:3a7713b1edbc 81 P0_14 = p14,
AnnaBridge 171:3a7713b1edbc 82 P0_15 = p15,
AnnaBridge 171:3a7713b1edbc 83
AnnaBridge 171:3a7713b1edbc 84 P0_16 = p16,
AnnaBridge 171:3a7713b1edbc 85 P0_17 = p17,
AnnaBridge 171:3a7713b1edbc 86 P0_18 = p18,
AnnaBridge 171:3a7713b1edbc 87 P0_19 = p19,
AnnaBridge 171:3a7713b1edbc 88 P0_20 = p20,
AnnaBridge 171:3a7713b1edbc 89 P0_21 = p21,
AnnaBridge 171:3a7713b1edbc 90 P0_22 = p22,
AnnaBridge 171:3a7713b1edbc 91 P0_23 = p23,
AnnaBridge 171:3a7713b1edbc 92
AnnaBridge 171:3a7713b1edbc 93 P0_24 = p24,
AnnaBridge 171:3a7713b1edbc 94 P0_25 = p25,
AnnaBridge 171:3a7713b1edbc 95 P0_26 = p26,
AnnaBridge 171:3a7713b1edbc 96 P0_27 = p27,
AnnaBridge 171:3a7713b1edbc 97 P0_28 = p28,
AnnaBridge 171:3a7713b1edbc 98 P0_29 = p29,
AnnaBridge 171:3a7713b1edbc 99 P0_30 = p30,
AnnaBridge 171:3a7713b1edbc 100
AnnaBridge 171:3a7713b1edbc 101 LED1 = p18,
AnnaBridge 171:3a7713b1edbc 102 LED2 = p19,
AnnaBridge 171:3a7713b1edbc 103 LED3 = p18,
AnnaBridge 171:3a7713b1edbc 104 LED4 = p19,
AnnaBridge 171:3a7713b1edbc 105
AnnaBridge 171:3a7713b1edbc 106 BUTTON1 = p16,
AnnaBridge 171:3a7713b1edbc 107 BUTTON2 = p17,
AnnaBridge 171:3a7713b1edbc 108
AnnaBridge 171:3a7713b1edbc 109 RX_PIN_NUMBER = p11,
AnnaBridge 171:3a7713b1edbc 110 TX_PIN_NUMBER = p9,
AnnaBridge 171:3a7713b1edbc 111 CTS_PIN_NUMBER = p10,
AnnaBridge 171:3a7713b1edbc 112 RTS_PIN_NUMBER = p8,
AnnaBridge 171:3a7713b1edbc 113
AnnaBridge 171:3a7713b1edbc 114 // mBed interface Pins
AnnaBridge 171:3a7713b1edbc 115 USBTX = TX_PIN_NUMBER,
AnnaBridge 171:3a7713b1edbc 116 USBRX = RX_PIN_NUMBER,
AnnaBridge 171:3a7713b1edbc 117
AnnaBridge 171:3a7713b1edbc 118 SPI_PSELMOSI0 = p20,
AnnaBridge 171:3a7713b1edbc 119 SPI_PSELMISO0 = p22,
AnnaBridge 171:3a7713b1edbc 120 SPI_PSELSS0 = p24,
AnnaBridge 171:3a7713b1edbc 121 SPI_PSELSCK0 = p25,
AnnaBridge 171:3a7713b1edbc 122
AnnaBridge 171:3a7713b1edbc 123 SPI_PSELMOSI1 = p12,
AnnaBridge 171:3a7713b1edbc 124 SPI_PSELMISO1 = p13,
AnnaBridge 171:3a7713b1edbc 125 SPI_PSELSS1 = p14,
AnnaBridge 171:3a7713b1edbc 126 SPI_PSELSCK1 = p15,
AnnaBridge 171:3a7713b1edbc 127
AnnaBridge 171:3a7713b1edbc 128 SPIS_PSELMOSI = p12,
AnnaBridge 171:3a7713b1edbc 129 SPIS_PSELMISO = p13,
AnnaBridge 171:3a7713b1edbc 130 SPIS_PSELSS = p14,
AnnaBridge 171:3a7713b1edbc 131 SPIS_PSELSCK = p15,
AnnaBridge 171:3a7713b1edbc 132
AnnaBridge 171:3a7713b1edbc 133 I2C_SDA0 = p22,
AnnaBridge 171:3a7713b1edbc 134 I2C_SCL0 = p20,
AnnaBridge 171:3a7713b1edbc 135
AnnaBridge 171:3a7713b1edbc 136 I2C_SDA1 = p13,
AnnaBridge 171:3a7713b1edbc 137 I2C_SCL1 = p15,
AnnaBridge 171:3a7713b1edbc 138 // Not connected
AnnaBridge 171:3a7713b1edbc 139 NC = (int)0xFFFFFFFF
AnnaBridge 171:3a7713b1edbc 140 } PinName;
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 = 3,
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