Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6fefa91

Browse files
committedSep 11, 2020
Added new variant: NUCLEO_F070RB.
1 parent 9d3b308 commit 6fefa91

File tree

5 files changed

+775
-0
lines changed

5 files changed

+775
-0
lines changed
 
Lines changed: 265 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,265 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
* Automatically generated from STM32F072R(8-B)Tx.xml
13+
*/
14+
#include "Arduino.h"
15+
#include "PeripheralPins.h"
16+
17+
/* =====
18+
* Note: Commented lines are alternative possibilities which are not used per default.
19+
* If you change them, you will have to know what you do
20+
* =====
21+
*/
22+
23+
//*** ADC ***
24+
25+
#ifdef HAL_ADC_MODULE_ENABLED
26+
WEAK const PinMap PinMap_ADC[] = {
27+
{PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0
28+
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1
29+
// {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2- D1 - STLink Tx
30+
// {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3- D0 - STLink Rx
31+
{PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4
32+
// {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5 - D13 (LED1)
33+
{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6
34+
{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7
35+
{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8
36+
// {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9 - NC
37+
{PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC_IN10
38+
{PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC_IN11
39+
{PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC_IN12
40+
{PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC_IN13
41+
{PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC_IN14
42+
{PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC_IN15
43+
{NC, NP, 0}
44+
};
45+
#endif
46+
47+
//*** DAC ***
48+
49+
#ifdef HAL_DAC_MODULE_ENABLED
50+
WEAK const PinMap PinMap_DAC[] = {
51+
{PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
52+
{PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2
53+
{NC, NP, 0}
54+
};
55+
#endif
56+
57+
//*** I2C ***
58+
59+
#ifdef HAL_I2C_MODULE_ENABLED
60+
WEAK const PinMap PinMap_I2C_SDA[] = {
61+
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
62+
{PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
63+
{PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C2)},
64+
{PB_14, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF5_I2C2)},
65+
{NC, NP, 0}
66+
};
67+
#endif
68+
69+
#ifdef HAL_I2C_MODULE_ENABLED
70+
WEAK const PinMap PinMap_I2C_SCL[] = {
71+
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
72+
{PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
73+
{PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C2)},
74+
{PB_13, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF5_I2C2)},
75+
{NC, NP, 0}
76+
};
77+
#endif
78+
79+
//*** PWM ***
80+
81+
#ifdef HAL_TIM_MODULE_ENABLED
82+
WEAK const PinMap PinMap_PWM[] = {
83+
// {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1
84+
// {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
85+
{PA_1, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM15, 1, 1)}, // TIM15_CH1N
86+
// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3
87+
// {PA_2, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM15, 1, 0)}, // TIM15_CH1
88+
// {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4
89+
// {PA_3, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM15, 2, 0)}, // TIM15_CH2
90+
{PA_4, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM14, 1, 0)}, // TIM14_CH1
91+
// {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1
92+
// {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 1, 0)}, // TIM3_CH1
93+
{PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM16, 1, 0)}, // TIM16_CH1
94+
// {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 1, 1)}, // TIM1_CH1N
95+
// {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 2, 0)}, // TIM3_CH2
96+
// {PA_7, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM14, 1, 0)}, // TIM14_CH1
97+
{PA_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM17, 1, 0)}, // TIM17_CH1
98+
{PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 1, 0)}, // TIM1_CH1
99+
{PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 2, 0)}, // TIM1_CH2
100+
{PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 3, 0)}, // TIM1_CH3
101+
{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 4, 0)}, // TIM1_CH4
102+
// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 1, 0)}, // TIM2_CH1
103+
// {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 2, 1)}, // TIM1_CH2N
104+
{PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 3, 0)}, // TIM3_CH3
105+
// {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 3, 1)}, // TIM1_CH3N
106+
// {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 4, 0)}, // TIM3_CH4
107+
// {PB_1, TIM14, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM14, 1, 0)}, // TIM14_CH1
108+
// {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 2, 0)}, // TIM2_CH2
109+
{PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 1, 0)}, // TIM3_CH1
110+
{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM3, 2, 0)}, // TIM3_CH2
111+
{PB_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM16, 1, 1)}, // TIM16_CH1N
112+
{PB_7, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM17, 1, 1)}, // TIM17_CH1N
113+
{PB_8, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM16, 1, 0)}, // TIM16_CH1
114+
{PB_9, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM17, 1, 0)}, // TIM17_CH1
115+
// {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 3, 0)}, // TIM2_CH3
116+
// {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM2, 4, 0)}, // TIM2_CH4
117+
{PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 1, 1)}, // TIM1_CH1N
118+
{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 2, 1)}, // TIM1_CH2N
119+
// {PB_14, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 1, 0)}, // TIM15_CH1
120+
// {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM1, 3, 1)}, // TIM1_CH3N
121+
// {PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM15, 1, 1)}, // TIM15_CH1N
122+
{PB_15, TIM15, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM15, 2, 0)}, // TIM15_CH2
123+
{PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM3, 1, 0)}, // TIM3_CH1
124+
{PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM3, 2, 0)}, // TIM3_CH2
125+
{PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM3, 3, 0)}, // TIM3_CH3
126+
{PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_TIM3, 4, 0)}, // TIM3_CH4
127+
{NC, NP, 0}
128+
};
129+
#endif
130+
131+
//*** SERIAL ***
132+
133+
#ifdef HAL_UART_MODULE_ENABLED
134+
WEAK const PinMap PinMap_UART_TX[] = {
135+
{PA_0, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART4)},
136+
{PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
137+
{PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
138+
// {PA_14, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)}, // SWCLK
139+
{PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)},
140+
{PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
141+
{PC_4, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART3)},
142+
{PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART3)},
143+
{PC_10, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART4)},
144+
{NC, NP, 0}
145+
};
146+
#endif
147+
148+
#ifdef HAL_UART_MODULE_ENABLED
149+
WEAK const PinMap PinMap_UART_RX[] = {
150+
{PA_1, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART4)},
151+
{PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
152+
{PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
153+
{PA_15, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
154+
{PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART1)},
155+
{PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
156+
{PC_5, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART3)},
157+
// {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART3)},
158+
{PC_11, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART4)},
159+
{NC, NP, 0}
160+
};
161+
#endif
162+
163+
#ifdef HAL_UART_MODULE_ENABLED
164+
WEAK const PinMap PinMap_UART_RTS[] = {
165+
{PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
166+
{PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
167+
{PA_15, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART4)},
168+
{PB_1, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
169+
{PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
170+
{PD_2, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART3)},
171+
{NC, NP, 0}
172+
};
173+
#endif
174+
175+
#ifdef HAL_UART_MODULE_ENABLED
176+
WEAK const PinMap PinMap_UART_CTS[] = {
177+
{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART2)},
178+
{PA_6, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
179+
{PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART1)},
180+
{PB_7, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART4)},
181+
{PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
182+
{NC, NP, 0}
183+
};
184+
#endif
185+
186+
//*** SPI ***
187+
188+
#ifdef HAL_SPI_MODULE_ENABLED
189+
WEAK const PinMap PinMap_SPI_MOSI[] = {
190+
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
191+
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
192+
{PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
193+
{PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI2)},
194+
{NC, NP, 0}
195+
};
196+
#endif
197+
198+
#ifdef HAL_SPI_MODULE_ENABLED
199+
WEAK const PinMap PinMap_SPI_MISO[] = {
200+
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
201+
{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
202+
{PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
203+
{PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_SPI2)},
204+
{NC, NP, 0}
205+
};
206+
#endif
207+
208+
#ifdef HAL_SPI_MODULE_ENABLED
209+
WEAK const PinMap PinMap_SPI_SCLK[] = {
210+
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
211+
{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
212+
{PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
213+
{PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
214+
{NC, NP, 0}
215+
};
216+
#endif
217+
218+
#ifdef HAL_SPI_MODULE_ENABLED
219+
WEAK const PinMap PinMap_SPI_SSEL[] = {
220+
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
221+
{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
222+
{PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
223+
{PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI2)},
224+
{NC, NP, 0}
225+
};
226+
#endif
227+
228+
//*** CAN ***
229+
230+
#ifdef HAL_CAN_MODULE_ENABLED
231+
WEAK const PinMap PinMap_CAN_RD[] = {
232+
{PA_11, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
233+
{PB_8, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
234+
{NC, NP, 0}
235+
};
236+
#endif
237+
238+
#ifdef HAL_CAN_MODULE_ENABLED
239+
WEAK const PinMap PinMap_CAN_TD[] = {
240+
{PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
241+
{PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF4_CAN)},
242+
{NC, NP, 0}
243+
};
244+
#endif
245+
246+
//*** No ETHERNET ***
247+
248+
//*** No QUADSPI ***
249+
250+
//*** USB ***
251+
252+
#ifdef HAL_PCD_MODULE_ENABLED
253+
WEAK const PinMap PinMap_USB[] = {
254+
{PA_11, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM
255+
{PA_12, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP
256+
{PA_13, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_USB)}, // USB_NOE
257+
{NC, NP, 0}
258+
};
259+
#endif
260+
261+
//*** No USB_OTG_FS ***
262+
263+
//*** No USB_OTG_HS ***
264+
265+
//*** No SD ***

‎variants/NUCLEO_F070RB/PinNamesVar.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = PA_0,
4+
#endif
5+
#ifdef PWR_WAKEUP_PIN2
6+
SYS_WKUP2 = PC_13,
7+
#endif
8+
// NO WKUP3
9+
#ifdef PWR_WAKEUP_PIN4
10+
SYS_WKUP4 = PA_2,
11+
#endif
12+
#ifdef PWR_WAKEUP_PIN5
13+
SYS_WKUP5 = PC_5,
14+
#endif
15+
#ifdef PWR_WAKEUP_PIN6
16+
SYS_WKUP6 = PB_5,
17+
#endif
18+
#ifdef PWR_WAKEUP_PIN7
19+
SYS_WKUP7 = PB_15,
20+
#endif
21+
// NO WKUP8
22+
/* USB */
23+
#ifdef USBCON
24+
USB_DM = PA_11,
25+
USB_DP = PA_12,
26+
USB_NOE = PA_13,
27+
#endif

‎variants/NUCLEO_F070RB/ldscript.ld

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
/*
2+
*****************************************************************************
3+
**
4+
5+
** File : ldscript.ld
6+
**
7+
** Abstract : Linker script for STM32F070RB Device with
8+
** 128KByte FLASH, 16KByte RAM
9+
**
10+
** Set heap size, stack size and stack location according
11+
** to application requirements.
12+
**
13+
** Set memory bank area and size if external memory is used.
14+
**
15+
** Used the linker script for STM32F072RB as inspiration (very little
16+
** changes needed).
17+
**
18+
** Target : STMicroelectronics STM32
19+
**
20+
**
21+
** Distribution: The file is distributed as is, without any warranty
22+
** of any kind.
23+
**
24+
*****************************************************************************
25+
** @attention
26+
**
27+
** <h2><center>&copy; COPYRIGHT(c) 2014 Ac6</center></h2>
28+
**
29+
** Redistribution and use in source and binary forms, with or without modification,
30+
** are permitted provided that the following conditions are met:
31+
** 1. Redistributions of source code must retain the above copyright notice,
32+
** this list of conditions and the following disclaimer.
33+
** 2. Redistributions in binary form must reproduce the above copyright notice,
34+
** this list of conditions and the following disclaimer in the documentation
35+
** and/or other materials provided with the distribution.
36+
** 3. Neither the name of Ac6 nor the names of its contributors
37+
** may be used to endorse or promote products derived from this software
38+
** without specific prior written permission.
39+
**
40+
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
41+
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
42+
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43+
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
44+
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
45+
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
46+
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
47+
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
48+
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
49+
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
50+
**
51+
*****************************************************************************
52+
*/
53+
54+
/* Entry Point */
55+
ENTRY(Reset_Handler)
56+
57+
/* Highest address of the user mode stack */
58+
_estack = 0x20004000; /* end of RAM */
59+
/* Generate a link error if heap and stack don't fit into RAM */
60+
_Min_Heap_Size = 0x200; /* required amount of heap */
61+
_Min_Stack_Size = 0x400; /* required amount of stack */
62+
63+
/* Specify the memory areas */
64+
MEMORY
65+
{
66+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 16K
67+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 128K
68+
}
69+
70+
/* Define output sections */
71+
SECTIONS
72+
{
73+
/* The startup code goes first into FLASH */
74+
.isr_vector :
75+
{
76+
. = ALIGN(4);
77+
KEEP(*(.isr_vector)) /* Startup code */
78+
. = ALIGN(4);
79+
} >FLASH
80+
81+
/* The program code and other data goes into FLASH */
82+
.text :
83+
{
84+
. = ALIGN(4);
85+
*(.text) /* .text sections (code) */
86+
*(.text*) /* .text* sections (code) */
87+
*(.glue_7) /* glue arm to thumb code */
88+
*(.glue_7t) /* glue thumb to arm code */
89+
*(.eh_frame)
90+
91+
KEEP (*(.init))
92+
KEEP (*(.fini))
93+
94+
. = ALIGN(4);
95+
_etext = .; /* define a global symbols at end of code */
96+
} >FLASH
97+
98+
/* Constant data goes into FLASH */
99+
.rodata :
100+
{
101+
. = ALIGN(4);
102+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
103+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
104+
. = ALIGN(4);
105+
} >FLASH
106+
107+
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
108+
.ARM : {
109+
__exidx_start = .;
110+
*(.ARM.exidx*)
111+
__exidx_end = .;
112+
} >FLASH
113+
114+
.preinit_array :
115+
{
116+
PROVIDE_HIDDEN (__preinit_array_start = .);
117+
KEEP (*(.preinit_array*))
118+
PROVIDE_HIDDEN (__preinit_array_end = .);
119+
} >FLASH
120+
.init_array :
121+
{
122+
PROVIDE_HIDDEN (__init_array_start = .);
123+
KEEP (*(SORT(.init_array.*)))
124+
KEEP (*(.init_array*))
125+
PROVIDE_HIDDEN (__init_array_end = .);
126+
} >FLASH
127+
.fini_array :
128+
{
129+
PROVIDE_HIDDEN (__fini_array_start = .);
130+
KEEP (*(SORT(.fini_array.*)))
131+
KEEP (*(.fini_array*))
132+
PROVIDE_HIDDEN (__fini_array_end = .);
133+
} >FLASH
134+
135+
/* used by the startup to initialize data */
136+
_sidata = LOADADDR(.data);
137+
138+
/* Initialized data sections goes into RAM, load LMA copy after code */
139+
.data :
140+
{
141+
. = ALIGN(4);
142+
_sdata = .; /* create a global symbol at data start */
143+
*(.data) /* .data sections */
144+
*(.data*) /* .data* sections */
145+
146+
. = ALIGN(4);
147+
_edata = .; /* define a global symbol at data end */
148+
} >RAM AT> FLASH
149+
150+
151+
/* Uninitialized data section */
152+
. = ALIGN(4);
153+
.bss :
154+
{
155+
/* This is used by the startup in order to initialize the .bss secion */
156+
_sbss = .; /* define a global symbol at bss start */
157+
__bss_start__ = _sbss;
158+
*(.bss)
159+
*(.bss*)
160+
*(COMMON)
161+
162+
. = ALIGN(4);
163+
_ebss = .; /* define a global symbol at bss end */
164+
__bss_end__ = _ebss;
165+
} >RAM
166+
167+
/* User_heap_stack section, used to check that there is enough RAM left */
168+
._user_heap_stack :
169+
{
170+
. = ALIGN(4);
171+
PROVIDE ( end = . );
172+
PROVIDE ( _end = . );
173+
. = . + _Min_Heap_Size;
174+
. = . + _Min_Stack_Size;
175+
. = ALIGN(4);
176+
} >RAM
177+
178+
179+
180+
/* Remove information from the standard libraries */
181+
/DISCARD/ :
182+
{
183+
libc.a ( * )
184+
libm.a ( * )
185+
libgcc.a ( * )
186+
}
187+
188+
.ARM.attributes 0 : { *(.ARM.attributes) }
189+
}
190+
191+

‎variants/NUCLEO_F070RB/variant.cpp

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
/*
2+
Copyright (c) 2011 Arduino. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#include "pins_arduino.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
// Pin number
26+
const PinName digitalPin[] = {
27+
PA_3, //D0
28+
PA_2, //D1
29+
PA_10, //D2
30+
PB_3, //D3
31+
PB_5, //D4
32+
PB_4, //D5
33+
PB_10, //D6
34+
PA_8, //D7
35+
PA_9, //D8
36+
PC_7, //D9
37+
PB_6, //D10
38+
PA_7, //D11
39+
PA_6, //D12
40+
PA_5, //D13
41+
PB_9, //D14
42+
PB_8, //D15
43+
// ST Morpho
44+
// CN7 Left Side
45+
PC_10, //D16
46+
PC_12, //D17
47+
PF_11, //D18 - BOOT0
48+
PA_13, //D19 - SWD
49+
PA_14, //D20 - SWD
50+
PA_15, //D21
51+
PB_7, //D22
52+
PC_13, //D23
53+
PC_14, //D24
54+
PC_15, //D25
55+
PF_0, //D26
56+
PF_1, //D27
57+
PC_2, //D28
58+
PC_3, //D29
59+
// CN7 Right Side
60+
PC_11, //D30
61+
PD_2, //D31
62+
// CN10 Left Side
63+
PC_9, //D32
64+
// CN10 Right side
65+
PC_8, //D33
66+
PC_6, //D34
67+
PC_5, //D35
68+
PA_12, //D36
69+
PA_11, //D37
70+
PB_12, //D38
71+
PB_11, //D39
72+
PB_2, //D40
73+
PB_1, //D41
74+
PB_15, //D42
75+
PB_14, //D43
76+
PB_13, //D44
77+
PC_4, //D45
78+
PA_0, //D46/A0
79+
PA_1, //D47/A1
80+
PA_4, //D48/A2
81+
PB_0, //D49/A3
82+
PC_1, //D50/A4
83+
PC_0 //D51/A5
84+
};
85+
86+
// Analog (Ax) pin number array
87+
const uint32_t analogInputPin[] = {
88+
46, //A0
89+
47, //A1
90+
48, //A2
91+
49, //A3
92+
50, //A4
93+
51, //A5
94+
11, //A6
95+
12, //A7
96+
28, //A8
97+
29, //A9
98+
35, //A10
99+
45 //A11
100+
};
101+
102+
#ifdef __cplusplus
103+
}
104+
#endif
105+
106+
// ----------------------------------------------------------------------------
107+
108+
#ifdef __cplusplus
109+
extern "C" {
110+
#endif
111+
112+
/**
113+
* @brief System Clock Configuration
114+
* @param None
115+
* @retval None
116+
*/
117+
WEAK void SystemClock_Config(void)
118+
{
119+
RCC_OscInitTypeDef RCC_OscInitStruct;
120+
RCC_ClkInitTypeDef RCC_ClkInitStruct;
121+
122+
// Select PLLCLK = 48 MHz ((HSI 8 MHz / 2) * 12)
123+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
124+
RCC_OscInitStruct.HSEState = RCC_HSE_OFF;
125+
RCC_OscInitStruct.LSEState = RCC_LSE_OFF;
126+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
127+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
128+
RCC_OscInitStruct.HSI14State = RCC_HSI_OFF;
129+
RCC_OscInitStruct.HSI14CalibrationValue = RCC_HSI14CALIBRATION_DEFAULT;
130+
RCC_OscInitStruct.LSIState = RCC_LSI_OFF;
131+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
132+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
133+
RCC_OscInitStruct.PLL.PREDIV = RCC_PREDIV_DIV2; // HSI div 2
134+
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12;
135+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
136+
while (1); // FAIL
137+
}
138+
139+
// Select PLL as system clock source and configure the HCLK and PCLK1 clocks dividers
140+
RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_PCLK1);
141+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; // 48 MHz
142+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; // 48 MHz
143+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; // 48 MHz
144+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
145+
while (1); // FAIL
146+
}
147+
}
148+
149+
#ifdef __cplusplus
150+
}
151+
#endif

‎variants/NUCLEO_F070RB/variant.h

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
2+
Copyright (c) 2011 Arduino. All right reserved.
3+
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
9+
This library is distributed in the hope that it will be useful,
10+
but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12+
See the GNU Lesser General Public License for more details.
13+
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef _VARIANT_ARDUINO_STM32_
20+
#define _VARIANT_ARDUINO_STM32_
21+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif // __cplusplus
25+
26+
/*----------------------------------------------------------------------------
27+
* Pins
28+
*----------------------------------------------------------------------------*/
29+
30+
#define PA3 0
31+
#define PA2 1
32+
#define PA10 2
33+
#define PB3 3
34+
#define PB5 4
35+
#define PB4 5
36+
#define PB10 6
37+
#define PA8 7
38+
#define PA9 8
39+
#define PC7 9
40+
#define PB6 10
41+
#define PA7 A6
42+
#define PA6 A7
43+
#define PA5 13
44+
#define PB9 14
45+
#define PB8 15
46+
// ST Morpho
47+
// CN7 Left Side
48+
#define PC10 16
49+
#define PC12 17
50+
#define PF11 18 // BOOT0
51+
#define PA13 19 // SWD
52+
#define PA14 20 // SWD
53+
#define PA15 21
54+
#define PB7 22
55+
#define PC13 23
56+
#define PC14 24
57+
#define PC15 25
58+
#define PF0 26
59+
#define PF1 27
60+
#define PC2 A8
61+
#define PC3 A9
62+
// CN7 Right Side
63+
#define PC11 30
64+
#define PD2 31
65+
// CN10 Left Side
66+
#define PC9 32
67+
// CN10 Right side
68+
#define PC8 33
69+
#define PC6 34
70+
#define PC5 A10
71+
#define PA12 36
72+
#define PA11 37
73+
#define PB12 38
74+
#define PB11 39
75+
#define PB2 40
76+
#define PB1 41
77+
#define PB15 42
78+
#define PB14 43
79+
#define PB13 44
80+
#define PC4 A11
81+
#define PA0 A0
82+
#define PA1 A1
83+
#define PA4 A2
84+
#define PB0 A3
85+
#define PC1 A4
86+
#define PC0 A5
87+
88+
// This must be a literal
89+
#define NUM_DIGITAL_PINS 52
90+
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
91+
#define NUM_ANALOG_INPUTS 12
92+
93+
// On-board LED pin number
94+
#define LED_BUILTIN PA5
95+
96+
#define LED_GREEN LED_BUILTIN
97+
98+
// On-board user button
99+
#define USER_BTN PC13
100+
101+
// Timer Definitions
102+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
103+
#define TIMER_TONE TIM6
104+
#define TIMER_SERVO TIM7
105+
106+
// UART Definitions
107+
#define SERIAL_UART_INSTANCE 2 //Connected to ST-Link
108+
109+
// Default pin used for 'Serial' instance (ex: ST-Link)
110+
// Mandatory for Firmata
111+
#define PIN_SERIAL_RX 0
112+
#define PIN_SERIAL_TX 1
113+
114+
#ifdef __cplusplus
115+
} // extern "C"
116+
#endif
117+
/*----------------------------------------------------------------------------
118+
* Arduino objects - C++ only
119+
*----------------------------------------------------------------------------*/
120+
121+
#ifdef __cplusplus
122+
// These serial port names are intended to allow libraries and architecture-neutral
123+
// sketches to automatically default to the correct port name for a particular type
124+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
125+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
126+
//
127+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
128+
//
129+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
130+
//
131+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
132+
//
133+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
134+
//
135+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
136+
// pins are NOT connected to anything by default.
137+
#define SERIAL_PORT_MONITOR Serial
138+
#define SERIAL_PORT_HARDWARE Serial
139+
#endif
140+
141+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)
Please sign in to comment.