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