mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/hal/TARGET_STM/TARGET_DISCO_F100RB/PinNames.h@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 126:549ba18ddd81
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 126:549ba18ddd81 | 1 | /* mbed Microcontroller Library |
mbed_official | 126:549ba18ddd81 | 2 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 3 | * Copyright (c) 2014, STMicroelectronics |
mbed_official | 126:549ba18ddd81 | 4 | * All rights reserved. |
mbed_official | 126:549ba18ddd81 | 5 | * |
mbed_official | 126:549ba18ddd81 | 6 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 126:549ba18ddd81 | 7 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 126:549ba18ddd81 | 8 | * |
mbed_official | 126:549ba18ddd81 | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 10 | * this list of conditions and the following disclaimer. |
mbed_official | 126:549ba18ddd81 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 126:549ba18ddd81 | 12 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 126:549ba18ddd81 | 13 | * and/or other materials provided with the distribution. |
mbed_official | 126:549ba18ddd81 | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 126:549ba18ddd81 | 15 | * may be used to endorse or promote products derived from this software |
mbed_official | 126:549ba18ddd81 | 16 | * without specific prior written permission. |
mbed_official | 126:549ba18ddd81 | 17 | * |
mbed_official | 126:549ba18ddd81 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 126:549ba18ddd81 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 126:549ba18ddd81 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 126:549ba18ddd81 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 126:549ba18ddd81 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 126:549ba18ddd81 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 126:549ba18ddd81 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 126:549ba18ddd81 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 126:549ba18ddd81 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 126:549ba18ddd81 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 126:549ba18ddd81 | 28 | ******************************************************************************* |
mbed_official | 126:549ba18ddd81 | 29 | */ |
mbed_official | 126:549ba18ddd81 | 30 | #ifndef MBED_PINNAMES_H |
mbed_official | 126:549ba18ddd81 | 31 | #define MBED_PINNAMES_H |
mbed_official | 126:549ba18ddd81 | 32 | |
mbed_official | 126:549ba18ddd81 | 33 | #include "cmsis.h" |
mbed_official | 126:549ba18ddd81 | 34 | |
mbed_official | 126:549ba18ddd81 | 35 | #ifdef __cplusplus |
mbed_official | 126:549ba18ddd81 | 36 | extern "C" { |
mbed_official | 126:549ba18ddd81 | 37 | #endif |
mbed_official | 126:549ba18ddd81 | 38 | |
mbed_official | 126:549ba18ddd81 | 39 | // MODE (see GPIOMode_TypeDef structure) |
mbed_official | 126:549ba18ddd81 | 40 | // AFNUM (see AF_mapping constant table) |
mbed_official | 126:549ba18ddd81 | 41 | #define STM_PIN_DATA(MODE, AFNUM) (((MODE) << 8) | (AFNUM)) |
mbed_official | 126:549ba18ddd81 | 42 | #define STM_PIN_MODE(X) ((X) >> 8) |
mbed_official | 126:549ba18ddd81 | 43 | #define STM_PIN_AFNUM(X) ((X) & 0xFF) |
mbed_official | 126:549ba18ddd81 | 44 | |
mbed_official | 126:549ba18ddd81 | 45 | // High nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H) |
mbed_official | 126:549ba18ddd81 | 46 | // Low nibble = pin number |
mbed_official | 126:549ba18ddd81 | 47 | #define STM_PORT(X) (((uint32_t)(X) >> 4) & 0xF) |
mbed_official | 126:549ba18ddd81 | 48 | #define STM_PIN(X) ((uint32_t)(X) & 0xF) |
mbed_official | 126:549ba18ddd81 | 49 | |
mbed_official | 126:549ba18ddd81 | 50 | typedef enum { |
mbed_official | 126:549ba18ddd81 | 51 | PIN_INPUT, |
mbed_official | 126:549ba18ddd81 | 52 | PIN_OUTPUT |
mbed_official | 126:549ba18ddd81 | 53 | } PinDirection; |
mbed_official | 126:549ba18ddd81 | 54 | |
mbed_official | 126:549ba18ddd81 | 55 | typedef enum { |
mbed_official | 126:549ba18ddd81 | 56 | PA_0 = 0x00, |
mbed_official | 126:549ba18ddd81 | 57 | PA_1 = 0x01, |
mbed_official | 126:549ba18ddd81 | 58 | PA_2 = 0x02, |
mbed_official | 126:549ba18ddd81 | 59 | PA_3 = 0x03, |
mbed_official | 126:549ba18ddd81 | 60 | PA_4 = 0x04, |
mbed_official | 126:549ba18ddd81 | 61 | PA_5 = 0x05, |
mbed_official | 126:549ba18ddd81 | 62 | PA_6 = 0x06, |
mbed_official | 126:549ba18ddd81 | 63 | PA_7 = 0x07, |
mbed_official | 126:549ba18ddd81 | 64 | PA_8 = 0x08, |
mbed_official | 126:549ba18ddd81 | 65 | PA_9 = 0x09, |
mbed_official | 126:549ba18ddd81 | 66 | PA_10 = 0x0A, |
mbed_official | 126:549ba18ddd81 | 67 | PA_11 = 0x0B, |
mbed_official | 126:549ba18ddd81 | 68 | PA_12 = 0x0C, |
mbed_official | 126:549ba18ddd81 | 69 | PA_13 = 0x0D, |
mbed_official | 126:549ba18ddd81 | 70 | PA_14 = 0x0E, |
mbed_official | 126:549ba18ddd81 | 71 | PA_15 = 0x0F, |
mbed_official | 126:549ba18ddd81 | 72 | |
mbed_official | 126:549ba18ddd81 | 73 | PB_0 = 0x10, |
mbed_official | 126:549ba18ddd81 | 74 | PB_1 = 0x11, |
mbed_official | 126:549ba18ddd81 | 75 | PB_2 = 0x12, |
mbed_official | 126:549ba18ddd81 | 76 | PB_3 = 0x13, |
mbed_official | 126:549ba18ddd81 | 77 | PB_4 = 0x14, |
mbed_official | 126:549ba18ddd81 | 78 | PB_5 = 0x15, |
mbed_official | 126:549ba18ddd81 | 79 | PB_6 = 0x16, |
mbed_official | 126:549ba18ddd81 | 80 | PB_7 = 0x17, |
mbed_official | 126:549ba18ddd81 | 81 | PB_8 = 0x18, |
mbed_official | 126:549ba18ddd81 | 82 | PB_9 = 0x19, |
mbed_official | 126:549ba18ddd81 | 83 | PB_10 = 0x1A, |
mbed_official | 126:549ba18ddd81 | 84 | PB_11 = 0x1B, |
mbed_official | 126:549ba18ddd81 | 85 | PB_12 = 0x1C, |
mbed_official | 126:549ba18ddd81 | 86 | PB_13 = 0x1D, |
mbed_official | 126:549ba18ddd81 | 87 | PB_14 = 0x1E, |
mbed_official | 126:549ba18ddd81 | 88 | PB_15 = 0x1F, |
mbed_official | 126:549ba18ddd81 | 89 | |
mbed_official | 126:549ba18ddd81 | 90 | PC_0 = 0x20, |
mbed_official | 126:549ba18ddd81 | 91 | PC_1 = 0x21, |
mbed_official | 126:549ba18ddd81 | 92 | PC_2 = 0x22, |
mbed_official | 126:549ba18ddd81 | 93 | PC_3 = 0x23, |
mbed_official | 126:549ba18ddd81 | 94 | PC_4 = 0x24, |
mbed_official | 126:549ba18ddd81 | 95 | PC_5 = 0x25, |
mbed_official | 126:549ba18ddd81 | 96 | PC_6 = 0x26, |
mbed_official | 126:549ba18ddd81 | 97 | PC_7 = 0x27, |
mbed_official | 126:549ba18ddd81 | 98 | PC_8 = 0x28, |
mbed_official | 126:549ba18ddd81 | 99 | PC_9 = 0x29, |
mbed_official | 126:549ba18ddd81 | 100 | PC_10 = 0x2A, |
mbed_official | 126:549ba18ddd81 | 101 | PC_11 = 0x2B, |
mbed_official | 126:549ba18ddd81 | 102 | PC_12 = 0x2C, |
mbed_official | 126:549ba18ddd81 | 103 | PC_13 = 0x2D, |
mbed_official | 126:549ba18ddd81 | 104 | PC_14 = 0x2E, |
mbed_official | 126:549ba18ddd81 | 105 | PC_15 = 0x2F, |
mbed_official | 126:549ba18ddd81 | 106 | |
mbed_official | 126:549ba18ddd81 | 107 | PD_0 = 0x30, |
mbed_official | 126:549ba18ddd81 | 108 | PD_1 = 0x31, |
mbed_official | 126:549ba18ddd81 | 109 | PD_2 = 0x32, |
mbed_official | 126:549ba18ddd81 | 110 | |
mbed_official | 126:549ba18ddd81 | 111 | // Arduino connector namings |
mbed_official | 126:549ba18ddd81 | 112 | PA0 = PA_0, |
mbed_official | 126:549ba18ddd81 | 113 | PA1 = PA_1, |
mbed_official | 126:549ba18ddd81 | 114 | PA2 = PA_2, |
mbed_official | 126:549ba18ddd81 | 115 | PA3 = PA_3, |
mbed_official | 126:549ba18ddd81 | 116 | PA4 = PA_4, |
mbed_official | 126:549ba18ddd81 | 117 | PA5 = PA_5, |
mbed_official | 126:549ba18ddd81 | 118 | PA6 = PA_6, |
mbed_official | 126:549ba18ddd81 | 119 | PA7 = PA_7, |
mbed_official | 126:549ba18ddd81 | 120 | PA8 = PA_8, |
mbed_official | 126:549ba18ddd81 | 121 | PA9 = PA_9, |
mbed_official | 126:549ba18ddd81 | 122 | PA10 = PA_10, |
mbed_official | 126:549ba18ddd81 | 123 | PA11 = PA_11, |
mbed_official | 126:549ba18ddd81 | 124 | PA12 = PA_12, |
mbed_official | 126:549ba18ddd81 | 125 | PA13 = PA_13, |
mbed_official | 126:549ba18ddd81 | 126 | PA14 = PA_14, |
mbed_official | 126:549ba18ddd81 | 127 | PA15 = PA_15, |
mbed_official | 126:549ba18ddd81 | 128 | |
mbed_official | 126:549ba18ddd81 | 129 | PC4 = PC_4, |
mbed_official | 126:549ba18ddd81 | 130 | PC5 = PC_5, |
mbed_official | 126:549ba18ddd81 | 131 | PC6 = PC_6, |
mbed_official | 126:549ba18ddd81 | 132 | PC7 = PC_7, |
mbed_official | 126:549ba18ddd81 | 133 | PC8 = PC_8, |
mbed_official | 126:549ba18ddd81 | 134 | PC9 = PC_9, |
mbed_official | 126:549ba18ddd81 | 135 | PC10 = PC_10, |
mbed_official | 126:549ba18ddd81 | 136 | PC11 = PC_13, |
mbed_official | 126:549ba18ddd81 | 137 | PC12 = PC_12, |
mbed_official | 126:549ba18ddd81 | 138 | |
mbed_official | 126:549ba18ddd81 | 139 | PD2 = PD_2, |
mbed_official | 126:549ba18ddd81 | 140 | |
mbed_official | 126:549ba18ddd81 | 141 | PB1 = PB_1, |
mbed_official | 126:549ba18ddd81 | 142 | PB2 = PB_2, |
mbed_official | 126:549ba18ddd81 | 143 | PB3 = PB_3, |
mbed_official | 126:549ba18ddd81 | 144 | PB4 = PB_4, |
mbed_official | 126:549ba18ddd81 | 145 | PB5 = PB_5, |
mbed_official | 126:549ba18ddd81 | 146 | PB6 = PB_6, |
mbed_official | 126:549ba18ddd81 | 147 | PB7 = PB_7, |
mbed_official | 126:549ba18ddd81 | 148 | PB8 = PB_8, |
mbed_official | 126:549ba18ddd81 | 149 | PB9 = PB_9, |
mbed_official | 126:549ba18ddd81 | 150 | PB10 = PB_10, |
mbed_official | 126:549ba18ddd81 | 151 | PB11 = PB_11, |
mbed_official | 126:549ba18ddd81 | 152 | PB12 = PB_12, |
mbed_official | 126:549ba18ddd81 | 153 | PB13 = PB_13, |
mbed_official | 126:549ba18ddd81 | 154 | PB14 = PB_14, |
mbed_official | 126:549ba18ddd81 | 155 | PB15 = PB_15, |
mbed_official | 126:549ba18ddd81 | 156 | |
mbed_official | 126:549ba18ddd81 | 157 | |
mbed_official | 126:549ba18ddd81 | 158 | // Generic signals namings |
mbed_official | 126:549ba18ddd81 | 159 | LED1 = PC_9, |
mbed_official | 126:549ba18ddd81 | 160 | LED2 = PC_8, |
mbed_official | 126:549ba18ddd81 | 161 | LED3 = PC_9, |
mbed_official | 126:549ba18ddd81 | 162 | LED4 = PC_8, |
mbed_official | 126:549ba18ddd81 | 163 | USER_BUTTON = PA_0, |
mbed_official | 126:549ba18ddd81 | 164 | USBTX = PA_2, |
mbed_official | 126:549ba18ddd81 | 165 | USBRX = PA_3, |
mbed_official | 126:549ba18ddd81 | 166 | I2C_SCL = PB_6, |
mbed_official | 126:549ba18ddd81 | 167 | I2C_SDA = PB_7, |
mbed_official | 126:549ba18ddd81 | 168 | SPI_MOSI = PB_15, |
mbed_official | 126:549ba18ddd81 | 169 | SPI_MISO = PB_14, |
mbed_official | 126:549ba18ddd81 | 170 | SPI_SCK = PB_13, |
mbed_official | 126:549ba18ddd81 | 171 | SPI_CS = PB_12, |
mbed_official | 126:549ba18ddd81 | 172 | PWM_OUT = PB_8, |
mbed_official | 126:549ba18ddd81 | 173 | |
mbed_official | 126:549ba18ddd81 | 174 | // Not connected |
mbed_official | 126:549ba18ddd81 | 175 | NC = (int)0xFFFFFFFF |
mbed_official | 126:549ba18ddd81 | 176 | } PinName; |
mbed_official | 126:549ba18ddd81 | 177 | |
mbed_official | 126:549ba18ddd81 | 178 | typedef enum { |
mbed_official | 126:549ba18ddd81 | 179 | PullNone = 0, |
mbed_official | 126:549ba18ddd81 | 180 | PullUp = 1, |
mbed_official | 126:549ba18ddd81 | 181 | PullDown = 2, |
mbed_official | 126:549ba18ddd81 | 182 | OpenDrain = 3, |
mbed_official | 126:549ba18ddd81 | 183 | PullDefault = PullNone |
mbed_official | 126:549ba18ddd81 | 184 | } PinMode; |
mbed_official | 126:549ba18ddd81 | 185 | |
mbed_official | 126:549ba18ddd81 | 186 | #ifdef __cplusplus |
mbed_official | 126:549ba18ddd81 | 187 | } |
mbed_official | 126:549ba18ddd81 | 188 | #endif |
mbed_official | 126:549ba18ddd81 | 189 | |
mbed_official | 126:549ba18ddd81 | 190 | #endif |