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