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) 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 PTA16 = (0 << GPIO_PORT_SHIFT | 16),
AnnaBridge 171:3a7713b1edbc 37 PTA17 = (0 << GPIO_PORT_SHIFT | 17),
AnnaBridge 171:3a7713b1edbc 38 PTA18 = (0 << GPIO_PORT_SHIFT | 18),
AnnaBridge 171:3a7713b1edbc 39 PTA19 = (0 << GPIO_PORT_SHIFT | 19),
AnnaBridge 171:3a7713b1edbc 40 PTB0 = (1 << GPIO_PORT_SHIFT | 0),
AnnaBridge 171:3a7713b1edbc 41 PTB1 = (1 << GPIO_PORT_SHIFT | 1),
AnnaBridge 171:3a7713b1edbc 42 PTB2 = (1 << GPIO_PORT_SHIFT | 2),
AnnaBridge 171:3a7713b1edbc 43 PTB3 = (1 << GPIO_PORT_SHIFT | 3),
AnnaBridge 171:3a7713b1edbc 44 PTB16 = (1 << GPIO_PORT_SHIFT | 16),
AnnaBridge 171:3a7713b1edbc 45 PTB17 = (1 << GPIO_PORT_SHIFT | 17),
AnnaBridge 171:3a7713b1edbc 46 PTB18 = (1 << GPIO_PORT_SHIFT | 18),
AnnaBridge 171:3a7713b1edbc 47 PTC1 = (2 << GPIO_PORT_SHIFT | 1),
AnnaBridge 171:3a7713b1edbc 48 PTC2 = (2 << GPIO_PORT_SHIFT | 2),
AnnaBridge 171:3a7713b1edbc 49 PTC3 = (2 << GPIO_PORT_SHIFT | 3),
AnnaBridge 171:3a7713b1edbc 50 PTC4 = (2 << GPIO_PORT_SHIFT | 4),
AnnaBridge 171:3a7713b1edbc 51 PTC5 = (2 << GPIO_PORT_SHIFT | 5),
AnnaBridge 171:3a7713b1edbc 52 PTC6 = (2 << GPIO_PORT_SHIFT | 6),
AnnaBridge 171:3a7713b1edbc 53 PTC7 = (2 << GPIO_PORT_SHIFT | 7),
AnnaBridge 171:3a7713b1edbc 54 PTC16 = (2 << GPIO_PORT_SHIFT | 16),
AnnaBridge 171:3a7713b1edbc 55 PTC17 = (2 << GPIO_PORT_SHIFT | 17),
AnnaBridge 171:3a7713b1edbc 56 PTC18 = (2 << GPIO_PORT_SHIFT | 18),
AnnaBridge 171:3a7713b1edbc 57 PTC19 = (2 << GPIO_PORT_SHIFT | 19),
AnnaBridge 171:3a7713b1edbc 58
AnnaBridge 171:3a7713b1edbc 59 LED_RED = PTC1,
AnnaBridge 171:3a7713b1edbc 60 LED_GREEN = PTA19,
AnnaBridge 171:3a7713b1edbc 61 LED_BLUE = PTA18,
AnnaBridge 171:3a7713b1edbc 62
AnnaBridge 171:3a7713b1edbc 63 // mbed original LED naming
AnnaBridge 171:3a7713b1edbc 64 LED1 = LED_RED,
AnnaBridge 171:3a7713b1edbc 65 LED2 = LED_GREEN,
AnnaBridge 171:3a7713b1edbc 66 LED3 = LED_BLUE,
AnnaBridge 171:3a7713b1edbc 67 LED4 = LED_RED,
AnnaBridge 171:3a7713b1edbc 68
AnnaBridge 171:3a7713b1edbc 69 //Push buttons
AnnaBridge 171:3a7713b1edbc 70 SW3 = PTC4,
AnnaBridge 171:3a7713b1edbc 71 SW4 = PTC5,
AnnaBridge 171:3a7713b1edbc 72 // Standardized button names
AnnaBridge 171:3a7713b1edbc 73 BUTTON1 = SW3,
AnnaBridge 171:3a7713b1edbc 74 BUTTON2 = SW4,
AnnaBridge 171:3a7713b1edbc 75
AnnaBridge 171:3a7713b1edbc 76 // USB Pins
AnnaBridge 171:3a7713b1edbc 77 USBTX = PTC7,
AnnaBridge 171:3a7713b1edbc 78 USBRX = PTC6,
AnnaBridge 171:3a7713b1edbc 79
AnnaBridge 171:3a7713b1edbc 80 // Arduino Headers
AnnaBridge 171:3a7713b1edbc 81 D0 = PTC6,
AnnaBridge 171:3a7713b1edbc 82 D1 = PTC7,
AnnaBridge 171:3a7713b1edbc 83 D2 = PTC19,
AnnaBridge 171:3a7713b1edbc 84 D3 = PTC16,
AnnaBridge 171:3a7713b1edbc 85 D4 = PTC4,
AnnaBridge 171:3a7713b1edbc 86 D5 = PTC17,
AnnaBridge 171:3a7713b1edbc 87 D6 = PTC18,
AnnaBridge 171:3a7713b1edbc 88 D7 = PTA1,
AnnaBridge 171:3a7713b1edbc 89 D8 = PTA0,
AnnaBridge 171:3a7713b1edbc 90 D9 = PTC1,
AnnaBridge 171:3a7713b1edbc 91 D10 = PTA19,
AnnaBridge 171:3a7713b1edbc 92 D11 = PTA16,
AnnaBridge 171:3a7713b1edbc 93 D12 = PTA17,
AnnaBridge 171:3a7713b1edbc 94 D13 = PTA18,
AnnaBridge 171:3a7713b1edbc 95 D14 = PTC3,
AnnaBridge 171:3a7713b1edbc 96 D15 = PTC2,
AnnaBridge 171:3a7713b1edbc 97
AnnaBridge 171:3a7713b1edbc 98 I2C_SCL = D15,
AnnaBridge 171:3a7713b1edbc 99 I2C_SDA = D14,
AnnaBridge 171:3a7713b1edbc 100
AnnaBridge 171:3a7713b1edbc 101 DAC0_OUT = PTB18,
AnnaBridge 171:3a7713b1edbc 102
AnnaBridge 172:65be27845400 103 A0 = (int)0xFFFFFFFF,
AnnaBridge 171:3a7713b1edbc 104 A1 = DAC0_OUT,
AnnaBridge 171:3a7713b1edbc 105 A2 = PTB2,
AnnaBridge 171:3a7713b1edbc 106 A3 = PTB3,
AnnaBridge 171:3a7713b1edbc 107 A4 = PTB1,
AnnaBridge 171:3a7713b1edbc 108 A5 = PTB0,
AnnaBridge 171:3a7713b1edbc 109
AnnaBridge 171:3a7713b1edbc 110 // Not connected
AnnaBridge 171:3a7713b1edbc 111 NC = (int)0xFFFFFFFF
AnnaBridge 171:3a7713b1edbc 112 } PinName;
AnnaBridge 171:3a7713b1edbc 113
AnnaBridge 171:3a7713b1edbc 114
AnnaBridge 171:3a7713b1edbc 115 typedef enum {
AnnaBridge 171:3a7713b1edbc 116 PullNone = 0,
AnnaBridge 171:3a7713b1edbc 117 PullDown = 1,
AnnaBridge 171:3a7713b1edbc 118 PullUp = 2,
AnnaBridge 171:3a7713b1edbc 119 PullDefault = PullUp
AnnaBridge 171:3a7713b1edbc 120 } PinMode;
AnnaBridge 171:3a7713b1edbc 121
AnnaBridge 171:3a7713b1edbc 122 #ifdef __cplusplus
AnnaBridge 171:3a7713b1edbc 123 }
AnnaBridge 171:3a7713b1edbc 124 #endif
AnnaBridge 171:3a7713b1edbc 125
AnnaBridge 171:3a7713b1edbc 126 #endif