|
| 1 | +/* mbed Microcontroller Library |
| 2 | + ******************************************************************************* |
| 3 | + * Copyright (c) 2016, STMicroelectronics |
| 4 | + * All rights reserved. |
| 5 | + * |
| 6 | + * Redistribution and use in source and binary forms, with or without |
| 7 | + * modification, are permitted provided that the following conditions are met: |
| 8 | + * |
| 9 | + * 1. Redistributions of source code must retain the above copyright notice, |
| 10 | + * this list of conditions and the following disclaimer. |
| 11 | + * 2. Redistributions in binary form must reproduce the above copyright notice, |
| 12 | + * this list of conditions and the following disclaimer in the documentation |
| 13 | + * and/or other materials provided with the distribution. |
| 14 | + * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| 15 | + * may be used to endorse or promote products derived from this software |
| 16 | + * without specific prior written permission. |
| 17 | + * |
| 18 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 19 | + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 20 | + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 21 | + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| 22 | + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| 23 | + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| 24 | + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 25 | + * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 26 | + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 | + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | + ******************************************************************************* |
| 29 | + */ |
| 30 | + |
| 31 | +#include "PeripheralPins.h" |
| 32 | + |
| 33 | +// ===== |
| 34 | +// Note: Commented lines are alternative possibilities which are not used per default. |
| 35 | +// If you change them, you will have also to modify the corresponding xxx_api.c file |
| 36 | +// for pwmout, analogin, analogout, ... |
| 37 | +// ===== |
| 38 | + |
| 39 | +//*** ADC *** |
| 40 | + |
| 41 | +const PinMap PinMap_ADC[] = { |
| 42 | + {ADC00, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 6, 0)}, // IN6 |
| 43 | + {ADC01, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 3, 0)}, // IN3 |
| 44 | + {ADC02, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG_ADC_CONTROL, GPIO_NOPULL, 0, 13, 0)}, // IN13 |
| 45 | + {NC, NC, 0} |
| 46 | +}; |
| 47 | + |
| 48 | +const PinMap PinMap_ADC_Internal[] = { |
| 49 | + {NC, NC, 0} |
| 50 | +}; |
| 51 | + |
| 52 | +//*** DAC *** |
| 53 | + |
| 54 | +const PinMap PinMap_DAC[] = { |
| 55 | + {NC, NC, 0} |
| 56 | +}; |
| 57 | + |
| 58 | +//*** I2C *** |
| 59 | + |
| 60 | +const PinMap PinMap_I2C_SDA[] = { |
| 61 | + {I2C0_SDA, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, |
| 62 | + {I2C1_SDA, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, |
| 63 | + {NC, NC, 0} |
| 64 | +}; |
| 65 | + |
| 66 | +const PinMap PinMap_I2C_SCL[] = { |
| 67 | + {I2C0_SCL, I2C_1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, |
| 68 | + {I2C1_SCL, I2C_2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, |
| 69 | + {NC, NC, 0} |
| 70 | +}; |
| 71 | + |
| 72 | +//*** PWM *** |
| 73 | + |
| 74 | +// Warning: TIM5 cannot be used because already used by the us_ticker. |
| 75 | +const PinMap PinMap_PWM[] = { |
| 76 | + {PWM0_OUT, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 |
| 77 | + {PWM1_OUT, PWM_3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 |
| 78 | + {NC, NC, 0} |
| 79 | +}; |
| 80 | + |
| 81 | +//*** SERIAL *** |
| 82 | + |
| 83 | +const PinMap PinMap_UART_TX[] = { |
| 84 | + {UART2_TX, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, |
| 85 | + {UART_TXD, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, |
| 86 | + {LPUART1_TX, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, |
| 87 | + {UART1_TX, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, |
| 88 | + {NC, NC, 0} |
| 89 | +}; |
| 90 | + |
| 91 | +const PinMap PinMap_UART_RX[] = { |
| 92 | + {UART2_RX, UART_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, |
| 93 | + {UART_RXD, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, |
| 94 | + {LPUART1_RX, LPUART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)}, |
| 95 | + {UART1_RX, UART_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, |
| 96 | + {NC, NC, 0} |
| 97 | +}; |
| 98 | + |
| 99 | +const PinMap PinMap_UART_RTS[] = { |
| 100 | + {UART_RTS, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, |
| 101 | + {NC, NC, 0} |
| 102 | +}; |
| 103 | + |
| 104 | +const PinMap PinMap_UART_CTS[] = { |
| 105 | + {UART_CTS, UART_3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, |
| 106 | + {NC, NC, 0} |
| 107 | +}; |
| 108 | + |
| 109 | +//*** SPI *** |
| 110 | + |
| 111 | +const PinMap PinMap_SPI_MOSI[] = { |
| 112 | + {SPI_MOSI, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // ARDUINO D11 |
| 113 | + {NC, NC, 0} |
| 114 | +}; |
| 115 | + |
| 116 | +const PinMap PinMap_SPI_MISO[] = { |
| 117 | + {SPI_MISO, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // ARDUINO D12 |
| 118 | + {NC, NC, 0} |
| 119 | +}; |
| 120 | + |
| 121 | +const PinMap PinMap_SPI_SCLK[] = { |
| 122 | + {SPI_SCK, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // ARDUINO D13 |
| 123 | + {NC, NC, 0} |
| 124 | +}; |
| 125 | + |
| 126 | +const PinMap PinMap_SPI_SSEL[] = { |
| 127 | + {SPI_CS0, SPI_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, |
| 128 | + {NC, NC, 0} |
| 129 | +}; |
| 130 | + |
| 131 | +const PinMap PinMap_CAN_RD[] = { |
| 132 | + {NC, NC, 0} |
| 133 | +}; |
| 134 | + |
| 135 | +const PinMap PinMap_CAN_TD[] = { |
| 136 | + {NC, NC, 0} |
| 137 | +}; |
0 commit comments