mbed library sources
Fork of mbed-src by
targets/hal/TARGET_STM/TARGET_STM32F3/TARGET_DISCO_F303VC/PinNames.h@636:b0d178e9fa10, 2016-07-07 (annotated)
- Committer:
- lzbpli
- Date:
- Thu Jul 07 06:48:59 2016 +0000
- Revision:
- 636:b0d178e9fa10
- Parent:
- 544:1af5f1c39e80
l053
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 157:90e3acc479a2 | 1 | /* mbed Microcontroller Library |
mbed_official | 157:90e3acc479a2 | 2 | ******************************************************************************* |
mbed_official | 544:1af5f1c39e80 | 3 | * Copyright (c) 2015, STMicroelectronics |
mbed_official | 157:90e3acc479a2 | 4 | * All rights reserved. |
mbed_official | 157:90e3acc479a2 | 5 | * |
mbed_official | 157:90e3acc479a2 | 6 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 157:90e3acc479a2 | 7 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 157:90e3acc479a2 | 8 | * |
mbed_official | 157:90e3acc479a2 | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 157:90e3acc479a2 | 10 | * this list of conditions and the following disclaimer. |
mbed_official | 157:90e3acc479a2 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 157:90e3acc479a2 | 12 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 157:90e3acc479a2 | 13 | * and/or other materials provided with the distribution. |
mbed_official | 157:90e3acc479a2 | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 157:90e3acc479a2 | 15 | * may be used to endorse or promote products derived from this software |
mbed_official | 157:90e3acc479a2 | 16 | * without specific prior written permission. |
mbed_official | 157:90e3acc479a2 | 17 | * |
mbed_official | 157:90e3acc479a2 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 157:90e3acc479a2 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 157:90e3acc479a2 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 157:90e3acc479a2 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 157:90e3acc479a2 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 157:90e3acc479a2 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 157:90e3acc479a2 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 157:90e3acc479a2 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 157:90e3acc479a2 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 157:90e3acc479a2 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 157:90e3acc479a2 | 28 | ******************************************************************************* |
mbed_official | 157:90e3acc479a2 | 29 | */ |
mbed_official | 157:90e3acc479a2 | 30 | #ifndef MBED_PINNAMES_H |
mbed_official | 157:90e3acc479a2 | 31 | #define MBED_PINNAMES_H |
mbed_official | 157:90e3acc479a2 | 32 | |
mbed_official | 157:90e3acc479a2 | 33 | #include "cmsis.h" |
mbed_official | 157:90e3acc479a2 | 34 | |
mbed_official | 157:90e3acc479a2 | 35 | #ifdef __cplusplus |
mbed_official | 157:90e3acc479a2 | 36 | extern "C" { |
mbed_official | 157:90e3acc479a2 | 37 | #endif |
mbed_official | 157:90e3acc479a2 | 38 | |
mbed_official | 544:1af5f1c39e80 | 39 | #define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((MODE & 0x0F) << 0) |\ |
mbed_official | 544:1af5f1c39e80 | 40 | ((PUPD & 0x07) << 4) |\ |
mbed_official | 544:1af5f1c39e80 | 41 | ((AFNUM & 0x0F) << 7))) |
mbed_official | 544:1af5f1c39e80 | 42 | |
mbed_official | 544:1af5f1c39e80 | 43 | #define STM_PIN_DATA_EXT(MODE, PUPD, AFNUM, CHANNEL, INVERTED) ((int)(((MODE & 0x0F) << 0) |\ |
mbed_official | 544:1af5f1c39e80 | 44 | ((PUPD & 0x07) << 4) |\ |
mbed_official | 544:1af5f1c39e80 | 45 | ((AFNUM & 0x0F) << 7) |\ |
mbed_official | 544:1af5f1c39e80 | 46 | ((CHANNEL & 0x0F) << 11) |\ |
mbed_official | 544:1af5f1c39e80 | 47 | ((INVERTED & 0x01) << 15))) |
mbed_official | 544:1af5f1c39e80 | 48 | |
mbed_official | 544:1af5f1c39e80 | 49 | #define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) |
mbed_official | 544:1af5f1c39e80 | 50 | #define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) |
mbed_official | 544:1af5f1c39e80 | 51 | #define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) |
mbed_official | 544:1af5f1c39e80 | 52 | #define STM_PIN_CHANNEL(X) (((X) >> 11) & 0x0F) |
mbed_official | 544:1af5f1c39e80 | 53 | #define STM_PIN_INVERTED(X) (((X) >> 15) & 0x01) |
mbed_official | 544:1af5f1c39e80 | 54 | |
mbed_official | 403:91a4bea587f4 | 55 | #define STM_MODE_INPUT (0) |
mbed_official | 403:91a4bea587f4 | 56 | #define STM_MODE_OUTPUT_PP (1) |
mbed_official | 403:91a4bea587f4 | 57 | #define STM_MODE_OUTPUT_OD (2) |
mbed_official | 403:91a4bea587f4 | 58 | #define STM_MODE_AF_PP (3) |
mbed_official | 403:91a4bea587f4 | 59 | #define STM_MODE_AF_OD (4) |
mbed_official | 403:91a4bea587f4 | 60 | #define STM_MODE_ANALOG (5) |
mbed_official | 403:91a4bea587f4 | 61 | #define STM_MODE_IT_RISING (6) |
mbed_official | 403:91a4bea587f4 | 62 | #define STM_MODE_IT_FALLING (7) |
mbed_official | 403:91a4bea587f4 | 63 | #define STM_MODE_IT_RISING_FALLING (8) |
mbed_official | 403:91a4bea587f4 | 64 | #define STM_MODE_EVT_RISING (9) |
mbed_official | 403:91a4bea587f4 | 65 | #define STM_MODE_EVT_FALLING (10) |
mbed_official | 403:91a4bea587f4 | 66 | #define STM_MODE_EVT_RISING_FALLING (11) |
mbed_official | 403:91a4bea587f4 | 67 | #define STM_MODE_IT_EVT_RESET (12) |
mbed_official | 157:90e3acc479a2 | 68 | |
mbed_official | 157:90e3acc479a2 | 69 | // High nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H) |
mbed_official | 157:90e3acc479a2 | 70 | // Low nibble = pin number |
mbed_official | 157:90e3acc479a2 | 71 | #define STM_PORT(X) (((uint32_t)(X) >> 4) & 0xF) |
mbed_official | 157:90e3acc479a2 | 72 | #define STM_PIN(X) ((uint32_t)(X) & 0xF) |
mbed_official | 403:91a4bea587f4 | 73 | |
mbed_official | 157:90e3acc479a2 | 74 | typedef enum { |
mbed_official | 157:90e3acc479a2 | 75 | PIN_INPUT, |
mbed_official | 157:90e3acc479a2 | 76 | PIN_OUTPUT |
mbed_official | 157:90e3acc479a2 | 77 | } PinDirection; |
mbed_official | 157:90e3acc479a2 | 78 | |
mbed_official | 157:90e3acc479a2 | 79 | typedef enum { |
mbed_official | 544:1af5f1c39e80 | 80 | PA_0 = 0x00, |
mbed_official | 544:1af5f1c39e80 | 81 | PA_1 = 0x01, |
mbed_official | 544:1af5f1c39e80 | 82 | PA_2 = 0x02, |
mbed_official | 544:1af5f1c39e80 | 83 | PA_3 = 0x03, |
mbed_official | 544:1af5f1c39e80 | 84 | PA_4 = 0x04, |
mbed_official | 544:1af5f1c39e80 | 85 | PA_5 = 0x05, |
mbed_official | 544:1af5f1c39e80 | 86 | PA_6 = 0x06, |
mbed_official | 544:1af5f1c39e80 | 87 | PA_7 = 0x07, |
mbed_official | 544:1af5f1c39e80 | 88 | PA_8 = 0x08, |
mbed_official | 544:1af5f1c39e80 | 89 | PA_9 = 0x09, |
mbed_official | 544:1af5f1c39e80 | 90 | PA_10 = 0x0A, |
mbed_official | 544:1af5f1c39e80 | 91 | PA_11 = 0x0B, |
mbed_official | 544:1af5f1c39e80 | 92 | PA_12 = 0x0C, |
mbed_official | 544:1af5f1c39e80 | 93 | PA_13 = 0x0D, |
mbed_official | 544:1af5f1c39e80 | 94 | PA_14 = 0x0E, |
mbed_official | 544:1af5f1c39e80 | 95 | PA_15 = 0x0F, |
mbed_official | 157:90e3acc479a2 | 96 | |
mbed_official | 544:1af5f1c39e80 | 97 | PB_0 = 0x10, |
mbed_official | 544:1af5f1c39e80 | 98 | PB_1 = 0x11, |
mbed_official | 544:1af5f1c39e80 | 99 | PB_2 = 0x12, |
mbed_official | 544:1af5f1c39e80 | 100 | PB_3 = 0x13, |
mbed_official | 544:1af5f1c39e80 | 101 | PB_4 = 0x14, |
mbed_official | 544:1af5f1c39e80 | 102 | PB_5 = 0x15, |
mbed_official | 544:1af5f1c39e80 | 103 | PB_6 = 0x16, |
mbed_official | 544:1af5f1c39e80 | 104 | PB_7 = 0x17, |
mbed_official | 544:1af5f1c39e80 | 105 | PB_8 = 0x18, |
mbed_official | 544:1af5f1c39e80 | 106 | PB_9 = 0x19, |
mbed_official | 544:1af5f1c39e80 | 107 | PB_10 = 0x1A, |
mbed_official | 544:1af5f1c39e80 | 108 | PB_11 = 0x1B, |
mbed_official | 544:1af5f1c39e80 | 109 | PB_12 = 0x1C, |
mbed_official | 544:1af5f1c39e80 | 110 | PB_13 = 0x1D, |
mbed_official | 544:1af5f1c39e80 | 111 | PB_14 = 0x1E, |
mbed_official | 544:1af5f1c39e80 | 112 | PB_15 = 0x1F, |
mbed_official | 157:90e3acc479a2 | 113 | |
mbed_official | 544:1af5f1c39e80 | 114 | PC_0 = 0x20, |
mbed_official | 544:1af5f1c39e80 | 115 | PC_1 = 0x21, |
mbed_official | 544:1af5f1c39e80 | 116 | PC_2 = 0x22, |
mbed_official | 544:1af5f1c39e80 | 117 | PC_3 = 0x23, |
mbed_official | 544:1af5f1c39e80 | 118 | PC_4 = 0x24, |
mbed_official | 544:1af5f1c39e80 | 119 | PC_5 = 0x25, |
mbed_official | 544:1af5f1c39e80 | 120 | PC_6 = 0x26, |
mbed_official | 544:1af5f1c39e80 | 121 | PC_7 = 0x27, |
mbed_official | 544:1af5f1c39e80 | 122 | PC_8 = 0x28, |
mbed_official | 544:1af5f1c39e80 | 123 | PC_9 = 0x29, |
mbed_official | 544:1af5f1c39e80 | 124 | PC_10 = 0x2A, |
mbed_official | 544:1af5f1c39e80 | 125 | PC_11 = 0x2B, |
mbed_official | 544:1af5f1c39e80 | 126 | PC_12 = 0x2C, |
mbed_official | 544:1af5f1c39e80 | 127 | PC_13 = 0x2D, |
mbed_official | 544:1af5f1c39e80 | 128 | PC_14 = 0x2E, |
mbed_official | 544:1af5f1c39e80 | 129 | PC_15 = 0x2F, |
mbed_official | 157:90e3acc479a2 | 130 | |
mbed_official | 544:1af5f1c39e80 | 131 | PD_0 = 0x30, |
mbed_official | 544:1af5f1c39e80 | 132 | PD_1 = 0x31, |
mbed_official | 544:1af5f1c39e80 | 133 | PD_2 = 0x32, |
mbed_official | 544:1af5f1c39e80 | 134 | PD_3 = 0x33, |
mbed_official | 544:1af5f1c39e80 | 135 | PD_4 = 0x34, |
mbed_official | 544:1af5f1c39e80 | 136 | PD_5 = 0x35, |
mbed_official | 544:1af5f1c39e80 | 137 | PD_6 = 0x36, |
mbed_official | 544:1af5f1c39e80 | 138 | PD_7 = 0x37, |
mbed_official | 544:1af5f1c39e80 | 139 | PD_8 = 0x38, |
mbed_official | 544:1af5f1c39e80 | 140 | PD_9 = 0x39, |
mbed_official | 544:1af5f1c39e80 | 141 | PD_10 = 0x3A, |
mbed_official | 544:1af5f1c39e80 | 142 | PD_11 = 0x3B, |
mbed_official | 544:1af5f1c39e80 | 143 | PD_12 = 0x3C, |
mbed_official | 544:1af5f1c39e80 | 144 | PD_13 = 0x3D, |
mbed_official | 544:1af5f1c39e80 | 145 | PD_14 = 0x3E, |
mbed_official | 544:1af5f1c39e80 | 146 | PD_15 = 0x3F, |
mbed_official | 157:90e3acc479a2 | 147 | |
mbed_official | 544:1af5f1c39e80 | 148 | PE_0 = 0x40, |
mbed_official | 544:1af5f1c39e80 | 149 | PE_1 = 0x41, |
mbed_official | 544:1af5f1c39e80 | 150 | PE_2 = 0x42, |
mbed_official | 544:1af5f1c39e80 | 151 | PE_3 = 0x43, |
mbed_official | 544:1af5f1c39e80 | 152 | PE_4 = 0x44, |
mbed_official | 544:1af5f1c39e80 | 153 | PE_5 = 0x45, |
mbed_official | 544:1af5f1c39e80 | 154 | PE_6 = 0x46, |
mbed_official | 544:1af5f1c39e80 | 155 | PE_7 = 0x47, |
mbed_official | 544:1af5f1c39e80 | 156 | PE_8 = 0x48, |
mbed_official | 544:1af5f1c39e80 | 157 | PE_9 = 0x49, |
mbed_official | 544:1af5f1c39e80 | 158 | PE_10 = 0x4A, |
mbed_official | 544:1af5f1c39e80 | 159 | PE_11 = 0x4B, |
mbed_official | 544:1af5f1c39e80 | 160 | PE_12 = 0x4C, |
mbed_official | 544:1af5f1c39e80 | 161 | PE_13 = 0x4D, |
mbed_official | 544:1af5f1c39e80 | 162 | PE_14 = 0x4E, |
mbed_official | 544:1af5f1c39e80 | 163 | PE_15 = 0x4F, |
mbed_official | 157:90e3acc479a2 | 164 | |
mbed_official | 544:1af5f1c39e80 | 165 | PF_0 = 0x50, |
mbed_official | 544:1af5f1c39e80 | 166 | PF_1 = 0x51, |
mbed_official | 544:1af5f1c39e80 | 167 | PF_2 = 0x52, |
mbed_official | 544:1af5f1c39e80 | 168 | PF_3 = 0x53, |
mbed_official | 544:1af5f1c39e80 | 169 | PF_4 = 0x54, |
mbed_official | 544:1af5f1c39e80 | 170 | PF_5 = 0x55, |
mbed_official | 544:1af5f1c39e80 | 171 | PF_6 = 0x56, |
mbed_official | 544:1af5f1c39e80 | 172 | PF_7 = 0x57, |
mbed_official | 544:1af5f1c39e80 | 173 | PF_8 = 0x58, |
mbed_official | 544:1af5f1c39e80 | 174 | PF_9 = 0x59, |
mbed_official | 544:1af5f1c39e80 | 175 | PF_10 = 0x5A, |
mbed_official | 544:1af5f1c39e80 | 176 | PF_11 = 0x5B, |
mbed_official | 544:1af5f1c39e80 | 177 | PF_12 = 0x5C, |
mbed_official | 544:1af5f1c39e80 | 178 | PF_13 = 0x5D, |
mbed_official | 544:1af5f1c39e80 | 179 | PF_14 = 0x5E, |
mbed_official | 544:1af5f1c39e80 | 180 | PF_15 = 0x5F, |
mbed_official | 157:90e3acc479a2 | 181 | |
mbed_official | 403:91a4bea587f4 | 182 | // Arduino connector namings |
mbed_official | 403:91a4bea587f4 | 183 | A0 = PA_0, |
mbed_official | 403:91a4bea587f4 | 184 | A1 = PA_1, |
mbed_official | 403:91a4bea587f4 | 185 | A2 = PA_4, |
mbed_official | 403:91a4bea587f4 | 186 | A3 = PB_0, |
mbed_official | 403:91a4bea587f4 | 187 | A4 = PC_1, |
mbed_official | 403:91a4bea587f4 | 188 | A5 = PC_0, |
mbed_official | 403:91a4bea587f4 | 189 | D0 = PA_3, |
mbed_official | 403:91a4bea587f4 | 190 | D1 = PA_2, |
mbed_official | 403:91a4bea587f4 | 191 | D2 = PA_10, |
mbed_official | 403:91a4bea587f4 | 192 | D3 = PB_3, |
mbed_official | 403:91a4bea587f4 | 193 | D4 = PB_5, |
mbed_official | 403:91a4bea587f4 | 194 | D5 = PB_4, |
mbed_official | 403:91a4bea587f4 | 195 | D6 = PB_10, |
mbed_official | 403:91a4bea587f4 | 196 | D7 = PA_8, |
mbed_official | 403:91a4bea587f4 | 197 | D8 = PA_9, |
mbed_official | 403:91a4bea587f4 | 198 | D9 = PC_7, |
mbed_official | 403:91a4bea587f4 | 199 | D10 = PB_6, |
mbed_official | 403:91a4bea587f4 | 200 | D11 = PB_15, |
mbed_official | 403:91a4bea587f4 | 201 | D12 = PB_14, |
mbed_official | 403:91a4bea587f4 | 202 | D13 = PB_13, |
mbed_official | 403:91a4bea587f4 | 203 | D14 = PB_9, |
mbed_official | 403:91a4bea587f4 | 204 | D15 = PB_8, |
mbed_official | 157:90e3acc479a2 | 205 | |
mbed_official | 403:91a4bea587f4 | 206 | // Generic signals namings |
mbed_official | 403:91a4bea587f4 | 207 | LED1 = PE_9, |
mbed_official | 403:91a4bea587f4 | 208 | LED2 = PE_8, |
mbed_official | 403:91a4bea587f4 | 209 | LED3 = PE_9, |
mbed_official | 403:91a4bea587f4 | 210 | LED4 = PE_8, |
mbed_official | 403:91a4bea587f4 | 211 | LED5 = PE_10, |
mbed_official | 403:91a4bea587f4 | 212 | LED6 = PE_15, |
mbed_official | 403:91a4bea587f4 | 213 | LED7 = PE_11, |
mbed_official | 403:91a4bea587f4 | 214 | LED8 = PE_14, |
mbed_official | 403:91a4bea587f4 | 215 | LED9 = PE_12, |
mbed_official | 403:91a4bea587f4 | 216 | LED10 = PE_13, |
mbed_official | 403:91a4bea587f4 | 217 | USER_BUTTON = PA_0, |
mbed_official | 403:91a4bea587f4 | 218 | SERIAL_TX = PA_2, |
mbed_official | 403:91a4bea587f4 | 219 | SERIAL_RX = PA_3, |
mbed_official | 403:91a4bea587f4 | 220 | USBTX = PA_2, |
mbed_official | 403:91a4bea587f4 | 221 | USBRX = PA_3, |
mbed_official | 403:91a4bea587f4 | 222 | I2C_SCL = PB_8, |
mbed_official | 403:91a4bea587f4 | 223 | I2C_SDA = PB_9, |
mbed_official | 403:91a4bea587f4 | 224 | SPI_MOSI = PB_15, |
mbed_official | 403:91a4bea587f4 | 225 | SPI_MISO = PB_14, |
mbed_official | 403:91a4bea587f4 | 226 | SPI_SCK = PB_13, |
mbed_official | 403:91a4bea587f4 | 227 | SPI_CS = PB_6, |
mbed_official | 403:91a4bea587f4 | 228 | PWM_OUT = PB_4, |
mbed_official | 403:91a4bea587f4 | 229 | |
mbed_official | 403:91a4bea587f4 | 230 | // Not connected |
mbed_official | 403:91a4bea587f4 | 231 | NC = (int)0xFFFFFFFF |
mbed_official | 157:90e3acc479a2 | 232 | } PinName; |
mbed_official | 157:90e3acc479a2 | 233 | |
mbed_official | 157:90e3acc479a2 | 234 | typedef enum { |
mbed_official | 157:90e3acc479a2 | 235 | PullNone = 0, |
mbed_official | 157:90e3acc479a2 | 236 | PullUp = 1, |
mbed_official | 157:90e3acc479a2 | 237 | PullDown = 2, |
mbed_official | 157:90e3acc479a2 | 238 | OpenDrain = 3, |
mbed_official | 157:90e3acc479a2 | 239 | PullDefault = PullNone |
mbed_official | 157:90e3acc479a2 | 240 | } PinMode; |
mbed_official | 157:90e3acc479a2 | 241 | |
mbed_official | 157:90e3acc479a2 | 242 | #ifdef __cplusplus |
mbed_official | 157:90e3acc479a2 | 243 | } |
mbed_official | 157:90e3acc479a2 | 244 | #endif |
mbed_official | 157:90e3acc479a2 | 245 | |
mbed_official | 157:90e3acc479a2 | 246 | #endif |