1+ /* mbed Microcontroller Library
2+ *******************************************************************************
3+ * Copyright (c) 2018, 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+ //==============================================================================
32+ // Notes
33+ //
34+ // - The pins mentioned Px_y_ALTz are alternative possibilities which use other
35+ // HW peripheral instances. You can use them the same way as any other "normal"
36+ // pin (i.e. PwmOut pwm(PA_7_ALT0);). These pins are not displayed on the board
37+ // pinout image on mbed.org.
38+ //
39+ // - The pins which are connected to other components present on the board have
40+ // the comment "Connected to xxx". The pin function may not work properly in this
41+ // case. These pins may not be displayed on the board pinout image on mbed.org.
42+ // Please read the board reference manual and schematic for more information.
43+ //
44+ // - Warning: pins connected to the default STDIO_UART_TX and STDIO_UART_RX pins are commented
45+ // See https://os.mbed.com/teams/ST/wiki/STDIO for more information.
46+ //
47+ //==============================================================================
48+
49+ #ifndef MBED_PERIPHERALPINMAPS_H
50+ #define MBED_PERIPHERALPINMAPS_H
51+
52+ #include <mstd_cstddef>
53+
54+ //*** ADC ***
55+
56+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_ADC [] = {
57+ {PA_0 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 0 , 0 )}, // ADC1_IN0
58+ {PA_1 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 1 , 0 )}, // ADC1_IN1
59+ // {PA_2, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2 // Connected to STDIO_UART_TX
60+ // {PA_3, ADC_1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3 // Connected to STDIO_UART_RX
61+ {PA_4 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 4 , 0 )}, // ADC1_IN4
62+ {PA_5 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 5 , 0 )}, // ADC1_IN5 // Connected to LD2 [Green Led]
63+ {PA_6 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 6 , 0 )}, // ADC1_IN6
64+ {PA_7 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 7 , 0 )}, // ADC1_IN7
65+ {PB_0 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 8 , 0 )}, // ADC1_IN8
66+ {PB_1 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 9 , 0 )}, // ADC1_IN9
67+ {PC_0 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 10 , 0 )}, // ADC1_IN10
68+ {PC_1 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 11 , 0 )}, // ADC1_IN11
69+ {PC_2 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 12 , 0 )}, // ADC1_IN12
70+ {PC_3 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 13 , 0 )}, // ADC1_IN13
71+ {PC_4 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 14 , 0 )}, // ADC1_IN14
72+ {PC_5 , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 15 , 0 )}, // ADC1_IN15
73+ {NC , NC , 0 }
74+ };
75+
76+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_ADC_Internal [] = {
77+ {ADC_TEMP , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 16 , 0 )},
78+ {ADC_VREF , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 17 , 0 )},
79+ {ADC_VBAT , ADC_1 , STM_PIN_DATA_EXT (STM_MODE_ANALOG , GPIO_NOPULL , 0 , 18 , 0 )},
80+ {NC , NC , 0 }
81+ };
82+
83+ //*** I2C ***
84+
85+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_I2C_SDA [] = {
86+ {PB_3 , I2C_2 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF9_I2C2 )}, // Connected to SWO
87+ {PB_4 , I2C_3 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF9_I2C3 )},
88+ {PB_7 , I2C_1 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF4_I2C1 )},
89+ {PB_8 , I2C_3 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF9_I2C3 )},
90+ {PB_9 , I2C_1 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF4_I2C1 )},
91+ {PB_9_ALT0 , I2C_2 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF9_I2C2 )},
92+ {PC_9 , I2C_3 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF4_I2C3 )},
93+ {NC , NC , 0 }
94+ };
95+
96+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_I2C_SCL [] = {
97+ {PA_8 , I2C_3 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF4_I2C3 )},
98+ {PB_6 , I2C_1 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF4_I2C1 )},
99+ {PB_8 , I2C_1 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF4_I2C1 )},
100+ {PB_10 , I2C_2 , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_NOPULL , GPIO_AF4_I2C2 )},
101+ {NC , NC , 0 }
102+ };
103+
104+ //*** PWM ***
105+
106+ // TIM5 cannot be used because already used by the us_ticker
107+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_PWM [] = {
108+ {PA_0 , PWM_2 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM2 , 1 , 0 )}, // TIM2_CH1
109+ // {PA_0, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1
110+ {PA_1 , PWM_2 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM2 , 2 , 0 )}, // TIM2_CH2
111+ // {PA_1, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2
112+ // {PA_2, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 // Connected to STDIO_UART_TX
113+ // {PA_2, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 // Connected to STDIO_UART_TX
114+ // {PA_2, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 // Connected to STDIO_UART_TX
115+ // {PA_3, PWM_2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 // Connected to STDIO_UART_RX
116+ // {PA_3, PWM_5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 // Connected to STDIO_UART_RX
117+ // {PA_3, PWM_9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 // Connected to STDIO_UART_RX
118+ {PA_5 , PWM_2 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM2 , 1 , 0 )}, // TIM2_CH1 // Connected to LD2 [Green Led]
119+ {PA_6 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 1 , 0 )}, // TIM3_CH1
120+ {PA_7 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 1 , 1 )}, // TIM1_CH1N
121+ {PA_7_ALT0 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 2 , 0 )}, // TIM3_CH2
122+ {PA_8 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 1 , 0 )}, // TIM1_CH1
123+ {PA_9 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 2 , 0 )}, // TIM1_CH2
124+ {PA_10 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 3 , 0 )}, // TIM1_CH3
125+ {PA_11 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 4 , 0 )}, // TIM1_CH4
126+ {PA_15 , PWM_2 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM2 , 1 , 0 )}, // TIM2_CH1
127+ {PB_0 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 2 , 1 )}, // TIM1_CH2N
128+ {PB_0_ALT0 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 3 , 0 )}, // TIM3_CH3
129+ {PB_1 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 3 , 1 )}, // TIM1_CH3N
130+ {PB_1_ALT0 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 4 , 0 )}, // TIM3_CH4
131+ {PB_3 , PWM_2 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM2 , 2 , 0 )}, // TIM2_CH2 // Connected to SWO
132+ {PB_4 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 1 , 0 )}, // TIM3_CH1
133+ {PB_5 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 2 , 0 )}, // TIM3_CH2
134+ {PB_6 , PWM_4 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM4 , 1 , 0 )}, // TIM4_CH1
135+ {PB_7 , PWM_4 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM4 , 2 , 0 )}, // TIM4_CH2
136+ {PB_8 , PWM_4 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM4 , 3 , 0 )}, // TIM4_CH3
137+ {PB_8_ALT0 , PWM_10 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF3_TIM10 , 1 , 0 )}, // TIM10_CH1
138+ {PB_9 , PWM_4 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM4 , 4 , 0 )}, // TIM4_CH4
139+ {PB_9_ALT0 , PWM_11 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF3_TIM11 , 1 , 0 )}, // TIM11_CH1
140+ {PB_10 , PWM_2 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM2 , 3 , 0 )}, // TIM2_CH3
141+ {PB_13 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 1 , 1 )}, // TIM1_CH1N
142+ {PB_14 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 2 , 1 )}, // TIM1_CH2N
143+ {PB_15 , PWM_1 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF1_TIM1 , 3 , 1 )}, // TIM1_CH3N
144+ {PC_6 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 1 , 0 )}, // TIM3_CH1
145+ {PC_7 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 2 , 0 )}, // TIM3_CH2
146+ {PC_8 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 3 , 0 )}, // TIM3_CH3
147+ {PC_9 , PWM_3 , STM_PIN_DATA_EXT (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF2_TIM3 , 4 , 0 )}, // TIM3_CH4
148+ {NC , NC , 0 }
149+ };
150+
151+ //*** SERIAL ***
152+
153+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_UART_TX [] = {
154+ {PA_2 , UART_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART2 )}, // Connected to STDIO_UART_TX
155+ {PA_9 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )},
156+ {PA_11 , UART_6 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF8_USART6 )},
157+ {PA_15 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )},
158+ {PB_6 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )},
159+ {PC_6 , UART_6 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF8_USART6 )},
160+ {NC , NC , 0 }
161+ };
162+
163+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_UART_RX [] = {
164+ {PA_3 , UART_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART2 )}, // Connected to STDIO_UART_RX
165+ {PA_10 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )},
166+ {PA_12 , UART_6 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF8_USART6 )},
167+ {PB_3 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )}, // Connected to SWO
168+ {PB_7 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )},
169+ {PC_7 , UART_6 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF8_USART6 )},
170+ {NC , NC , 0 }
171+ };
172+
173+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_UART_RTS [] = {
174+ {PA_1 , UART_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART2 )},
175+ {PA_12 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )},
176+ {NC , NC , 0 }
177+ };
178+
179+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_UART_CTS [] = {
180+ {PA_0 , UART_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART2 )},
181+ {PA_11 , UART_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF7_USART1 )},
182+ {NC , NC , 0 }
183+ };
184+
185+ //*** SPI ***
186+
187+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_SPI_MOSI [] = {
188+ {PA_1 , SPI_4 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI4 )},
189+ {PA_7 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )},
190+ {PA_10 , SPI_5 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI5 )},
191+ {PB_5 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )},
192+ {PB_5_ALT0 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )},
193+ {PB_8 , SPI_5 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI5 )},
194+ {PB_15 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
195+ {PC_3 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
196+ {PC_12 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )},
197+ {NC , NC , 0 }
198+ };
199+
200+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_SPI_MISO [] = {
201+ {PA_6 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )},
202+ {PA_11 , SPI_4 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI4 )},
203+ {PA_12 , SPI_5 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI5 )},
204+ {PB_4 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )},
205+ {PB_4_ALT0 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )},
206+ {PB_14 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
207+ {PC_2 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
208+ {PC_11 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )},
209+ {NC , NC , 0 }
210+ };
211+
212+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_SPI_SCLK [] = {
213+ {PA_5 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )}, // Connected to LD2 [Green Led]
214+ {PB_0 , SPI_5 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI5 )},
215+ {PB_3 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )}, // Connected to SWO
216+ {PB_3_ALT0 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )}, // Connected to SWO
217+ {PB_10 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
218+ {PB_12 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF7_SPI3 )},
219+ {PB_13 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
220+ {PB_13_ALT0 , SPI_4 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI4 )},
221+ {PC_7 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
222+ {PC_10 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )},
223+ {NC , NC , 0 }
224+ };
225+
226+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_SPI_SSEL [] = {
227+ {PA_4 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )},
228+ {PA_4_ALT0 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )},
229+ {PA_15 , SPI_1 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI1 )},
230+ {PA_15_ALT0 , SPI_3 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI3 )},
231+ {PB_1 , SPI_5 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI5 )},
232+ {PB_9 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
233+ {PB_12 , SPI_2 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF5_SPI2 )},
234+ {PB_12_ALT0 , SPI_4 , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_NOPULL , GPIO_AF6_SPI4 )},
235+ {NC , NC , 0 }
236+ };
237+
238+ //*** USBDEVICE ***
239+
240+ MSTD_CONSTEXPR_OBJ_11 const PinMap PinMap_USB_FS [] = {
241+ // {PA_8, USB_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
242+ {PA_9 , USB_FS , STM_PIN_DATA (STM_MODE_INPUT , GPIO_NOPULL , GPIO_AF10_OTG_FS )}, // USB_OTG_FS_VBUS
243+ {PA_10 , USB_FS , STM_PIN_DATA (STM_MODE_AF_OD , GPIO_PULLUP , GPIO_AF10_OTG_FS )}, // USB_OTG_FS_ID
244+ {PA_11 , USB_FS , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF10_OTG_FS )}, // USB_OTG_FS_DM
245+ {PA_12 , USB_FS , STM_PIN_DATA (STM_MODE_AF_PP , GPIO_PULLUP , GPIO_AF10_OTG_FS )}, // USB_OTG_FS_DP
246+ {NC , NC , 0 }
247+ };
248+
249+ #define PINMAP_ANALOGIN PinMap_ADC
250+ #define PINMAP_I2C_SDA PinMap_I2C_SDA
251+ #define PINMAP_I2C_SCL PinMap_I2C_SCL
252+ #define PINMAP_UART_TX PinMap_UART_TX
253+ #define PINMAP_UART_RX PinMap_UART_RX
254+ #define PINMAP_UART_CTS PinMap_UART_CTS
255+ #define PINMAP_UART_RTS PinMap_UART_RTS
256+ #define PINMAP_SPI_SCLK PinMap_SPI_SCLK
257+ #define PINMAP_SPI_MOSI PinMap_SPI_MOSI
258+ #define PINMAP_SPI_MISO PinMap_SPI_MISO
259+ #define PINMAP_SPI_SSEL PinMap_SPI_SSEL
260+ #define PINMAP_PWM PinMap_PWM
261+
262+ #endif
0 commit comments