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) 2013 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 p28 = 28,
Anna Bridge 169:a7c7b631e539 60 p29 = 29,
Anna Bridge 169:a7c7b631e539 61 p30 = 30,
Anna Bridge 169:a7c7b631e539 62
Anna Bridge 169:a7c7b631e539 63 P0_0 = p0,
Anna Bridge 169:a7c7b631e539 64 P0_1 = p1,
Anna Bridge 169:a7c7b631e539 65 P0_2 = p2,
Anna Bridge 169:a7c7b631e539 66 P0_3 = p3,
Anna Bridge 169:a7c7b631e539 67 P0_4 = p4,
Anna Bridge 169:a7c7b631e539 68 P0_5 = p5,
Anna Bridge 169:a7c7b631e539 69 P0_6 = p6,
Anna Bridge 169:a7c7b631e539 70 P0_7 = p7,
Anna Bridge 169:a7c7b631e539 71
Anna Bridge 169:a7c7b631e539 72 P0_8 = p8,
Anna Bridge 169:a7c7b631e539 73 P0_9 = p9,
Anna Bridge 169:a7c7b631e539 74 P0_10 = p10,
Anna Bridge 169:a7c7b631e539 75 P0_11 = p11,
Anna Bridge 169:a7c7b631e539 76 P0_12 = p12,
Anna Bridge 169:a7c7b631e539 77 P0_13 = p13,
Anna Bridge 169:a7c7b631e539 78 P0_14 = p14,
Anna Bridge 169:a7c7b631e539 79 P0_15 = p15,
Anna Bridge 169:a7c7b631e539 80
Anna Bridge 169:a7c7b631e539 81 P0_16 = p16,
Anna Bridge 169:a7c7b631e539 82 P0_17 = p17,
Anna Bridge 169:a7c7b631e539 83 P0_18 = p18,
Anna Bridge 169:a7c7b631e539 84 P0_19 = p19,
Anna Bridge 169:a7c7b631e539 85 P0_20 = p20,
Anna Bridge 169:a7c7b631e539 86 P0_21 = p21,
Anna Bridge 169:a7c7b631e539 87 P0_22 = p22,
Anna Bridge 169:a7c7b631e539 88 P0_23 = p23,
Anna Bridge 169:a7c7b631e539 89
Anna Bridge 169:a7c7b631e539 90 P0_24 = p24,
Anna Bridge 169:a7c7b631e539 91 P0_25 = p25,
Anna Bridge 169:a7c7b631e539 92 P0_28 = p28,
Anna Bridge 169:a7c7b631e539 93 P0_29 = p29,
Anna Bridge 169:a7c7b631e539 94
Anna Bridge 169:a7c7b631e539 95 LED1 = p21,
Anna Bridge 169:a7c7b631e539 96 LED2 = p22,
Anna Bridge 169:a7c7b631e539 97 LED3 = p23,
Anna Bridge 169:a7c7b631e539 98 LED4 = p23,
Anna Bridge 169:a7c7b631e539 99 LEDR = LED1,
Anna Bridge 169:a7c7b631e539 100 LEDG = LED2,
Anna Bridge 169:a7c7b631e539 101 LEDB = LED3,
Anna Bridge 169:a7c7b631e539 102
Anna Bridge 169:a7c7b631e539 103 RX_PIN_NUMBER = p11,
Anna Bridge 169:a7c7b631e539 104 TX_PIN_NUMBER = p9,
Anna Bridge 169:a7c7b631e539 105 CTS_PIN_NUMBER = p10,
Anna Bridge 169:a7c7b631e539 106 RTS_PIN_NUMBER = p8,
Anna Bridge 169:a7c7b631e539 107
Anna Bridge 169:a7c7b631e539 108 // mBed interface Pins
Anna Bridge 169:a7c7b631e539 109 USBTX = TX_PIN_NUMBER,
Anna Bridge 169:a7c7b631e539 110 USBRX = RX_PIN_NUMBER,
Anna Bridge 169:a7c7b631e539 111
Anna Bridge 169:a7c7b631e539 112 SPI_PSELMOSI0 = p15,
Anna Bridge 169:a7c7b631e539 113 SPI_PSELMISO0 = p16,
Anna Bridge 169:a7c7b631e539 114 SPI_PSELSS0 = p17,
Anna Bridge 169:a7c7b631e539 115 SPI_PSELSCK0 = p18,
Anna Bridge 169:a7c7b631e539 116
Anna Bridge 169:a7c7b631e539 117 SPI_PSELMOSI1 = p15,
Anna Bridge 169:a7c7b631e539 118 SPI_PSELMISO1 = p16,
Anna Bridge 169:a7c7b631e539 119 SPI_PSELSS1 = p17,
Anna Bridge 169:a7c7b631e539 120 SPI_PSELSCK1 = p18,
Anna Bridge 169:a7c7b631e539 121
Anna Bridge 169:a7c7b631e539 122 SPIS_PSELMOSI = p15,
Anna Bridge 169:a7c7b631e539 123 SPIS_PSELMISO = p16,
Anna Bridge 169:a7c7b631e539 124 SPIS_PSELSS = p17,
Anna Bridge 169:a7c7b631e539 125 SPIS_PSELSCK = p18,
Anna Bridge 169:a7c7b631e539 126
Anna Bridge 169:a7c7b631e539 127 I2C_SDA0 = p19,
Anna Bridge 169:a7c7b631e539 128 I2C_SCL0 = p20,
Anna Bridge 169:a7c7b631e539 129
Anna Bridge 169:a7c7b631e539 130 // Not connected
Anna Bridge 169:a7c7b631e539 131 NC = (int)0xFFFFFFFF
Anna Bridge 169:a7c7b631e539 132 } PinName;
Anna Bridge 169:a7c7b631e539 133
Anna Bridge 169:a7c7b631e539 134 typedef enum {
Anna Bridge 169:a7c7b631e539 135 PullNone = 0,
Anna Bridge 169:a7c7b631e539 136 PullDown = 1,
Anna Bridge 169:a7c7b631e539 137 PullUp = 3,
Anna Bridge 169:a7c7b631e539 138 PullDefault = PullUp
Anna Bridge 169:a7c7b631e539 139 } PinMode;
Anna Bridge 169:a7c7b631e539 140
Anna Bridge 169:a7c7b631e539 141 #ifdef __cplusplus
Anna Bridge 169:a7c7b631e539 142 }
Anna Bridge 169:a7c7b631e539 143 #endif
Anna Bridge 169:a7c7b631e539 144
Anna Bridge 169:a7c7b631e539 145 #endif