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:
<>
Date:
Tue Mar 14 16:20:51 2017 +0000
Revision:
138:093f2bd7b9eb
Parent:
122:f9eeca106725
Release 138 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3716: fix for issue #3715: correction in startup files for ARM and IAR, alignment of system_stm32f429xx.c files https://github.com/ARMmbed/mbed-os/pull/3716
3741: STM32 remove warning in hal_tick_32b.c file https://github.com/ARMmbed/mbed-os/pull/3741
3780: STM32L4 : Fix GPIO G port compatibility https://github.com/ARMmbed/mbed-os/pull/3780
3831: NCS36510: SPISLAVE enabled (Conflict resolved) https://github.com/ARMmbed/mbed-os/pull/3831
3836: Allow to redefine nRF's PSTORAGE_NUM_OF_PAGES outside of the mbed-os https://github.com/ARMmbed/mbed-os/pull/3836
3840: STM32: gpio SPEED - always set High Speed by default https://github.com/ARMmbed/mbed-os/pull/3840
3844: STM32 GPIO: Typo correction. Update comment (GPIO_IP_WITHOUT_BRR) https://github.com/ARMmbed/mbed-os/pull/3844
3850: STM32: change spi error to debug warning https://github.com/ARMmbed/mbed-os/pull/3850
3860: Define GPIO_IP_WITHOUT_BRR for xDot platform https://github.com/ARMmbed/mbed-os/pull/3860
3880: DISCO_F469NI: allow the use of CAN2 instance when CAN1 is not activated https://github.com/ARMmbed/mbed-os/pull/3880
3795: Fix pwm period calc https://github.com/ARMmbed/mbed-os/pull/3795
3828: STM32 CAN API: correct format and type https://github.com/ARMmbed/mbed-os/pull/3828
3842: TARGET_NRF: corrected spi_init() to properly handle re-initialization https://github.com/ARMmbed/mbed-os/pull/3842
3843: STM32L476xG: set APB2 clock to 80MHz (instead of 40MHz) https://github.com/ARMmbed/mbed-os/pull/3843
3879: NUCLEO_F446ZE: Add missing AnalogIn pins on PF_3, PF_5 and PF_10. https://github.com/ARMmbed/mbed-os/pull/3879
3902: Fix heap and stack size for NUCLEO_F746ZG https://github.com/ARMmbed/mbed-os/pull/3902
3829: can_write(): return error code when no tx mailboxes are available https://github.com/ARMmbed/mbed-os/pull/3829

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 122:f9eeca106725 1 /* mbed Microcontroller Library
Kojto 122:f9eeca106725 2 * Copyright (c) 2006-2013 ARM Limited
Kojto 122:f9eeca106725 3 *
Kojto 122:f9eeca106725 4 * Licensed under the Apache License, Version 2.0 (the "License");
Kojto 122:f9eeca106725 5 * you may not use this file except in compliance with the License.
Kojto 122:f9eeca106725 6 * You may obtain a copy of the License at
Kojto 122:f9eeca106725 7 *
Kojto 122:f9eeca106725 8 * http://www.apache.org/licenses/LICENSE-2.0
Kojto 122:f9eeca106725 9 *
Kojto 122:f9eeca106725 10 * Unless required by applicable law or agreed to in writing, software
Kojto 122:f9eeca106725 11 * distributed under the License is distributed on an "AS IS" BASIS,
Kojto 122:f9eeca106725 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Kojto 122:f9eeca106725 13 * See the License for the specific language governing permissions and
Kojto 122:f9eeca106725 14 * limitations under the License.
Kojto 122:f9eeca106725 15 */
Kojto 122:f9eeca106725 16 #ifndef MBED_PINNAMES_H
Kojto 122:f9eeca106725 17 #define MBED_PINNAMES_H
Kojto 122:f9eeca106725 18
Kojto 122:f9eeca106725 19 #include "cmsis.h"
Kojto 122:f9eeca106725 20
Kojto 122:f9eeca106725 21 #ifdef __cplusplus
Kojto 122:f9eeca106725 22 extern "C" {
Kojto 122:f9eeca106725 23 #endif
Kojto 122:f9eeca106725 24
Kojto 122:f9eeca106725 25 typedef enum {
Kojto 122:f9eeca106725 26 PIN_INPUT,
Kojto 122:f9eeca106725 27 PIN_OUTPUT
Kojto 122:f9eeca106725 28 } PinDirection;
Kojto 122:f9eeca106725 29
Kojto 122:f9eeca106725 30 #define PORT_SHIFT 5
Kojto 122:f9eeca106725 31
Kojto 122:f9eeca106725 32 typedef enum {
Kojto 122:f9eeca106725 33 // MPS2 EXP Pin Names
Kojto 122:f9eeca106725 34 EXP0 = 0 ,
Kojto 122:f9eeca106725 35 EXP1 = 4 ,
Kojto 122:f9eeca106725 36 EXP2 = 2 ,
Kojto 122:f9eeca106725 37 EXP3 = 3 ,
Kojto 122:f9eeca106725 38 EXP4 = 1 ,
Kojto 122:f9eeca106725 39 EXP5 = 15,
Kojto 122:f9eeca106725 40 EXP6 = 5 ,
Kojto 122:f9eeca106725 41 EXP7 = 6 ,
Kojto 122:f9eeca106725 42 EXP8 = 7 ,
Kojto 122:f9eeca106725 43 EXP9 = 8 ,
Kojto 122:f9eeca106725 44 EXP10 =9 ,
Kojto 122:f9eeca106725 45 EXP11 =13,
Kojto 122:f9eeca106725 46 EXP12 =10,
Kojto 122:f9eeca106725 47 EXP13 =11,
Kojto 122:f9eeca106725 48 EXP14 =12,
Kojto 122:f9eeca106725 49 EXP15 =14,
Kojto 122:f9eeca106725 50 EXP16 =18,
Kojto 122:f9eeca106725 51 EXP17 =19,
Kojto 122:f9eeca106725 52 EXP18 =20,
Kojto 122:f9eeca106725 53 EXP19 =21,
Kojto 122:f9eeca106725 54 EXP20 =52,
Kojto 122:f9eeca106725 55 EXP21 =53,
Kojto 122:f9eeca106725 56 EXP22 =54,
Kojto 122:f9eeca106725 57 EXP23 =55,
Kojto 122:f9eeca106725 58 EXP24 =56,
Kojto 122:f9eeca106725 59 EXP25 =57,
Kojto 122:f9eeca106725 60
Kojto 122:f9eeca106725 61 EXP26 =16,
Kojto 122:f9eeca106725 62 EXP27 =25,
Kojto 122:f9eeca106725 63 EXP28 =24,
Kojto 122:f9eeca106725 64 EXP29 =31,
Kojto 122:f9eeca106725 65 EXP30 =17,
Kojto 122:f9eeca106725 66 EXP31 =23,
Kojto 122:f9eeca106725 67 EXP32 =27,
Kojto 122:f9eeca106725 68 EXP33 =30,
Kojto 122:f9eeca106725 69 EXP34 =26,
Kojto 122:f9eeca106725 70 EXP35 =28,
Kojto 122:f9eeca106725 71 EXP36 =29,
Kojto 122:f9eeca106725 72 EXP37 =58,
Kojto 122:f9eeca106725 73 EXP38 =48,
Kojto 122:f9eeca106725 74 EXP39 =49,
Kojto 122:f9eeca106725 75 EXP40 =50,
Kojto 122:f9eeca106725 76 EXP41 =22,
Kojto 122:f9eeca106725 77 EXP42 =59,
Kojto 122:f9eeca106725 78 EXP43 =60,
Kojto 122:f9eeca106725 79 EXP44 =51,
Kojto 122:f9eeca106725 80 EXP45 =61,
Kojto 122:f9eeca106725 81 EXP46 =62,
Kojto 122:f9eeca106725 82 EXP47 =63,
Kojto 122:f9eeca106725 83 EXP48 =64,
Kojto 122:f9eeca106725 84 EXP49 =65,
Kojto 122:f9eeca106725 85 EXP50 =66,
Kojto 122:f9eeca106725 86 EXP51 =67,
Kojto 122:f9eeca106725 87
Kojto 122:f9eeca106725 88 // Other mbed Pin Names
Kojto 122:f9eeca106725 89
Kojto 122:f9eeca106725 90 //LEDs on mps2
Kojto 122:f9eeca106725 91 //user leds
Kojto 122:f9eeca106725 92 USERLED1 = 100,
Kojto 122:f9eeca106725 93 USERLED2 = 101,
Kojto 122:f9eeca106725 94 //user switches
Kojto 122:f9eeca106725 95 USERSW1 = 110,
Kojto 122:f9eeca106725 96 USERSW2 = 111,
Kojto 122:f9eeca106725 97
Kojto 122:f9eeca106725 98 //mcc leds
Kojto 122:f9eeca106725 99 LED1 = 200,
Kojto 122:f9eeca106725 100 LED2 = 201,
Kojto 122:f9eeca106725 101 LED3 = 202,
Kojto 122:f9eeca106725 102 LED4 = 203,
Kojto 122:f9eeca106725 103 LED5 = 204,
Kojto 122:f9eeca106725 104 LED6 = 205,
Kojto 122:f9eeca106725 105 LED7 = 206,
Kojto 122:f9eeca106725 106 LED8 = 207,
Kojto 122:f9eeca106725 107
Kojto 122:f9eeca106725 108 //MCC Switches
Kojto 122:f9eeca106725 109 SW1 = 210,
Kojto 122:f9eeca106725 110 SW2 = 211,
Kojto 122:f9eeca106725 111 SW3 = 212,
Kojto 122:f9eeca106725 112 SW4 = 213,
Kojto 122:f9eeca106725 113 SW5 = 214,
Kojto 122:f9eeca106725 114 SW6 = 215,
Kojto 122:f9eeca106725 115 SW7 = 216,
Kojto 122:f9eeca106725 116 SW8 = 217,
Kojto 122:f9eeca106725 117
Kojto 122:f9eeca106725 118 //MPS2 SPI header pins j21
Kojto 122:f9eeca106725 119 MOSI_SPI = 300,
Kojto 122:f9eeca106725 120 MISO_SPI = 301,
Kojto 122:f9eeca106725 121 SCLK_SPI = 302,
Kojto 122:f9eeca106725 122 SSEL_SPI = 303,
Kojto 122:f9eeca106725 123
Kojto 122:f9eeca106725 124 //MPS2 CLCD SPI
Kojto 122:f9eeca106725 125 CLCD_MOSI = 304,
Kojto 122:f9eeca106725 126 CLCD_MISO = 305,
Kojto 122:f9eeca106725 127 CLCD_SCLK = 306,
Kojto 122:f9eeca106725 128 CLCD_SSEL = 307,
Kojto 122:f9eeca106725 129 CLCD_RESET = 308,
Kojto 122:f9eeca106725 130 CLCD_RS = 309,
Kojto 122:f9eeca106725 131 CLCD_RD = 310,
Kojto 122:f9eeca106725 132 CLCD_BL_CTRL = 311,
Kojto 122:f9eeca106725 133
Kojto 122:f9eeca106725 134 //MPS2 shield 0 SPI
Kojto 122:f9eeca106725 135 SHIELD_0_SPI_SCK = 320,
Kojto 122:f9eeca106725 136 SHIELD_0_SPI_MOSI = 321,
Kojto 122:f9eeca106725 137 SHIELD_0_SPI_MISO = 322,
Kojto 122:f9eeca106725 138 SHIELD_0_SPI_nCS = 323,
Kojto 122:f9eeca106725 139
Kojto 122:f9eeca106725 140 //MPS2 shield 1 SPI
Kojto 122:f9eeca106725 141 SHIELD_1_SPI_SCK = 331,
Kojto 122:f9eeca106725 142 SHIELD_1_SPI_MOSI = 332,
Kojto 122:f9eeca106725 143 SHIELD_1_SPI_MISO = 333,
Kojto 122:f9eeca106725 144 SHIELD_1_SPI_nCS = 334,
Kojto 122:f9eeca106725 145
Kojto 122:f9eeca106725 146 //MPS2 shield ADC SPI
Kojto 122:f9eeca106725 147 ADC_MOSI = 650,
Kojto 122:f9eeca106725 148 ADC_MISO = 651,
Kojto 122:f9eeca106725 149 ADC_SCLK = 652,
Kojto 122:f9eeca106725 150 ADC_SSEL = 653,
Kojto 122:f9eeca106725 151
Kojto 122:f9eeca106725 152 //MPS2 Uart
Kojto 122:f9eeca106725 153 USBTX = 400,
Kojto 122:f9eeca106725 154 USBRX = 401,
Kojto 122:f9eeca106725 155 XB_TX = 402,
Kojto 122:f9eeca106725 156 XB_RX = 403,
Kojto 122:f9eeca106725 157 SH0_TX = 404,
Kojto 122:f9eeca106725 158 SH0_RX = 405,
Kojto 122:f9eeca106725 159 SH1_TX = 406,
Kojto 122:f9eeca106725 160 SH1_RX = 407,
Kojto 122:f9eeca106725 161
Kojto 122:f9eeca106725 162 //MPS2 I2C touchscreen and audio
Kojto 122:f9eeca106725 163 TSC_SDA = 500,
Kojto 122:f9eeca106725 164 TSC_SCL = 501,
Kojto 122:f9eeca106725 165 AUD_SDA = 502,
Kojto 122:f9eeca106725 166 AUD_SCL = 503,
Kojto 122:f9eeca106725 167
Kojto 122:f9eeca106725 168 //MPS2 I2C for shield
Kojto 122:f9eeca106725 169 SHIELD_0_SDA = 504,
Kojto 122:f9eeca106725 170 SHIELD_0_SCL = 505,
Kojto 122:f9eeca106725 171 SHIELD_1_SDA = 506,
Kojto 122:f9eeca106725 172 SHIELD_1_SCL = 507,
Kojto 122:f9eeca106725 173
Kojto 122:f9eeca106725 174 //MPS2 shield Analog pins
Kojto 122:f9eeca106725 175 A0_0 = 600,
Kojto 122:f9eeca106725 176 A0_1 = 601,
Kojto 122:f9eeca106725 177 A0_2 = 602,
Kojto 122:f9eeca106725 178 A0_3 = 603,
Kojto 122:f9eeca106725 179 A0_4 = 604,
Kojto 122:f9eeca106725 180 A0_5 = 605,
Kojto 122:f9eeca106725 181 A1_0 = 606,
Kojto 122:f9eeca106725 182 A1_1 = 607,
Kojto 122:f9eeca106725 183 A1_2 = 608,
Kojto 122:f9eeca106725 184 A1_3 = 609,
Kojto 122:f9eeca106725 185 A1_4 = 610,
Kojto 122:f9eeca106725 186 A1_5 = 611,
Kojto 122:f9eeca106725 187 //MPS2 Shield Digital pins
Kojto 122:f9eeca106725 188 D0_0 = EXP0,
Kojto 122:f9eeca106725 189 D0_1 = EXP4,
Kojto 122:f9eeca106725 190 D0_2 = EXP2,
Kojto 122:f9eeca106725 191 D0_3 = EXP3,
Kojto 122:f9eeca106725 192 D0_4 = EXP1,
Kojto 122:f9eeca106725 193 D0_5 = EXP6,
Kojto 122:f9eeca106725 194 D0_6 = EXP7,
Kojto 122:f9eeca106725 195 D0_7 = EXP8,
Kojto 122:f9eeca106725 196 D0_8 = EXP9,
Kojto 122:f9eeca106725 197 D0_9 = EXP10,
Kojto 122:f9eeca106725 198 D0_10 = EXP12,
Kojto 122:f9eeca106725 199 D0_11 = EXP13,
Kojto 122:f9eeca106725 200 D0_12 = EXP14,
Kojto 122:f9eeca106725 201 D0_13 = EXP11,
Kojto 122:f9eeca106725 202 D0_14 = EXP15,
Kojto 122:f9eeca106725 203 D0_15 = EXP5,
Kojto 122:f9eeca106725 204
Kojto 122:f9eeca106725 205 D1_0 = EXP26,
Kojto 122:f9eeca106725 206 D1_1 = EXP30,
Kojto 122:f9eeca106725 207 D1_2 = EXP28,
Kojto 122:f9eeca106725 208 D1_3 = EXP29,
Kojto 122:f9eeca106725 209 D1_4 = EXP27,
Kojto 122:f9eeca106725 210 D1_5 = EXP32,
Kojto 122:f9eeca106725 211 D1_6 = EXP33,
Kojto 122:f9eeca106725 212 D1_7 = EXP34,
Kojto 122:f9eeca106725 213 D1_8 = EXP35,
Kojto 122:f9eeca106725 214 D1_9 = EXP36,
Kojto 122:f9eeca106725 215 D1_10 = EXP38,
Kojto 122:f9eeca106725 216 D1_11 = EXP39,
Kojto 122:f9eeca106725 217 D1_12 = EXP40,
Kojto 122:f9eeca106725 218 D1_13 = EXP44,
Kojto 122:f9eeca106725 219 D1_14 = EXP41,
Kojto 122:f9eeca106725 220 D1_15 = EXP31,
Kojto 122:f9eeca106725 221
Kojto 122:f9eeca106725 222 // Not connected
Kojto 122:f9eeca106725 223 NC = (int)0xFFFFFFFF,
Kojto 122:f9eeca106725 224 } PinName;
Kojto 122:f9eeca106725 225
Kojto 122:f9eeca106725 226
Kojto 122:f9eeca106725 227 typedef enum {
Kojto 122:f9eeca106725 228 PullUp = 2,
Kojto 122:f9eeca106725 229 PullDown = 1,
Kojto 122:f9eeca106725 230 PullNone = 0,
Kojto 122:f9eeca106725 231 Repeater = 3,
Kojto 122:f9eeca106725 232 OpenDrain = 4,
Kojto 122:f9eeca106725 233 PullDefault = PullDown
Kojto 122:f9eeca106725 234 } PinMode;
Kojto 122:f9eeca106725 235
Kojto 122:f9eeca106725 236 #ifdef __cplusplus
Kojto 122:f9eeca106725 237 }
Kojto 122:f9eeca106725 238 #endif
Kojto 122:f9eeca106725 239
Kojto 122:f9eeca106725 240 #endif
Kojto 122:f9eeca106725 241