mbed library sources. Supersedes mbed-src.
Dependents: Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more
targets/hal/TARGET_STM/TARGET_STM32F0/TARGET_NUCLEO_F042K6/PinNames.h@5:ac9f6c2c45e8, 2015-10-06 (annotated)
- Committer:
- mbed_official
- Date:
- Tue Oct 06 13:30:11 2015 +0100
- Revision:
- 5:ac9f6c2c45e8
- Child:
- 144:ef7eb2e8f9f7
Synchronized with git revision 3b75452bbd7b9aa90310014dbc8b6263ab4fd47d
Full URL: https://github.com/mbedmicro/mbed/commit/3b75452bbd7b9aa90310014dbc8b6263ab4fd47d/
Dev nucleo f042k6
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 5:ac9f6c2c45e8 | 1 | /* mbed Microcontroller Library |
mbed_official | 5:ac9f6c2c45e8 | 2 | ******************************************************************************* |
mbed_official | 5:ac9f6c2c45e8 | 3 | * Copyright (c) 2014, STMicroelectronics |
mbed_official | 5:ac9f6c2c45e8 | 4 | * All rights reserved. |
mbed_official | 5:ac9f6c2c45e8 | 5 | * |
mbed_official | 5:ac9f6c2c45e8 | 6 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 5:ac9f6c2c45e8 | 7 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 5:ac9f6c2c45e8 | 8 | * |
mbed_official | 5:ac9f6c2c45e8 | 9 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 5:ac9f6c2c45e8 | 10 | * this list of conditions and the following disclaimer. |
mbed_official | 5:ac9f6c2c45e8 | 11 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 5:ac9f6c2c45e8 | 12 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 5:ac9f6c2c45e8 | 13 | * and/or other materials provided with the distribution. |
mbed_official | 5:ac9f6c2c45e8 | 14 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 5:ac9f6c2c45e8 | 15 | * may be used to endorse or promote products derived from this software |
mbed_official | 5:ac9f6c2c45e8 | 16 | * without specific prior written permission. |
mbed_official | 5:ac9f6c2c45e8 | 17 | * |
mbed_official | 5:ac9f6c2c45e8 | 18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 5:ac9f6c2c45e8 | 19 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 5:ac9f6c2c45e8 | 20 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 5:ac9f6c2c45e8 | 21 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 5:ac9f6c2c45e8 | 22 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 5:ac9f6c2c45e8 | 23 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 5:ac9f6c2c45e8 | 24 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 5:ac9f6c2c45e8 | 25 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 5:ac9f6c2c45e8 | 26 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 5:ac9f6c2c45e8 | 27 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 5:ac9f6c2c45e8 | 28 | ******************************************************************************* |
mbed_official | 5:ac9f6c2c45e8 | 29 | */ |
mbed_official | 5:ac9f6c2c45e8 | 30 | #ifndef MBED_PINNAMES_H |
mbed_official | 5:ac9f6c2c45e8 | 31 | #define MBED_PINNAMES_H |
mbed_official | 5:ac9f6c2c45e8 | 32 | |
mbed_official | 5:ac9f6c2c45e8 | 33 | #include "cmsis.h" |
mbed_official | 5:ac9f6c2c45e8 | 34 | |
mbed_official | 5:ac9f6c2c45e8 | 35 | #ifdef __cplusplus |
mbed_official | 5:ac9f6c2c45e8 | 36 | extern "C" { |
mbed_official | 5:ac9f6c2c45e8 | 37 | #endif |
mbed_official | 5:ac9f6c2c45e8 | 38 | |
mbed_official | 5:ac9f6c2c45e8 | 39 | // See stm32f0xx_hal_gpio.h and stm32f0xx_hal_gpio_ex.h for values of MODE, PUPD and AFNUM |
mbed_official | 5:ac9f6c2c45e8 | 40 | #define STM_PIN_DATA(MODE, PUPD, AFNUM) ((int)(((AFNUM) << 7) | ((PUPD) << 4) | ((MODE) << 0))) |
mbed_official | 5:ac9f6c2c45e8 | 41 | #define STM_PIN_MODE(X) (((X) >> 0) & 0x0F) |
mbed_official | 5:ac9f6c2c45e8 | 42 | #define STM_PIN_PUPD(X) (((X) >> 4) & 0x07) |
mbed_official | 5:ac9f6c2c45e8 | 43 | #define STM_PIN_AFNUM(X) (((X) >> 7) & 0x0F) |
mbed_official | 5:ac9f6c2c45e8 | 44 | #define STM_MODE_INPUT (0) |
mbed_official | 5:ac9f6c2c45e8 | 45 | #define STM_MODE_OUTPUT_PP (1) |
mbed_official | 5:ac9f6c2c45e8 | 46 | #define STM_MODE_OUTPUT_OD (2) |
mbed_official | 5:ac9f6c2c45e8 | 47 | #define STM_MODE_AF_PP (3) |
mbed_official | 5:ac9f6c2c45e8 | 48 | #define STM_MODE_AF_OD (4) |
mbed_official | 5:ac9f6c2c45e8 | 49 | #define STM_MODE_ANALOG (5) |
mbed_official | 5:ac9f6c2c45e8 | 50 | #define STM_MODE_IT_RISING (6) |
mbed_official | 5:ac9f6c2c45e8 | 51 | #define STM_MODE_IT_FALLING (7) |
mbed_official | 5:ac9f6c2c45e8 | 52 | #define STM_MODE_IT_RISING_FALLING (8) |
mbed_official | 5:ac9f6c2c45e8 | 53 | #define STM_MODE_EVT_RISING (9) |
mbed_official | 5:ac9f6c2c45e8 | 54 | #define STM_MODE_EVT_FALLING (10) |
mbed_official | 5:ac9f6c2c45e8 | 55 | #define STM_MODE_EVT_RISING_FALLING (11) |
mbed_official | 5:ac9f6c2c45e8 | 56 | #define STM_MODE_IT_EVT_RESET (12) |
mbed_official | 5:ac9f6c2c45e8 | 57 | |
mbed_official | 5:ac9f6c2c45e8 | 58 | // High nibble = port number (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H) |
mbed_official | 5:ac9f6c2c45e8 | 59 | // Low nibble = pin number |
mbed_official | 5:ac9f6c2c45e8 | 60 | #define STM_PORT(X) (((uint32_t)(X) >> 4) & 0xF) |
mbed_official | 5:ac9f6c2c45e8 | 61 | #define STM_PIN(X) ((uint32_t)(X) & 0xF) |
mbed_official | 5:ac9f6c2c45e8 | 62 | |
mbed_official | 5:ac9f6c2c45e8 | 63 | typedef enum { |
mbed_official | 5:ac9f6c2c45e8 | 64 | PIN_INPUT, |
mbed_official | 5:ac9f6c2c45e8 | 65 | PIN_OUTPUT |
mbed_official | 5:ac9f6c2c45e8 | 66 | } PinDirection; |
mbed_official | 5:ac9f6c2c45e8 | 67 | |
mbed_official | 5:ac9f6c2c45e8 | 68 | typedef enum { |
mbed_official | 5:ac9f6c2c45e8 | 69 | PA_0 = 0x00, |
mbed_official | 5:ac9f6c2c45e8 | 70 | PA_1 = 0x01, |
mbed_official | 5:ac9f6c2c45e8 | 71 | PA_2 = 0x02, |
mbed_official | 5:ac9f6c2c45e8 | 72 | PA_3 = 0x03, |
mbed_official | 5:ac9f6c2c45e8 | 73 | PA_4 = 0x04, |
mbed_official | 5:ac9f6c2c45e8 | 74 | PA_5 = 0x05, |
mbed_official | 5:ac9f6c2c45e8 | 75 | PA_6 = 0x06, |
mbed_official | 5:ac9f6c2c45e8 | 76 | PA_7 = 0x07, |
mbed_official | 5:ac9f6c2c45e8 | 77 | PA_8 = 0x08, |
mbed_official | 5:ac9f6c2c45e8 | 78 | PA_9 = 0x09, |
mbed_official | 5:ac9f6c2c45e8 | 79 | PA_10 = 0x0A, |
mbed_official | 5:ac9f6c2c45e8 | 80 | PA_11 = 0x0B, |
mbed_official | 5:ac9f6c2c45e8 | 81 | PA_12 = 0x0C, |
mbed_official | 5:ac9f6c2c45e8 | 82 | PA_13 = 0x0D, |
mbed_official | 5:ac9f6c2c45e8 | 83 | PA_14 = 0x0E, |
mbed_official | 5:ac9f6c2c45e8 | 84 | PA_15 = 0x0F, |
mbed_official | 5:ac9f6c2c45e8 | 85 | |
mbed_official | 5:ac9f6c2c45e8 | 86 | PB_0 = 0x10, |
mbed_official | 5:ac9f6c2c45e8 | 87 | PB_1 = 0x11, |
mbed_official | 5:ac9f6c2c45e8 | 88 | PB_3 = 0x13, |
mbed_official | 5:ac9f6c2c45e8 | 89 | PB_4 = 0x14, |
mbed_official | 5:ac9f6c2c45e8 | 90 | PB_5 = 0x15, |
mbed_official | 5:ac9f6c2c45e8 | 91 | PB_6 = 0x16, |
mbed_official | 5:ac9f6c2c45e8 | 92 | PB_7 = 0x17, |
mbed_official | 5:ac9f6c2c45e8 | 93 | PB_8 = 0x18, |
mbed_official | 5:ac9f6c2c45e8 | 94 | |
mbed_official | 5:ac9f6c2c45e8 | 95 | PF_0 = 0x50, |
mbed_official | 5:ac9f6c2c45e8 | 96 | PF_1 = 0x51, |
mbed_official | 5:ac9f6c2c45e8 | 97 | |
mbed_official | 5:ac9f6c2c45e8 | 98 | // Arduino connector namings |
mbed_official | 5:ac9f6c2c45e8 | 99 | A0 = PA_0, |
mbed_official | 5:ac9f6c2c45e8 | 100 | A1 = PA_1, |
mbed_official | 5:ac9f6c2c45e8 | 101 | A2 = PA_3, |
mbed_official | 5:ac9f6c2c45e8 | 102 | A3 = PA_4, |
mbed_official | 5:ac9f6c2c45e8 | 103 | A4 = PA_5, |
mbed_official | 5:ac9f6c2c45e8 | 104 | A5 = PA_6, |
mbed_official | 5:ac9f6c2c45e8 | 105 | A6 = PA_7, |
mbed_official | 5:ac9f6c2c45e8 | 106 | A7 = PA_2, |
mbed_official | 5:ac9f6c2c45e8 | 107 | D0 = PA_10, |
mbed_official | 5:ac9f6c2c45e8 | 108 | D1 = PA_9, |
mbed_official | 5:ac9f6c2c45e8 | 109 | D2 = PA_12, |
mbed_official | 5:ac9f6c2c45e8 | 110 | D3 = PB_0, |
mbed_official | 5:ac9f6c2c45e8 | 111 | D4 = PB_7, |
mbed_official | 5:ac9f6c2c45e8 | 112 | D5 = PB_6, |
mbed_official | 5:ac9f6c2c45e8 | 113 | D6 = PB_1, |
mbed_official | 5:ac9f6c2c45e8 | 114 | D7 = PF_0, |
mbed_official | 5:ac9f6c2c45e8 | 115 | D8 = PF_1, |
mbed_official | 5:ac9f6c2c45e8 | 116 | D9 = PA_8, |
mbed_official | 5:ac9f6c2c45e8 | 117 | D10 = PA_11, |
mbed_official | 5:ac9f6c2c45e8 | 118 | D11 = PB_5, |
mbed_official | 5:ac9f6c2c45e8 | 119 | D12 = PB_4, |
mbed_official | 5:ac9f6c2c45e8 | 120 | D13 = PB_3, |
mbed_official | 5:ac9f6c2c45e8 | 121 | |
mbed_official | 5:ac9f6c2c45e8 | 122 | // Generic signals namings |
mbed_official | 5:ac9f6c2c45e8 | 123 | LED1 = PB_3, |
mbed_official | 5:ac9f6c2c45e8 | 124 | LED2 = PB_3, |
mbed_official | 5:ac9f6c2c45e8 | 125 | LED3 = PB_3, |
mbed_official | 5:ac9f6c2c45e8 | 126 | LED4 = PB_3, |
mbed_official | 5:ac9f6c2c45e8 | 127 | SERIAL_TX = PA_2, |
mbed_official | 5:ac9f6c2c45e8 | 128 | SERIAL_RX = PA_15, |
mbed_official | 5:ac9f6c2c45e8 | 129 | USBTX = PA_2, |
mbed_official | 5:ac9f6c2c45e8 | 130 | USBRX = PA_15, |
mbed_official | 5:ac9f6c2c45e8 | 131 | I2C_SCL = PA_9, |
mbed_official | 5:ac9f6c2c45e8 | 132 | I2C_SDA = PA_10, |
mbed_official | 5:ac9f6c2c45e8 | 133 | SPI_MOSI = PB_5, |
mbed_official | 5:ac9f6c2c45e8 | 134 | SPI_MISO = PB_4, |
mbed_official | 5:ac9f6c2c45e8 | 135 | SPI_SCK = PB_3, |
mbed_official | 5:ac9f6c2c45e8 | 136 | SPI_CS = PA_4, |
mbed_official | 5:ac9f6c2c45e8 | 137 | PWM_OUT = PB_0, |
mbed_official | 5:ac9f6c2c45e8 | 138 | |
mbed_official | 5:ac9f6c2c45e8 | 139 | // Not connected |
mbed_official | 5:ac9f6c2c45e8 | 140 | NC = (int)0xFFFFFFFF |
mbed_official | 5:ac9f6c2c45e8 | 141 | } PinName; |
mbed_official | 5:ac9f6c2c45e8 | 142 | |
mbed_official | 5:ac9f6c2c45e8 | 143 | typedef enum { |
mbed_official | 5:ac9f6c2c45e8 | 144 | PullNone = 0, |
mbed_official | 5:ac9f6c2c45e8 | 145 | PullUp = 1, |
mbed_official | 5:ac9f6c2c45e8 | 146 | PullDown = 2, |
mbed_official | 5:ac9f6c2c45e8 | 147 | OpenDrain = 3, |
mbed_official | 5:ac9f6c2c45e8 | 148 | PullDefault = PullNone |
mbed_official | 5:ac9f6c2c45e8 | 149 | } PinMode; |
mbed_official | 5:ac9f6c2c45e8 | 150 | |
mbed_official | 5:ac9f6c2c45e8 | 151 | #ifdef __cplusplus |
mbed_official | 5:ac9f6c2c45e8 | 152 | } |
mbed_official | 5:ac9f6c2c45e8 | 153 | #endif |
mbed_official | 5:ac9f6c2c45e8 | 154 | |
mbed_official | 5:ac9f6c2c45e8 | 155 | #endif |