raspiezo / mbed-dev

Dependents:   Nucleo_L432KC_Quadrature_Decoder_with_ADC_and_DAC

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Fri Oct 28 11:17:30 2016 +0100
Revision:
149:156823d33999
This updates the lib to the mbed lib v128

NOTE: This release includes a restructuring of the file and directory locations and thus some
include paths in your code may need updating accordingly.

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_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2
<> 149:156823d33999 44 {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3
<> 149:156823d33999 45 {PA_4, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4
<> 149:156823d33999 46 {PA_5, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5
<> 149:156823d33999 47 {PB_0, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8
<> 149:156823d33999 48 {PB_12, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC_IN18
<> 149:156823d33999 49 {PB_13, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC_IN19
<> 149:156823d33999 50 {PB_14, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 20, 0)}, // ADC_IN20
<> 149:156823d33999 51 {PB_15, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 21, 0)}, // ADC_IN21
<> 149:156823d33999 52 {ADC_TEMP, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 16, 0)},
<> 149:156823d33999 53 {ADC_VREF, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 17, 0)},
<> 149:156823d33999 54 {NC, NC, 0}
<> 149:156823d33999 55 };
<> 149:156823d33999 56
<> 149:156823d33999 57 //*** DAC ***
<> 149:156823d33999 58
<> 149:156823d33999 59 const PinMap PinMap_DAC[] = {
<> 149:156823d33999 60 {PA_4, DAC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // DAC_OUT1
<> 149:156823d33999 61 {PA_5, DAC_1, STM_PIN_DATA(STM_MODE_ANALOG, GPIO_NOPULL, 0)}, // DAC_OUT2 (Warning: LED1 is also on this pin)
<> 149:156823d33999 62 {NC, NC, 0}
<> 149:156823d33999 63 };
<> 149:156823d33999 64
<> 149:156823d33999 65 //*** I2C ***
<> 149:156823d33999 66
<> 149:156823d33999 67 const PinMap PinMap_I2C_SDA[] = {
<> 149:156823d33999 68 {PB_9, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
<> 149:156823d33999 69 {NC, NC, 0}
<> 149:156823d33999 70 };
<> 149:156823d33999 71
<> 149:156823d33999 72 const PinMap PinMap_I2C_SCL[] = {
<> 149:156823d33999 73 {PB_8, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
<> 149:156823d33999 74 {NC, NC, 0}
<> 149:156823d33999 75 };
<> 149:156823d33999 76
<> 149:156823d33999 77 //*** PWM ***
<> 149:156823d33999 78
<> 149:156823d33999 79 // TIM2 cannot be used because it is used to clock the SE
<> 149:156823d33999 80 // TIM5 cannot be used because already used by the us_ticker.
<> 149:156823d33999 81 const PinMap PinMap_PWM[] = {
<> 149:156823d33999 82 {PB_0, PWM_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3)}, // TIM3_CH3
<> 149:156823d33999 83 {PB_8, PWM_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4)}, // TIM4_CH3
<> 149:156823d33999 84 {PB_9, PWM_4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4)}, // TIM4_CH4
<> 149:156823d33999 85 {PB_12, PWM_10, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10)}, // TIM10_CH1
<> 149:156823d33999 86 {PB_13, PWM_9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9)}, // TIM9_CH1
<> 149:156823d33999 87 {PB_14, PWM_9, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9)}, // TIM9_CH2
<> 149:156823d33999 88 {PB_15, PWM_11, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11)}, // TIM11_CH1
<> 149:156823d33999 89 {NC, NC, 0}
<> 149:156823d33999 90 };
<> 149:156823d33999 91
<> 149:156823d33999 92 //*** SERIAL ***
<> 149:156823d33999 93
<> 149:156823d33999 94 const PinMap PinMap_UART_TX[] = {
<> 149:156823d33999 95 {PA_2, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
<> 149:156823d33999 96 {PA_9, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
<> 149:156823d33999 97 {PB_10, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
<> 149:156823d33999 98 {NC, NC, 0}
<> 149:156823d33999 99 };
<> 149:156823d33999 100
<> 149:156823d33999 101 const PinMap PinMap_UART_RX[] = {
<> 149:156823d33999 102 {PA_3, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
<> 149:156823d33999 103 {PA_10, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
<> 149:156823d33999 104 {PB_11, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)},
<> 149:156823d33999 105 {NC, NC, 0}
<> 149:156823d33999 106 };
<> 149:156823d33999 107
<> 149:156823d33999 108 //*** SPI ***
<> 149:156823d33999 109
<> 149:156823d33999 110 const PinMap PinMap_SPI_MOSI[] = {
<> 149:156823d33999 111 {PB_5, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
<> 149:156823d33999 112 {PB_15, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
<> 149:156823d33999 113 {NC, NC, 0}
<> 149:156823d33999 114 };
<> 149:156823d33999 115
<> 149:156823d33999 116 const PinMap PinMap_SPI_MISO[] = {
<> 149:156823d33999 117 {PB_4, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
<> 149:156823d33999 118 {PB_14, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
<> 149:156823d33999 119 {NC, NC, 0}
<> 149:156823d33999 120 };
<> 149:156823d33999 121
<> 149:156823d33999 122 const PinMap PinMap_SPI_SCLK[] = {
<> 149:156823d33999 123 {PB_3, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
<> 149:156823d33999 124 {PB_13, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
<> 149:156823d33999 125 {NC, NC, 0}
<> 149:156823d33999 126 };
<> 149:156823d33999 127
<> 149:156823d33999 128 const PinMap PinMap_SPI_SSEL[] = {
<> 149:156823d33999 129 {PA_15, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
<> 149:156823d33999 130 {PB_12, SPI_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
<> 149:156823d33999 131 {NC, NC, 0}
<> 149:156823d33999 132 };