mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Tue Jan 07 11:00:05 2014 +0000
Revision:
70:c1fbde68b492
Parent:
56:99eb381a3269
Child:
76:aeb1df146756
Synchronized with git revision 3f438a307904431f2782db3c8fa49946b9fc1d85

Full URL: https://github.com/mbedmicro/mbed/commit/3f438a307904431f2782db3c8fa49946b9fc1d85/

[NUCLEO_F103RB] license text changed + sleep hal updated

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 52:a51c77007319 1 /* mbed Microcontroller Library
mbed_official 70:c1fbde68b492 2 *******************************************************************************
mbed_official 70:c1fbde68b492 3 * Copyright (c) 2014, STMicroelectronics
mbed_official 70:c1fbde68b492 4 * All rights reserved.
mbed_official 52:a51c77007319 5 *
mbed_official 70:c1fbde68b492 6 * Redistribution and use in source and binary forms, with or without
mbed_official 70:c1fbde68b492 7 * modification, are permitted provided that the following conditions are met:
mbed_official 52:a51c77007319 8 *
mbed_official 70:c1fbde68b492 9 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 70:c1fbde68b492 10 * this list of conditions and the following disclaimer.
mbed_official 70:c1fbde68b492 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 70:c1fbde68b492 12 * this list of conditions and the following disclaimer in the documentation
mbed_official 70:c1fbde68b492 13 * and/or other materials provided with the distribution.
mbed_official 70:c1fbde68b492 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 70:c1fbde68b492 15 * may be used to endorse or promote products derived from this software
mbed_official 70:c1fbde68b492 16 * without specific prior written permission.
mbed_official 52:a51c77007319 17 *
mbed_official 70:c1fbde68b492 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 70:c1fbde68b492 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 70:c1fbde68b492 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 70:c1fbde68b492 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 70:c1fbde68b492 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 70:c1fbde68b492 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 70:c1fbde68b492 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 70:c1fbde68b492 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 70:c1fbde68b492 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 70:c1fbde68b492 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 70:c1fbde68b492 28 *******************************************************************************
mbed_official 52:a51c77007319 29 */
mbed_official 52:a51c77007319 30 #ifndef MBED_PINNAMES_H
mbed_official 52:a51c77007319 31 #define MBED_PINNAMES_H
mbed_official 52:a51c77007319 32
mbed_official 52:a51c77007319 33 #include "cmsis.h"
mbed_official 52:a51c77007319 34
mbed_official 52:a51c77007319 35 #ifdef __cplusplus
mbed_official 52:a51c77007319 36 extern "C" {
mbed_official 52:a51c77007319 37 #endif
mbed_official 52:a51c77007319 38
mbed_official 52:a51c77007319 39 // MODE (see GPIOMode_TypeDef structure)
mbed_official 52:a51c77007319 40 // AFNUM (see AF_mapping constant table)
mbed_official 52:a51c77007319 41 #define STM_PIN_DATA(MODE, AFNUM) (((MODE) << 8) | (AFNUM))
mbed_official 52:a51c77007319 42 #define STM_PIN_MODE(X) ((X) >> 8)
mbed_official 52:a51c77007319 43 #define STM_PIN_AFNUM(X) ((X) & 0xFF)
mbed_official 52:a51c77007319 44
mbed_official 52:a51c77007319 45 typedef enum {
mbed_official 52:a51c77007319 46 PIN_INPUT,
mbed_official 52:a51c77007319 47 PIN_OUTPUT
mbed_official 52:a51c77007319 48 } PinDirection;
mbed_official 52:a51c77007319 49
mbed_official 52:a51c77007319 50 typedef enum {
mbed_official 52:a51c77007319 51
mbed_official 52:a51c77007319 52 // high nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F)
mbed_official 52:a51c77007319 53 // low nibble = pin number
mbed_official 52:a51c77007319 54 PA_0 = 0x00,
mbed_official 52:a51c77007319 55 PA_1 = 0x01,
mbed_official 52:a51c77007319 56 PA_2 = 0x02,
mbed_official 52:a51c77007319 57 PA_3 = 0x03,
mbed_official 52:a51c77007319 58 PA_4 = 0x04,
mbed_official 52:a51c77007319 59 PA_5 = 0x05,
mbed_official 52:a51c77007319 60 PA_6 = 0x06,
mbed_official 52:a51c77007319 61 PA_7 = 0x07,
mbed_official 52:a51c77007319 62 PA_8 = 0x08,
mbed_official 52:a51c77007319 63 PA_9 = 0x09,
mbed_official 52:a51c77007319 64 PA_10 = 0x0A,
mbed_official 52:a51c77007319 65 PA_11 = 0x0B,
mbed_official 52:a51c77007319 66 PA_12 = 0x0C,
mbed_official 52:a51c77007319 67 PA_13 = 0x0D,
mbed_official 52:a51c77007319 68 PA_14 = 0x0E,
mbed_official 52:a51c77007319 69 PA_15 = 0x0F,
mbed_official 52:a51c77007319 70
mbed_official 52:a51c77007319 71 PB_0 = 0x10,
mbed_official 52:a51c77007319 72 PB_1 = 0x11,
mbed_official 52:a51c77007319 73 PB_2 = 0x12,
mbed_official 52:a51c77007319 74 PB_3 = 0x13,
mbed_official 52:a51c77007319 75 PB_4 = 0x14,
mbed_official 52:a51c77007319 76 PB_5 = 0x15,
mbed_official 52:a51c77007319 77 PB_6 = 0x16,
mbed_official 52:a51c77007319 78 PB_7 = 0x17,
mbed_official 52:a51c77007319 79 PB_8 = 0x18,
mbed_official 52:a51c77007319 80 PB_9 = 0x19,
mbed_official 52:a51c77007319 81 PB_10 = 0x1A,
mbed_official 52:a51c77007319 82 PB_11 = 0x1B,
mbed_official 52:a51c77007319 83 PB_12 = 0x1C,
mbed_official 52:a51c77007319 84 PB_13 = 0x1D,
mbed_official 52:a51c77007319 85 PB_14 = 0x1E,
mbed_official 52:a51c77007319 86 PB_15 = 0x1F,
mbed_official 52:a51c77007319 87
mbed_official 52:a51c77007319 88 PC_0 = 0x20,
mbed_official 52:a51c77007319 89 PC_1 = 0x21,
mbed_official 52:a51c77007319 90 PC_2 = 0x22,
mbed_official 52:a51c77007319 91 PC_3 = 0x23,
mbed_official 52:a51c77007319 92 PC_4 = 0x24,
mbed_official 52:a51c77007319 93 PC_5 = 0x25,
mbed_official 52:a51c77007319 94 PC_6 = 0x26,
mbed_official 52:a51c77007319 95 PC_7 = 0x27,
mbed_official 52:a51c77007319 96 PC_8 = 0x28,
mbed_official 52:a51c77007319 97 PC_9 = 0x29,
mbed_official 52:a51c77007319 98 PC_10 = 0x2A,
mbed_official 52:a51c77007319 99 PC_11 = 0x2B,
mbed_official 52:a51c77007319 100 PC_12 = 0x2C,
mbed_official 52:a51c77007319 101 PC_13 = 0x2D,
mbed_official 52:a51c77007319 102 PC_14 = 0x2E,
mbed_official 52:a51c77007319 103 PC_15 = 0x2F,
mbed_official 52:a51c77007319 104
mbed_official 52:a51c77007319 105 PD_2 = 0x32,
mbed_official 52:a51c77007319 106 PD_8 = 0x38,
mbed_official 52:a51c77007319 107
mbed_official 56:99eb381a3269 108 // Arduino connector namings
mbed_official 52:a51c77007319 109 A0 = PA_0,
mbed_official 52:a51c77007319 110 A1 = PA_1,
mbed_official 52:a51c77007319 111 A2 = PA_4,
mbed_official 52:a51c77007319 112 A3 = PB_0,
mbed_official 52:a51c77007319 113 A4 = PC_1,
mbed_official 52:a51c77007319 114 A5 = PC_0,
mbed_official 52:a51c77007319 115 D0 = PA_3,
mbed_official 52:a51c77007319 116 D1 = PA_2,
mbed_official 52:a51c77007319 117 D2 = PA_10,
mbed_official 52:a51c77007319 118 D3 = PB_3,
mbed_official 52:a51c77007319 119 D4 = PB_5,
mbed_official 52:a51c77007319 120 D5 = PB_4,
mbed_official 52:a51c77007319 121 D6 = PB_10,
mbed_official 52:a51c77007319 122 D7 = PA_8,
mbed_official 52:a51c77007319 123 D8 = PA_9,
mbed_official 52:a51c77007319 124 D9 = PC_7,
mbed_official 52:a51c77007319 125 D10 = PB_6,
mbed_official 52:a51c77007319 126 D11 = PA_7,
mbed_official 52:a51c77007319 127 D12 = PA_6,
mbed_official 52:a51c77007319 128 D13 = PA_5,
mbed_official 52:a51c77007319 129 D14 = PB_9,
mbed_official 52:a51c77007319 130 D15 = PB_8,
mbed_official 52:a51c77007319 131
mbed_official 56:99eb381a3269 132 // Generic signals namings
mbed_official 56:99eb381a3269 133 LED1 = PA_5,
mbed_official 56:99eb381a3269 134 LED2 = PA_5,
mbed_official 56:99eb381a3269 135 LED3 = PA_5,
mbed_official 56:99eb381a3269 136 LED4 = PA_5,
mbed_official 52:a51c77007319 137 USER_BUTTON = PC_13,
mbed_official 56:99eb381a3269 138 SERIAL_TX = PA_2,
mbed_official 56:99eb381a3269 139 SERIAL_RX = PA_3,
mbed_official 56:99eb381a3269 140 I2C_SCL = PB_8,
mbed_official 56:99eb381a3269 141 I2C_SDA = PB_9,
mbed_official 56:99eb381a3269 142 SPI_MOSI = PA_7,
mbed_official 56:99eb381a3269 143 SPI_MISO = PA_6,
mbed_official 56:99eb381a3269 144 SPI_SCK = PA_5,
mbed_official 56:99eb381a3269 145 SPI_CS = PB_6,
mbed_official 56:99eb381a3269 146 PWM_OUT = PB_3,
mbed_official 52:a51c77007319 147
mbed_official 52:a51c77007319 148 // Not connected
mbed_official 52:a51c77007319 149 NC = (int)0xFFFFFFFF
mbed_official 52:a51c77007319 150 } PinName;
mbed_official 52:a51c77007319 151
mbed_official 52:a51c77007319 152 typedef enum {
mbed_official 52:a51c77007319 153 PullNone = 0,
mbed_official 52:a51c77007319 154 PullUp = 1,
mbed_official 52:a51c77007319 155 PullDown = 2,
mbed_official 52:a51c77007319 156 OpenDrain = 3
mbed_official 52:a51c77007319 157 } PinMode;
mbed_official 52:a51c77007319 158
mbed_official 52:a51c77007319 159 #ifdef __cplusplus
mbed_official 52:a51c77007319 160 }
mbed_official 52:a51c77007319 161 #endif
mbed_official 52:a51c77007319 162
mbed_official 52:a51c77007319 163 #endif