ads1115 only
Fork of mbed by
TARGET_NUCLEO_L152RE/PinNames.h@81:7d30d6019079, 2014-03-19 (annotated)
- Committer:
- bogdanm
- Date:
- Wed Mar 19 18:28:32 2014 +0000
- Revision:
- 81:7d30d6019079
- Parent:
- 77:869cf507173a
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 | // MODE (see GPIOMode_TypeDef structure) |
emilmont | 77:869cf507173a | 40 | // OTYPE (see GPIOOType_TypeDef structure) |
emilmont | 77:869cf507173a | 41 | // PUPD (see GPIOPuPd_TypeDef structure) |
emilmont | 77:869cf507173a | 42 | // AFNUM (see AF_mapping constant table, 0xFF is not used) |
emilmont | 77:869cf507173a | 43 | #define STM_PIN_DATA(MODE, OTYPE, PUPD, AFNUM) (((AFNUM)<<8)|((PUPD)<<4)|((OTYPE)<<2)|((MODE)<<0)) |
emilmont | 77:869cf507173a | 44 | #define STM_PIN_MODE(X) (((X)>>0) & 0x3) |
emilmont | 77:869cf507173a | 45 | #define STM_PIN_OTYPE(X) (((X)>>2) & 0x1) |
emilmont | 77:869cf507173a | 46 | #define STM_PIN_PUPD(X) (((X)>>4) & 0x3) |
emilmont | 77:869cf507173a | 47 | #define STM_PIN_AFNUM(X) (((X)>>8) & 0xF) |
emilmont | 77:869cf507173a | 48 | |
emilmont | 77:869cf507173a | 49 | // High nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H) |
emilmont | 77:869cf507173a | 50 | // Low nibble = pin number |
emilmont | 77:869cf507173a | 51 | #define STM_PORT(X) (((uint32_t)(X) >> 4) & 0xF) |
emilmont | 77:869cf507173a | 52 | #define STM_PIN(X) ((uint32_t)(X) & 0xF) |
bogdanm | 81:7d30d6019079 | 53 | |
emilmont | 77:869cf507173a | 54 | typedef enum { |
emilmont | 77:869cf507173a | 55 | PIN_INPUT, |
emilmont | 77:869cf507173a | 56 | PIN_OUTPUT |
emilmont | 77:869cf507173a | 57 | } PinDirection; |
emilmont | 77:869cf507173a | 58 | |
emilmont | 77:869cf507173a | 59 | typedef enum { |
bogdanm | 81:7d30d6019079 | 60 | PA_0 = 0x00, |
bogdanm | 81:7d30d6019079 | 61 | PA_1 = 0x01, |
bogdanm | 81:7d30d6019079 | 62 | PA_2 = 0x02, |
bogdanm | 81:7d30d6019079 | 63 | PA_3 = 0x03, |
bogdanm | 81:7d30d6019079 | 64 | PA_4 = 0x04, |
bogdanm | 81:7d30d6019079 | 65 | PA_5 = 0x05, |
bogdanm | 81:7d30d6019079 | 66 | PA_6 = 0x06, |
bogdanm | 81:7d30d6019079 | 67 | PA_7 = 0x07, |
bogdanm | 81:7d30d6019079 | 68 | PA_8 = 0x08, |
bogdanm | 81:7d30d6019079 | 69 | PA_9 = 0x09, |
bogdanm | 81:7d30d6019079 | 70 | PA_10 = 0x0A, |
bogdanm | 81:7d30d6019079 | 71 | PA_11 = 0x0B, |
bogdanm | 81:7d30d6019079 | 72 | PA_12 = 0x0C, |
bogdanm | 81:7d30d6019079 | 73 | PA_13 = 0x0D, |
bogdanm | 81:7d30d6019079 | 74 | PA_14 = 0x0E, |
bogdanm | 81:7d30d6019079 | 75 | PA_15 = 0x0F, |
emilmont | 77:869cf507173a | 76 | |
bogdanm | 81:7d30d6019079 | 77 | PB_0 = 0x10, |
bogdanm | 81:7d30d6019079 | 78 | PB_1 = 0x11, |
bogdanm | 81:7d30d6019079 | 79 | PB_2 = 0x12, |
bogdanm | 81:7d30d6019079 | 80 | PB_3 = 0x13, |
bogdanm | 81:7d30d6019079 | 81 | PB_4 = 0x14, |
bogdanm | 81:7d30d6019079 | 82 | PB_5 = 0x15, |
bogdanm | 81:7d30d6019079 | 83 | PB_6 = 0x16, |
bogdanm | 81:7d30d6019079 | 84 | PB_7 = 0x17, |
bogdanm | 81:7d30d6019079 | 85 | PB_8 = 0x18, |
bogdanm | 81:7d30d6019079 | 86 | PB_9 = 0x19, |
bogdanm | 81:7d30d6019079 | 87 | PB_10 = 0x1A, |
bogdanm | 81:7d30d6019079 | 88 | PB_11 = 0x1B, |
bogdanm | 81:7d30d6019079 | 89 | PB_12 = 0x1C, |
bogdanm | 81:7d30d6019079 | 90 | PB_13 = 0x1D, |
bogdanm | 81:7d30d6019079 | 91 | PB_14 = 0x1E, |
bogdanm | 81:7d30d6019079 | 92 | PB_15 = 0x1F, |
emilmont | 77:869cf507173a | 93 | |
bogdanm | 81:7d30d6019079 | 94 | PC_0 = 0x20, |
bogdanm | 81:7d30d6019079 | 95 | PC_1 = 0x21, |
bogdanm | 81:7d30d6019079 | 96 | PC_2 = 0x22, |
bogdanm | 81:7d30d6019079 | 97 | PC_3 = 0x23, |
bogdanm | 81:7d30d6019079 | 98 | PC_4 = 0x24, |
bogdanm | 81:7d30d6019079 | 99 | PC_5 = 0x25, |
bogdanm | 81:7d30d6019079 | 100 | PC_6 = 0x26, |
bogdanm | 81:7d30d6019079 | 101 | PC_7 = 0x27, |
bogdanm | 81:7d30d6019079 | 102 | PC_8 = 0x28, |
bogdanm | 81:7d30d6019079 | 103 | PC_9 = 0x29, |
bogdanm | 81:7d30d6019079 | 104 | PC_10 = 0x2A, |
bogdanm | 81:7d30d6019079 | 105 | PC_11 = 0x2B, |
bogdanm | 81:7d30d6019079 | 106 | PC_12 = 0x2C, |
bogdanm | 81:7d30d6019079 | 107 | PC_13 = 0x2D, |
bogdanm | 81:7d30d6019079 | 108 | PC_14 = 0x2E, |
bogdanm | 81:7d30d6019079 | 109 | PC_15 = 0x2F, |
emilmont | 77:869cf507173a | 110 | |
bogdanm | 81:7d30d6019079 | 111 | PD_2 = 0x32, |
emilmont | 77:869cf507173a | 112 | |
bogdanm | 81:7d30d6019079 | 113 | PH_0 = 0x70, |
bogdanm | 81:7d30d6019079 | 114 | PH_1 = 0x71, |
emilmont | 77:869cf507173a | 115 | |
bogdanm | 81:7d30d6019079 | 116 | // Arduino connector namings |
bogdanm | 81:7d30d6019079 | 117 | A0 = PA_0, |
bogdanm | 81:7d30d6019079 | 118 | A1 = PA_1, |
bogdanm | 81:7d30d6019079 | 119 | A2 = PA_4, |
bogdanm | 81:7d30d6019079 | 120 | A3 = PB_0, |
bogdanm | 81:7d30d6019079 | 121 | A4 = PC_1, |
bogdanm | 81:7d30d6019079 | 122 | A5 = PC_0, |
bogdanm | 81:7d30d6019079 | 123 | D0 = PA_3, |
bogdanm | 81:7d30d6019079 | 124 | D1 = PA_2, |
bogdanm | 81:7d30d6019079 | 125 | D2 = PA_10, |
bogdanm | 81:7d30d6019079 | 126 | D3 = PB_3, |
bogdanm | 81:7d30d6019079 | 127 | D4 = PB_5, |
bogdanm | 81:7d30d6019079 | 128 | D5 = PB_4, |
bogdanm | 81:7d30d6019079 | 129 | D6 = PB_10, |
bogdanm | 81:7d30d6019079 | 130 | D7 = PA_8, |
bogdanm | 81:7d30d6019079 | 131 | D8 = PA_9, |
bogdanm | 81:7d30d6019079 | 132 | D9 = PC_7, |
bogdanm | 81:7d30d6019079 | 133 | D10 = PB_6, |
bogdanm | 81:7d30d6019079 | 134 | D11 = PA_7, |
bogdanm | 81:7d30d6019079 | 135 | D12 = PA_6, |
bogdanm | 81:7d30d6019079 | 136 | D13 = PA_5, |
bogdanm | 81:7d30d6019079 | 137 | D14 = PB_9, |
bogdanm | 81:7d30d6019079 | 138 | D15 = PB_8, |
emilmont | 77:869cf507173a | 139 | |
bogdanm | 81:7d30d6019079 | 140 | // Generic signals namings |
bogdanm | 81:7d30d6019079 | 141 | LED1 = PA_5, |
bogdanm | 81:7d30d6019079 | 142 | LED2 = PA_5, |
bogdanm | 81:7d30d6019079 | 143 | LED3 = PA_5, |
bogdanm | 81:7d30d6019079 | 144 | LED4 = PA_5, |
bogdanm | 81:7d30d6019079 | 145 | USER_BUTTON = PC_13, |
bogdanm | 81:7d30d6019079 | 146 | USBTX = PA_2, |
bogdanm | 81:7d30d6019079 | 147 | USBRX = PA_3, |
bogdanm | 81:7d30d6019079 | 148 | I2C_SCL = PB_8, |
bogdanm | 81:7d30d6019079 | 149 | I2C_SDA = PB_9, |
bogdanm | 81:7d30d6019079 | 150 | SPI_MOSI = PA_7, |
bogdanm | 81:7d30d6019079 | 151 | SPI_MISO = PA_6, |
bogdanm | 81:7d30d6019079 | 152 | SPI_SCK = PA_5, |
bogdanm | 81:7d30d6019079 | 153 | SPI_CS = PB_6, |
bogdanm | 81:7d30d6019079 | 154 | PWM_OUT = PB_3, |
bogdanm | 81:7d30d6019079 | 155 | |
bogdanm | 81:7d30d6019079 | 156 | // Not connected |
bogdanm | 81:7d30d6019079 | 157 | NC = (int)0xFFFFFFFF |
emilmont | 77:869cf507173a | 158 | } PinName; |
emilmont | 77:869cf507173a | 159 | |
emilmont | 77:869cf507173a | 160 | typedef enum { |
emilmont | 77:869cf507173a | 161 | PullNone = 0, |
emilmont | 77:869cf507173a | 162 | PullUp = 1, |
emilmont | 77:869cf507173a | 163 | PullDown = 2, |
bogdanm | 81:7d30d6019079 | 164 | OpenDrain = 3, |
bogdanm | 81:7d30d6019079 | 165 | PullDefault = PullNone |
emilmont | 77:869cf507173a | 166 | } PinMode; |
emilmont | 77:869cf507173a | 167 | |
emilmont | 77:869cf507173a | 168 | #ifdef __cplusplus |
emilmont | 77:869cf507173a | 169 | } |
emilmont | 77:869cf507173a | 170 | #endif |
emilmont | 77:869cf507173a | 171 | |
emilmont | 77:869cf507173a | 172 | #endif |