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