The official mbed 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:
Thu Nov 24 11:01:25 2016 +0000
Revision:
130:d75b3fe1f5cb
Parent:
104:b9ad9a133dc7
Release 130 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3127: Fixed the issue about push/pop of VFP register. https://github.com/ARMmbed/mbed-os/pull/3127
3176: Modifying micro:bit pin names to mirror micro:bit edge connector https://github.com/ARMmbed/mbed-os/pull/3176
3160: Fix wrong index at LPC43xx tx end ring assignment https://github.com/ARMmbed/mbed-os/pull/3160
3217: Add I2C_ASYNCH capability for DISCO_F469NI https://github.com/ARMmbed/mbed-os/pull/3217
3211: [NUC472/M453] Support single UART shared by multiple serial objects and other updates https://github.com/ARMmbed/mbed-os/pull/3211
3198: NUCLEO_F410RB: Add I2C_ASYNCH capability https://github.com/ARMmbed/mbed-os/pull/3198
3194: Update K64 sdk drivers https://github.com/ARMmbed/mbed-os/pull/3194
3159: User trim values for NCS36510 https://github.com/ARMmbed/mbed-os/pull/3159
3243: Fix make exporters compilation https://github.com/ARMmbed/mbed-os/pull/3243
3231: STM32F3: DISCO_F303VC - Add missing UART and ADC pin muxing options https://github.com/ARMmbed/mbed-os/pull/3231
3233: K20xx Calculate PWM clock relative to bus clock https://github.com/ARMmbed/mbed-os/pull/3233
3237: Added back USART 6 pins https://github.com/ARMmbed/mbed-os/pull/3237
3253: Fix default polarity on LPC43XX PWM driver https://github.com/ARMmbed/mbed-os/pull/3253
3238: Dev i2c stm32f4hal https://github.com/ARMmbed/mbed-os/pull/3238
3251: Dev stm32l0 cube v1.7.0 https://github.com/ARMmbed/mbed-os/pull/3251
3252: [NORDIC - NRF51 - MBED 2] Fix non handled RTC IRQ https://github.com/ARMmbed/mbed-os/pull/3252

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 104:b9ad9a133dc7 1 /* mbed Microcontroller Library
Kojto 104:b9ad9a133dc7 2 * Copyright (c) 2013 Nordic Semiconductor
Kojto 104:b9ad9a133dc7 3 *
Kojto 104:b9ad9a133dc7 4 * Licensed under the Apache License, Version 2.0 (the "License");
Kojto 104:b9ad9a133dc7 5 * you may not use this file except in compliance with the License.
Kojto 104:b9ad9a133dc7 6 * You may obtain a copy of the License at
Kojto 104:b9ad9a133dc7 7 *
Kojto 104:b9ad9a133dc7 8 * http://www.apache.org/licenses/LICENSE-2.0
Kojto 104:b9ad9a133dc7 9 *
Kojto 104:b9ad9a133dc7 10 * Unless required by applicable law or agreed to in writing, software
Kojto 104:b9ad9a133dc7 11 * distributed under the License is distributed on an "AS IS" BASIS,
Kojto 104:b9ad9a133dc7 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Kojto 104:b9ad9a133dc7 13 * See the License for the specific language governing permissions and
Kojto 104:b9ad9a133dc7 14 * limitations under the License.
Kojto 104:b9ad9a133dc7 15 */
Kojto 104:b9ad9a133dc7 16 #ifndef MBED_PINNAMES_H
Kojto 104:b9ad9a133dc7 17 #define MBED_PINNAMES_H
Kojto 104:b9ad9a133dc7 18
Kojto 104:b9ad9a133dc7 19 #include "cmsis.h"
Kojto 104:b9ad9a133dc7 20
Kojto 104:b9ad9a133dc7 21 #ifdef __cplusplus
Kojto 104:b9ad9a133dc7 22 extern "C" {
Kojto 104:b9ad9a133dc7 23 #endif
Kojto 104:b9ad9a133dc7 24
Kojto 104:b9ad9a133dc7 25 typedef enum {
Kojto 104:b9ad9a133dc7 26 PIN_INPUT,
Kojto 104:b9ad9a133dc7 27 PIN_OUTPUT
Kojto 104:b9ad9a133dc7 28 } PinDirection;
Kojto 104:b9ad9a133dc7 29
Kojto 104:b9ad9a133dc7 30 #define PORT_SHIFT 3
Kojto 104:b9ad9a133dc7 31
Kojto 104:b9ad9a133dc7 32 typedef enum {
<> 130:d75b3fe1f5cb 33 //MCU PINS
<> 130:d75b3fe1f5cb 34 P0_0 = 0,
<> 130:d75b3fe1f5cb 35 P0_1 = 1,
<> 130:d75b3fe1f5cb 36 P0_2 = 2,
<> 130:d75b3fe1f5cb 37 P0_3 = 3,
<> 130:d75b3fe1f5cb 38 P0_4 = 4,
<> 130:d75b3fe1f5cb 39 P0_5 = 5,
<> 130:d75b3fe1f5cb 40 P0_6 = 6,
<> 130:d75b3fe1f5cb 41 P0_7 = 7,
<> 130:d75b3fe1f5cb 42 P0_8 = 8,
<> 130:d75b3fe1f5cb 43 P0_9 = 9,
<> 130:d75b3fe1f5cb 44 P0_10 = 10,
<> 130:d75b3fe1f5cb 45 P0_11 = 11,
<> 130:d75b3fe1f5cb 46 P0_12 = 12,
<> 130:d75b3fe1f5cb 47 P0_13 = 13,
<> 130:d75b3fe1f5cb 48 P0_14 = 14,
<> 130:d75b3fe1f5cb 49 P0_15 = 15,
<> 130:d75b3fe1f5cb 50 P0_16 = 16,
<> 130:d75b3fe1f5cb 51 P0_17 = 17,
<> 130:d75b3fe1f5cb 52 P0_18 = 18,
<> 130:d75b3fe1f5cb 53 P0_19 = 19,
<> 130:d75b3fe1f5cb 54 P0_20 = 20,
<> 130:d75b3fe1f5cb 55 P0_21 = 21,
<> 130:d75b3fe1f5cb 56 P0_22 = 22,
<> 130:d75b3fe1f5cb 57 P0_23 = 23,
<> 130:d75b3fe1f5cb 58 P0_24 = 24,
<> 130:d75b3fe1f5cb 59 P0_25 = 25,
<> 130:d75b3fe1f5cb 60 P0_26 = 26,
<> 130:d75b3fe1f5cb 61 P0_27 = 27,
<> 130:d75b3fe1f5cb 62 P0_28 = 28,
<> 130:d75b3fe1f5cb 63 P0_29 = 29,
<> 130:d75b3fe1f5cb 64 P0_30 = 30,
<> 130:d75b3fe1f5cb 65
<> 130:d75b3fe1f5cb 66 //MICROBIT EDGE CONNECTOR PINS
<> 130:d75b3fe1f5cb 67 P0 = P0_3,
<> 130:d75b3fe1f5cb 68 P1 = P0_2,
<> 130:d75b3fe1f5cb 69 P2 = P0_1,
<> 130:d75b3fe1f5cb 70 P3 = P0_4,
<> 130:d75b3fe1f5cb 71 P4 = P0_5,
<> 130:d75b3fe1f5cb 72 P5 = P0_17,
<> 130:d75b3fe1f5cb 73 P6 = P0_12,
<> 130:d75b3fe1f5cb 74 P7 = P0_11,
<> 130:d75b3fe1f5cb 75 P8 = P0_18,
<> 130:d75b3fe1f5cb 76 P9 = P0_10,
<> 130:d75b3fe1f5cb 77 P10 = P0_6,
<> 130:d75b3fe1f5cb 78 P11 = P0_26,
<> 130:d75b3fe1f5cb 79 P12 = P0_20,
<> 130:d75b3fe1f5cb 80 P13 = P0_23,
<> 130:d75b3fe1f5cb 81 P14 = P0_22,
<> 130:d75b3fe1f5cb 82 P15 = P0_21,
<> 130:d75b3fe1f5cb 83 P16 = P0_16,
<> 130:d75b3fe1f5cb 84 P19 = P0_0,
<> 130:d75b3fe1f5cb 85 P20 = P0_30,
<> 130:d75b3fe1f5cb 86
Kojto 104:b9ad9a133dc7 87 //PADS
<> 130:d75b3fe1f5cb 88 PAD3 = P0_1,
<> 130:d75b3fe1f5cb 89 PAD2 = P0_2,
<> 130:d75b3fe1f5cb 90 PAD1 = P0_3,
Kojto 104:b9ad9a133dc7 91
Kojto 104:b9ad9a133dc7 92
Kojto 104:b9ad9a133dc7 93 //LED MATRIX COLS
<> 130:d75b3fe1f5cb 94 COL1 = P0_4,
<> 130:d75b3fe1f5cb 95 COL2 = P0_5,
<> 130:d75b3fe1f5cb 96 COL3 = P0_6,
<> 130:d75b3fe1f5cb 97 COL4 = P0_7,
<> 130:d75b3fe1f5cb 98 COL5 = P0_8,
<> 130:d75b3fe1f5cb 99 COL6 = P0_9,
<> 130:d75b3fe1f5cb 100 COL7 = P0_10,
<> 130:d75b3fe1f5cb 101 COL8 = P0_11,
<> 130:d75b3fe1f5cb 102 COL9 = P0_12,
Kojto 104:b9ad9a133dc7 103
Kojto 104:b9ad9a133dc7 104 //LED MATRIX ROWS
<> 130:d75b3fe1f5cb 105 ROW1 = P0_13,
<> 130:d75b3fe1f5cb 106 ROW2 = P0_14,
<> 130:d75b3fe1f5cb 107 ROW3 = P0_15,
Kojto 104:b9ad9a133dc7 108
Kojto 104:b9ad9a133dc7 109 //NORMAL PIN (NO SPECIFIED FUNCTIONALITY)
Kojto 104:b9ad9a133dc7 110 //PIN_16
Kojto 104:b9ad9a133dc7 111
Kojto 104:b9ad9a133dc7 112 // BUTTON A
<> 130:d75b3fe1f5cb 113 BUTTON_A = P0_17,
Kojto 104:b9ad9a133dc7 114
Kojto 104:b9ad9a133dc7 115
Kojto 104:b9ad9a133dc7 116 //NORMAL PIN (NO SPECIFIED FUNCTIONALITY)
Kojto 104:b9ad9a133dc7 117 //PIN_18
Kojto 104:b9ad9a133dc7 118
Kojto 104:b9ad9a133dc7 119 //TARGET RESET
<> 130:d75b3fe1f5cb 120 TGT_NRESET = P0_19,
Kojto 104:b9ad9a133dc7 121
Kojto 104:b9ad9a133dc7 122 //NORMAL PIN (NO SPECIFIED FUNCTIONALITY)
Kojto 104:b9ad9a133dc7 123 //PIN_20
Kojto 104:b9ad9a133dc7 124
Kojto 104:b9ad9a133dc7 125 //MASTER OUT SLAVE IN
<> 130:d75b3fe1f5cb 126 MOSI = P0_21,
Kojto 104:b9ad9a133dc7 127
Kojto 104:b9ad9a133dc7 128 //MASTER IN SLAVE OUT
<> 130:d75b3fe1f5cb 129 MISO = P0_22,
Kojto 104:b9ad9a133dc7 130
Kojto 104:b9ad9a133dc7 131 //SERIAL CLOCK
<> 130:d75b3fe1f5cb 132 SCK = P0_23,
Kojto 104:b9ad9a133dc7 133
Kojto 104:b9ad9a133dc7 134 // RX AND TX PINS
<> 130:d75b3fe1f5cb 135 TGT_TX = P0_24,
<> 130:d75b3fe1f5cb 136 TGT_RX = P0_25,
Kojto 104:b9ad9a133dc7 137
Kojto 104:b9ad9a133dc7 138 //BUTTON B
<> 130:d75b3fe1f5cb 139 BUTTON_B = P0_26,
Kojto 104:b9ad9a133dc7 140
Kojto 104:b9ad9a133dc7 141 //ACCEL INTERRUPT PINS (MMA8653FC)
<> 130:d75b3fe1f5cb 142 ACCEL_INT2 = P0_27,
<> 130:d75b3fe1f5cb 143 ACCEL_INT1 = P0_28,
Kojto 104:b9ad9a133dc7 144
Kojto 104:b9ad9a133dc7 145 //MAGENETOMETER INTERRUPT PIN (MAG3110)
<> 130:d75b3fe1f5cb 146 MAG_INT1 = P0_29,
Kojto 104:b9ad9a133dc7 147
Kojto 104:b9ad9a133dc7 148 // Not connected
Kojto 104:b9ad9a133dc7 149 NC = (int)0xFFFFFFFF,
Kojto 104:b9ad9a133dc7 150
Kojto 104:b9ad9a133dc7 151 RX_PIN_NUMBER = TGT_RX,
Kojto 104:b9ad9a133dc7 152 TX_PIN_NUMBER = TGT_TX,
Kojto 104:b9ad9a133dc7 153 CTS_PIN_NUMBER = 31, //unused ** REQUIRES A PROPER FIX **
Kojto 104:b9ad9a133dc7 154 RTS_PIN_NUMBER = 31, //unused
Kojto 104:b9ad9a133dc7 155
Kojto 104:b9ad9a133dc7 156 // mBed interface Pins
Kojto 104:b9ad9a133dc7 157 USBTX = TX_PIN_NUMBER,
Kojto 104:b9ad9a133dc7 158 USBRX = RX_PIN_NUMBER,
Kojto 104:b9ad9a133dc7 159
Kojto 104:b9ad9a133dc7 160 LED1 = PAD1,
Kojto 104:b9ad9a133dc7 161 LED2 = PAD2,
Kojto 104:b9ad9a133dc7 162 LED3 = PAD3,
Kojto 104:b9ad9a133dc7 163 LED4 = P0_16,
Kojto 104:b9ad9a133dc7 164
Kojto 104:b9ad9a133dc7 165 //SDA (SERIAL DATA LINE)
<> 130:d75b3fe1f5cb 166 I2C_SDA0 = P0_30,
Kojto 104:b9ad9a133dc7 167
Kojto 104:b9ad9a133dc7 168 //SCL (SERIAL CLOCK LINE)
<> 130:d75b3fe1f5cb 169 I2C_SCL0 = P0_0
Kojto 104:b9ad9a133dc7 170
Kojto 104:b9ad9a133dc7 171 } PinName;
Kojto 104:b9ad9a133dc7 172
Kojto 104:b9ad9a133dc7 173 typedef enum {
Kojto 104:b9ad9a133dc7 174 PullNone = 0,
Kojto 104:b9ad9a133dc7 175 PullDown = 1,
Kojto 104:b9ad9a133dc7 176 PullUp = 3,
Kojto 104:b9ad9a133dc7 177 PullDefault = PullUp
Kojto 104:b9ad9a133dc7 178 } PinMode;
Kojto 104:b9ad9a133dc7 179
Kojto 104:b9ad9a133dc7 180 #ifdef __cplusplus
Kojto 104:b9ad9a133dc7 181 }
Kojto 104:b9ad9a133dc7 182 #endif
Kojto 104:b9ad9a133dc7 183
Kojto 104:b9ad9a133dc7 184 #endif