mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Committer:
Kojto
Date:
Wed Jul 19 17:31:21 2017 +0100
Revision:
169:e3b6fe271b81
Parent:
149:156823d33999
Child:
176:447f873cad2f
This updates the lib to the mbed lib v 147

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 149:156823d33999 1 /* mbed Microcontroller Library
<> 149:156823d33999 2 *******************************************************************************
<> 149:156823d33999 3 * Copyright (c) 2016, STMicroelectronics
<> 149:156823d33999 4 * All rights reserved.
<> 149:156823d33999 5 *
<> 149:156823d33999 6 * Redistribution and use in source and binary forms, with or without
<> 149:156823d33999 7 * modification, are permitted provided that the following conditions are met:
<> 149:156823d33999 8 *
<> 149:156823d33999 9 * 1. Redistributions of source code must retain the above copyright notice,
<> 149:156823d33999 10 * this list of conditions and the following disclaimer.
<> 149:156823d33999 11 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 149:156823d33999 12 * this list of conditions and the following disclaimer in the documentation
<> 149:156823d33999 13 * and/or other materials provided with the distribution.
<> 149:156823d33999 14 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 149:156823d33999 15 * may be used to endorse or promote products derived from this software
<> 149:156823d33999 16 * without specific prior written permission.
<> 149:156823d33999 17 *
<> 149:156823d33999 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 149:156823d33999 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 149:156823d33999 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 149:156823d33999 21 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 149:156823d33999 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 149:156823d33999 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 149:156823d33999 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 149:156823d33999 25 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 149:156823d33999 26 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 149:156823d33999 27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 149:156823d33999 28 *******************************************************************************
<> 149:156823d33999 29 */
<> 149:156823d33999 30
<> 149:156823d33999 31 #include "PeripheralPins.h"
<> 149:156823d33999 32
<> 149:156823d33999 33 // =====
<> 149:156823d33999 34 // Note: Commented lines are alternative possibilities which are not used per default.
<> 149:156823d33999 35 // If you change them, you will have also to modify the corresponding xxx_api.c file
<> 149:156823d33999 36 // for pwmout, analogin, analogout, ...
<> 149:156823d33999 37 // =====
<> 149:156823d33999 38
<> 149:156823d33999 39 //*** ADC ***
<> 149:156823d33999 40
<> 149:156823d33999 41 const PinMap PinMap_ADC[] = {
<> 149:156823d33999 42 {PA_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0
<> 149:156823d33999 43 {PA_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1
<> 149:156823d33999 44 {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2
<> 149:156823d33999 45 {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3
<> 149:156823d33999 46 {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4
<> 149:156823d33999 47 {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5
<> 149:156823d33999 48 {PA_6, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6
<> 149:156823d33999 49 {PA_7, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7
<> 149:156823d33999 50 {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8
<> 149:156823d33999 51 {PB_1, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9
Kojto 169:e3b6fe271b81 52 {NC, NC, 0}
Kojto 169:e3b6fe271b81 53 };
Kojto 169:e3b6fe271b81 54
Kojto 169:e3b6fe271b81 55 const PinMap PinMap_ADC_Internal[] = {
<> 149:156823d33999 56 {ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // See in analogin_api.c the correct ADC channel used
<> 149:156823d33999 57 {ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)}, // See in analogin_api.c the correct ADC channel used
<> 149:156823d33999 58 {NC, NC, 0}
<> 149:156823d33999 59 };
<> 149:156823d33999 60
<> 149:156823d33999 61 //*** DAC ***
<> 149:156823d33999 62
<> 149:156823d33999 63 const PinMap PinMap_DAC[] = {
<> 149:156823d33999 64 {NC, NC, 0}
<> 149:156823d33999 65 };
<> 149:156823d33999 66
<> 149:156823d33999 67
<> 149:156823d33999 68 //*** I2C ***
<> 149:156823d33999 69
<> 149:156823d33999 70 const PinMap PinMap_I2C_SDA[] = {
<> 149:156823d33999 71 {PA_10, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
<> 149:156823d33999 72 {PA_13, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF3_I2C1)},
<> 149:156823d33999 73 {PB_7, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
<> 149:156823d33999 74 {NC, NC, 0}
<> 149:156823d33999 75 };
<> 149:156823d33999 76
<> 149:156823d33999 77 const PinMap PinMap_I2C_SCL[] = {
<> 149:156823d33999 78 {PA_4, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF3_I2C1)},
<> 149:156823d33999 79 {PA_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
<> 149:156823d33999 80 {PB_6, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
<> 149:156823d33999 81 {NC, NC, 0}
<> 149:156823d33999 82 };
<> 149:156823d33999 83
<> 149:156823d33999 84 //*** PWM ***
<> 149:156823d33999 85
<> 149:156823d33999 86 // TIM21 cannot be used because already used by the us_ticker
<> 149:156823d33999 87 const PinMap PinMap_PWM[] = {
<> 149:156823d33999 88 {PA_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1
<> 149:156823d33999 89 {PA_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
<> 149:156823d33999 90 // {PA_2, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1
<> 149:156823d33999 91 // {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3 - used by STDIO TX
<> 149:156823d33999 92 // {PA_3, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 2, 0)}, // TIM21_CH2
<> 149:156823d33999 93 {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4
<> 149:156823d33999 94 {PA_5, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
<> 149:156823d33999 95 {PA_8, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1
<> 149:156823d33999 96 // {PA_9, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM21, 2, 0)}, // TIM21_CH2
<> 149:156823d33999 97 // {PA_10, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM21, 1, 0)}, // TIM21_CH1
<> 149:156823d33999 98 {PA_10, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 3, 0)}, // TIM2_CH3
<> 149:156823d33999 99 // {PA_11, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM21, 2, 0)}, // TIM21_CH2
<> 149:156823d33999 100 // {PA_15, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 1, 0)}, // TIM2_CH1 - used by STDIO RX
<> 149:156823d33999 101 // {PB_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
<> 149:156823d33999 102 {PB_0, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 3, 0)}, // TIM2_CH3
<> 149:156823d33999 103 {PB_1, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 4, 0)}, // TIM2_CH4
<> 149:156823d33999 104 {PB_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
<> 149:156823d33999 105 // {PB_5, PWM_21, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM21, 1, 0)}, // TIM21_CH1
<> 149:156823d33999 106 {PB_6, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 3, 0)}, // TIM2_CH3
<> 149:156823d33999 107 {PB_7, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM2, 4, 0)}, // TIM2_CH4
<> 149:156823d33999 108 {NC, NC, 0}
<> 149:156823d33999 109 };
<> 149:156823d33999 110
<> 149:156823d33999 111 //*** SERIAL ***
<> 149:156823d33999 112
<> 149:156823d33999 113 const PinMap PinMap_UART_TX[] = {
<> 149:156823d33999 114 {PA_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 115 // {PA_2, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 116 {PA_2, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 117 {PA_4, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 118 {PA_9, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 119 // {PA_14, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 120 {PA_14, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 121 // {PB_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 122 {PB_6, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
<> 149:156823d33999 123 {NC, NC, 0}
<> 149:156823d33999 124 };
<> 149:156823d33999 125
<> 149:156823d33999 126 const PinMap PinMap_UART_RX[] = {
<> 149:156823d33999 127 // {PA_0, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 128 {PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
<> 149:156823d33999 129 // {PA_3, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 130 {PA_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 131 {PA_10, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 132 {PA_13, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 133 {PA_15, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 134 // {PB_7, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_LPUART1)},
<> 149:156823d33999 135 {PB_7, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
<> 149:156823d33999 136 {NC, NC, 0}
<> 149:156823d33999 137 };
<> 149:156823d33999 138
<> 149:156823d33999 139 const PinMap PinMap_UART_RTS[] = {
<> 149:156823d33999 140 {PA_1, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 141 {PB_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 142 {PB_1, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
<> 149:156823d33999 143 {PA_12, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 144 {NC, NC, 0}
<> 149:156823d33999 145 };
<> 149:156823d33999 146
<> 149:156823d33999 147 const PinMap PinMap_UART_CTS[] = {
<> 149:156823d33999 148 {PA_0, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 149 {PA_6, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_LPUART1)},
<> 149:156823d33999 150 {PA_7, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 151 {PA_11, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART2)},
<> 149:156823d33999 152 {NC, NC, 0}
<> 149:156823d33999 153 };
<> 149:156823d33999 154
<> 149:156823d33999 155 //*** SPI ***
<> 149:156823d33999 156
<> 149:156823d33999 157 const PinMap PinMap_SPI_MOSI[] = {
<> 149:156823d33999 158 {PA_7, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 159 {PA_12, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 160 {PB_1, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI1)},
<> 149:156823d33999 161 {PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 162 {NC, NC, 0}
<> 149:156823d33999 163 };
<> 149:156823d33999 164
<> 149:156823d33999 165 const PinMap PinMap_SPI_MISO[] = {
<> 149:156823d33999 166 {PA_6, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 167 {PA_11, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 168 {PA_14, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
<> 149:156823d33999 169 {PB_0, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI1)},
<> 149:156823d33999 170 {PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 171 {NC, NC, 0}
<> 149:156823d33999 172 };
<> 149:156823d33999 173
<> 149:156823d33999 174 const PinMap PinMap_SPI_SCLK[] = {
<> 149:156823d33999 175 {PA_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 176 {PA_13, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
<> 149:156823d33999 177 {PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 178 {NC, NC, 0}
<> 149:156823d33999 179 };
<> 149:156823d33999 180
<> 149:156823d33999 181 const PinMap PinMap_SPI_SSEL[] = {
<> 149:156823d33999 182 {PA_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
<> 149:156823d33999 183 // {PA_15, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)}, - used by STDIO RX
<> 149:156823d33999 184 {NC, NC, 0}
<> 149:156823d33999 185 };