mbed library sources
Fork of mbed-src by
targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/PinNames.h@56:99eb381a3269, 2013-12-12 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Dec 12 10:45:05 2013 +0000
- Revision:
- 56:99eb381a3269
- Parent:
- 52:a51c77007319
- Child:
- 70:c1fbde68b492
Synchronized with git revision bd51e4eb73a1706f1d5379ec5cebcbd6d978cb4f
Full URL: https://github.com/mbedmicro/mbed/commit/bd51e4eb73a1706f1d5379ec5cebcbd6d978cb4f/
[NUCLEO_F103RB] Add I2C master, code cleanup, ...
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 52:a51c77007319 | 1 | /* mbed Microcontroller Library |
mbed_official | 52:a51c77007319 | 2 | * Copyright (c) 2006-2013 ARM Limited |
mbed_official | 52:a51c77007319 | 3 | * |
mbed_official | 52:a51c77007319 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
mbed_official | 52:a51c77007319 | 5 | * you may not use this file except in compliance with the License. |
mbed_official | 52:a51c77007319 | 6 | * You may obtain a copy of the License at |
mbed_official | 52:a51c77007319 | 7 | * |
mbed_official | 52:a51c77007319 | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
mbed_official | 52:a51c77007319 | 9 | * |
mbed_official | 52:a51c77007319 | 10 | * Unless required by applicable law or agreed to in writing, software |
mbed_official | 52:a51c77007319 | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
mbed_official | 52:a51c77007319 | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
mbed_official | 52:a51c77007319 | 13 | * See the License for the specific language governing permissions and |
mbed_official | 52:a51c77007319 | 14 | * limitations under the License. |
mbed_official | 52:a51c77007319 | 15 | */ |
mbed_official | 52:a51c77007319 | 16 | #ifndef MBED_PINNAMES_H |
mbed_official | 52:a51c77007319 | 17 | #define MBED_PINNAMES_H |
mbed_official | 52:a51c77007319 | 18 | |
mbed_official | 52:a51c77007319 | 19 | #include "cmsis.h" |
mbed_official | 52:a51c77007319 | 20 | |
mbed_official | 52:a51c77007319 | 21 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 22 | extern "C" { |
mbed_official | 52:a51c77007319 | 23 | #endif |
mbed_official | 52:a51c77007319 | 24 | |
mbed_official | 52:a51c77007319 | 25 | // MODE (see GPIOMode_TypeDef structure) |
mbed_official | 52:a51c77007319 | 26 | // AFNUM (see AF_mapping constant table) |
mbed_official | 52:a51c77007319 | 27 | #define STM_PIN_DATA(MODE, AFNUM) (((MODE) << 8) | (AFNUM)) |
mbed_official | 52:a51c77007319 | 28 | #define STM_PIN_MODE(X) ((X) >> 8) |
mbed_official | 52:a51c77007319 | 29 | #define STM_PIN_AFNUM(X) ((X) & 0xFF) |
mbed_official | 52:a51c77007319 | 30 | |
mbed_official | 52:a51c77007319 | 31 | typedef enum { |
mbed_official | 52:a51c77007319 | 32 | PIN_INPUT, |
mbed_official | 52:a51c77007319 | 33 | PIN_OUTPUT |
mbed_official | 52:a51c77007319 | 34 | } PinDirection; |
mbed_official | 52:a51c77007319 | 35 | |
mbed_official | 52:a51c77007319 | 36 | typedef enum { |
mbed_official | 52:a51c77007319 | 37 | |
mbed_official | 52:a51c77007319 | 38 | // high nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F) |
mbed_official | 52:a51c77007319 | 39 | // low nibble = pin number |
mbed_official | 52:a51c77007319 | 40 | PA_0 = 0x00, |
mbed_official | 52:a51c77007319 | 41 | PA_1 = 0x01, |
mbed_official | 52:a51c77007319 | 42 | PA_2 = 0x02, |
mbed_official | 52:a51c77007319 | 43 | PA_3 = 0x03, |
mbed_official | 52:a51c77007319 | 44 | PA_4 = 0x04, |
mbed_official | 52:a51c77007319 | 45 | PA_5 = 0x05, |
mbed_official | 52:a51c77007319 | 46 | PA_6 = 0x06, |
mbed_official | 52:a51c77007319 | 47 | PA_7 = 0x07, |
mbed_official | 52:a51c77007319 | 48 | PA_8 = 0x08, |
mbed_official | 52:a51c77007319 | 49 | PA_9 = 0x09, |
mbed_official | 52:a51c77007319 | 50 | PA_10 = 0x0A, |
mbed_official | 52:a51c77007319 | 51 | PA_11 = 0x0B, |
mbed_official | 52:a51c77007319 | 52 | PA_12 = 0x0C, |
mbed_official | 52:a51c77007319 | 53 | PA_13 = 0x0D, |
mbed_official | 52:a51c77007319 | 54 | PA_14 = 0x0E, |
mbed_official | 52:a51c77007319 | 55 | PA_15 = 0x0F, |
mbed_official | 52:a51c77007319 | 56 | |
mbed_official | 52:a51c77007319 | 57 | PB_0 = 0x10, |
mbed_official | 52:a51c77007319 | 58 | PB_1 = 0x11, |
mbed_official | 52:a51c77007319 | 59 | PB_2 = 0x12, |
mbed_official | 52:a51c77007319 | 60 | PB_3 = 0x13, |
mbed_official | 52:a51c77007319 | 61 | PB_4 = 0x14, |
mbed_official | 52:a51c77007319 | 62 | PB_5 = 0x15, |
mbed_official | 52:a51c77007319 | 63 | PB_6 = 0x16, |
mbed_official | 52:a51c77007319 | 64 | PB_7 = 0x17, |
mbed_official | 52:a51c77007319 | 65 | PB_8 = 0x18, |
mbed_official | 52:a51c77007319 | 66 | PB_9 = 0x19, |
mbed_official | 52:a51c77007319 | 67 | PB_10 = 0x1A, |
mbed_official | 52:a51c77007319 | 68 | PB_11 = 0x1B, |
mbed_official | 52:a51c77007319 | 69 | PB_12 = 0x1C, |
mbed_official | 52:a51c77007319 | 70 | PB_13 = 0x1D, |
mbed_official | 52:a51c77007319 | 71 | PB_14 = 0x1E, |
mbed_official | 52:a51c77007319 | 72 | PB_15 = 0x1F, |
mbed_official | 52:a51c77007319 | 73 | |
mbed_official | 52:a51c77007319 | 74 | PC_0 = 0x20, |
mbed_official | 52:a51c77007319 | 75 | PC_1 = 0x21, |
mbed_official | 52:a51c77007319 | 76 | PC_2 = 0x22, |
mbed_official | 52:a51c77007319 | 77 | PC_3 = 0x23, |
mbed_official | 52:a51c77007319 | 78 | PC_4 = 0x24, |
mbed_official | 52:a51c77007319 | 79 | PC_5 = 0x25, |
mbed_official | 52:a51c77007319 | 80 | PC_6 = 0x26, |
mbed_official | 52:a51c77007319 | 81 | PC_7 = 0x27, |
mbed_official | 52:a51c77007319 | 82 | PC_8 = 0x28, |
mbed_official | 52:a51c77007319 | 83 | PC_9 = 0x29, |
mbed_official | 52:a51c77007319 | 84 | PC_10 = 0x2A, |
mbed_official | 52:a51c77007319 | 85 | PC_11 = 0x2B, |
mbed_official | 52:a51c77007319 | 86 | PC_12 = 0x2C, |
mbed_official | 52:a51c77007319 | 87 | PC_13 = 0x2D, |
mbed_official | 52:a51c77007319 | 88 | PC_14 = 0x2E, |
mbed_official | 52:a51c77007319 | 89 | PC_15 = 0x2F, |
mbed_official | 52:a51c77007319 | 90 | |
mbed_official | 52:a51c77007319 | 91 | PD_2 = 0x32, |
mbed_official | 52:a51c77007319 | 92 | PD_8 = 0x38, |
mbed_official | 52:a51c77007319 | 93 | |
mbed_official | 56:99eb381a3269 | 94 | // Arduino connector namings |
mbed_official | 52:a51c77007319 | 95 | A0 = PA_0, |
mbed_official | 52:a51c77007319 | 96 | A1 = PA_1, |
mbed_official | 52:a51c77007319 | 97 | A2 = PA_4, |
mbed_official | 52:a51c77007319 | 98 | A3 = PB_0, |
mbed_official | 52:a51c77007319 | 99 | A4 = PC_1, |
mbed_official | 52:a51c77007319 | 100 | A5 = PC_0, |
mbed_official | 52:a51c77007319 | 101 | D0 = PA_3, |
mbed_official | 52:a51c77007319 | 102 | D1 = PA_2, |
mbed_official | 52:a51c77007319 | 103 | D2 = PA_10, |
mbed_official | 52:a51c77007319 | 104 | D3 = PB_3, |
mbed_official | 52:a51c77007319 | 105 | D4 = PB_5, |
mbed_official | 52:a51c77007319 | 106 | D5 = PB_4, |
mbed_official | 52:a51c77007319 | 107 | D6 = PB_10, |
mbed_official | 52:a51c77007319 | 108 | D7 = PA_8, |
mbed_official | 52:a51c77007319 | 109 | D8 = PA_9, |
mbed_official | 52:a51c77007319 | 110 | D9 = PC_7, |
mbed_official | 52:a51c77007319 | 111 | D10 = PB_6, |
mbed_official | 52:a51c77007319 | 112 | D11 = PA_7, |
mbed_official | 52:a51c77007319 | 113 | D12 = PA_6, |
mbed_official | 52:a51c77007319 | 114 | D13 = PA_5, |
mbed_official | 52:a51c77007319 | 115 | D14 = PB_9, |
mbed_official | 52:a51c77007319 | 116 | D15 = PB_8, |
mbed_official | 52:a51c77007319 | 117 | |
mbed_official | 56:99eb381a3269 | 118 | // Generic signals namings |
mbed_official | 56:99eb381a3269 | 119 | LED1 = PA_5, |
mbed_official | 56:99eb381a3269 | 120 | LED2 = PA_5, |
mbed_official | 56:99eb381a3269 | 121 | LED3 = PA_5, |
mbed_official | 56:99eb381a3269 | 122 | LED4 = PA_5, |
mbed_official | 52:a51c77007319 | 123 | USER_BUTTON = PC_13, |
mbed_official | 56:99eb381a3269 | 124 | SERIAL_TX = PA_2, |
mbed_official | 56:99eb381a3269 | 125 | SERIAL_RX = PA_3, |
mbed_official | 56:99eb381a3269 | 126 | I2C_SCL = PB_8, |
mbed_official | 56:99eb381a3269 | 127 | I2C_SDA = PB_9, |
mbed_official | 56:99eb381a3269 | 128 | SPI_MOSI = PA_7, |
mbed_official | 56:99eb381a3269 | 129 | SPI_MISO = PA_6, |
mbed_official | 56:99eb381a3269 | 130 | SPI_SCK = PA_5, |
mbed_official | 56:99eb381a3269 | 131 | SPI_CS = PB_6, |
mbed_official | 56:99eb381a3269 | 132 | PWM_OUT = PB_3, |
mbed_official | 52:a51c77007319 | 133 | |
mbed_official | 52:a51c77007319 | 134 | // Not connected |
mbed_official | 52:a51c77007319 | 135 | NC = (int)0xFFFFFFFF |
mbed_official | 52:a51c77007319 | 136 | } PinName; |
mbed_official | 52:a51c77007319 | 137 | |
mbed_official | 52:a51c77007319 | 138 | typedef enum { |
mbed_official | 52:a51c77007319 | 139 | PullNone = 0, |
mbed_official | 52:a51c77007319 | 140 | PullUp = 1, |
mbed_official | 52:a51c77007319 | 141 | PullDown = 2, |
mbed_official | 52:a51c77007319 | 142 | OpenDrain = 3 |
mbed_official | 52:a51c77007319 | 143 | } PinMode; |
mbed_official | 52:a51c77007319 | 144 | |
mbed_official | 52:a51c77007319 | 145 | #ifdef __cplusplus |
mbed_official | 52:a51c77007319 | 146 | } |
mbed_official | 52:a51c77007319 | 147 | #endif |
mbed_official | 52:a51c77007319 | 148 | |
mbed_official | 52:a51c77007319 | 149 | #endif |