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 4a22c5a

Browse files
committedMay 17, 2019
Add ST3DP0001 EVAL support
Original version from @ffnull (See #347). Signed-off-by: Frederic.Pillon <[email protected]>
1 parent 9f757b4 commit 4a22c5a

File tree

6 files changed

+922
-0
lines changed

6 files changed

+922
-0
lines changed
 

‎boards.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,17 @@ RAK.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
884884
3dprinter.menu.pnum.RUMBA32.build.variant=RUMBA32_F446VE
885885
3dprinter.menu.pnum.RUMBA32.build.cmsis_lib_gcc=arm_cortexM4l_math
886886

887+
# STEVAL-3DP001V1 board
888+
3dprinter.menu.pnum.ST3DP001_EVAL=STEVAL-3DP001V1
889+
3dprinter.menu.pnum.ST3DP001_EVAL.upload.maximum_size=524288
890+
3dprinter.menu.pnum.ST3DP001_EVAL.upload.maximum_data_size=98304
891+
3dprinter.menu.pnum.ST3DP001_EVAL.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
892+
3dprinter.menu.pnum.ST3DP001_EVAL.build.board=ST3DP001_EVAL
893+
3dprinter.menu.pnum.ST3DP001_EVAL.build.series=STM32F4xx
894+
3dprinter.menu.pnum.ST3DP001_EVAL.build.product_line=STM32F401xE
895+
3dprinter.menu.pnum.ST3DP001_EVAL.build.variant=ST3DP001_EVAL
896+
3dprinter.menu.pnum.ST3DP001_EVAL.build.cmsis_lib_gcc=arm_cortexM4l_math
897+
887898
# PRNTR_F407_V1 board
888899
3dprinter.menu.pnum.PRNTR_F407_V1=PRNTR F407 v1
889900
3dprinter.menu.pnum.PRNTR_F407_V1.upload.maximum_size=524288
Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
2+
/*
3+
*******************************************************************************
4+
* Copyright (c) 2019, STMicroelectronics
5+
* All rights reserved.
6+
*
7+
* This software component is licensed by ST under BSD 3-Clause license,
8+
* the "License"; You may not use this file except in compliance with the
9+
* License. You may obtain a copy of the License at:
10+
* opensource.org/licenses/BSD-3-Clause
11+
*
12+
*******************************************************************************
13+
* Automatically generated from STM32F401V(D-E)Tx.xml
14+
*/
15+
#include "Arduino.h"
16+
#include "PeripheralPins.h"
17+
18+
/* =====
19+
* Note: Commented lines are alternative possibilities which are not used per default.
20+
* If you change them, you will have to know what you do
21+
* =====
22+
*/
23+
24+
//*** ADC ***
25+
26+
#ifdef HAL_ADC_MODULE_ENABLED
27+
const PinMap PinMap_ADC[] = {
28+
{PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC1_IN0
29+
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1
30+
{PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
31+
{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
32+
// {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
33+
// {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
34+
// {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
35+
// {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
36+
// {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
37+
// {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
38+
// {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC1_IN10
39+
// {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC1_IN11
40+
{PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC1_IN12
41+
{PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC1_IN13
42+
// {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC1_IN14
43+
// {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC1_IN15
44+
{NC, NP, 0}
45+
};
46+
#endif
47+
48+
//*** No DAC ***
49+
50+
//*** I2C ***
51+
52+
#ifdef HAL_I2C_MODULE_ENABLED
53+
const PinMap PinMap_I2C_SDA[] = {
54+
// {PB_3, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C2)},
55+
// {PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C3)},
56+
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
57+
// {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
58+
// {PC_9, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
59+
{NC, NP, 0}
60+
};
61+
#endif
62+
63+
#ifdef HAL_I2C_MODULE_ENABLED
64+
const PinMap PinMap_I2C_SCL[] = {
65+
// {PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
66+
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
67+
// {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
68+
// {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
69+
{NC, NP, 0}
70+
};
71+
#endif
72+
73+
//*** PWM ***
74+
75+
#ifdef HAL_TIM_MODULE_ENABLED
76+
const PinMap PinMap_PWM[] = {
77+
// {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
78+
// {PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1
79+
// {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
80+
// {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2
81+
// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
82+
// {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3
83+
// {PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
84+
// {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
85+
// {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4
86+
// {PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
87+
// {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
88+
// {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
89+
// {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
90+
// {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
91+
// {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
92+
// {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
93+
// {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
94+
// {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
95+
// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
96+
// {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
97+
{PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
98+
// {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
99+
{PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
100+
// {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
101+
// {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
102+
// {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
103+
// {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
104+
// {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
105+
// {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
106+
// {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1
107+
// {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
108+
// {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1
109+
{PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
110+
// {PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
111+
// {PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
112+
// {PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
113+
{PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1
114+
{PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
115+
// {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3
116+
// {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4
117+
{PD_12, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1
118+
{PD_13, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2
119+
{PD_14, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3
120+
{PD_15, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4
121+
{PE_5, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1
122+
// {PE_6, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2
123+
// {PE_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
124+
// {PE_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 0)}, // TIM1_CH1
125+
// {PE_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
126+
// {PE_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 0)}, // TIM1_CH2
127+
// {PE_12, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 1)}, // TIM1_CH3N
128+
// {PE_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 3, 0)}, // TIM1_CH3
129+
{PE_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
130+
{NC, NP, 0}
131+
};
132+
#endif
133+
134+
//*** SERIAL ***
135+
136+
#ifdef HAL_UART_MODULE_ENABLED
137+
const PinMap PinMap_UART_TX[] = {
138+
// {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
139+
{PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
140+
// {PA_11, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
141+
// {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
142+
// {PC_6, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
143+
{PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
144+
{NC, NP, 0}
145+
};
146+
#endif
147+
148+
#ifdef HAL_UART_MODULE_ENABLED
149+
const PinMap PinMap_UART_RX[] = {
150+
// {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
151+
{PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
152+
// {PA_12, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
153+
// {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
154+
// {PC_7, USART6, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_USART6)},
155+
{PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
156+
{NC, NP, 0}
157+
};
158+
#endif
159+
160+
#ifdef HAL_UART_MODULE_ENABLED
161+
const PinMap PinMap_UART_RTS[] = {
162+
// {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
163+
// {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
164+
{PD_4, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
165+
{NC, NP, 0}
166+
};
167+
#endif
168+
169+
#ifdef HAL_UART_MODULE_ENABLED
170+
const PinMap PinMap_UART_CTS[] = {
171+
// {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
172+
// {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
173+
{PD_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
174+
{NC, NP, 0}
175+
};
176+
#endif
177+
178+
//*** SPI ***
179+
180+
#ifdef HAL_SPI_MODULE_ENABLED
181+
const PinMap PinMap_SPI_MOSI[] = {
182+
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
183+
// {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
184+
// {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
185+
{PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
186+
// {PC_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
187+
// {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
188+
// {PD_6, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
189+
// {PE_6, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
190+
// {PE_14, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
191+
{NC, NP, 0}
192+
};
193+
#endif
194+
195+
#ifdef HAL_SPI_MODULE_ENABLED
196+
const PinMap PinMap_SPI_MISO[] = {
197+
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
198+
// {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
199+
// {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
200+
{PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
201+
// {PC_2, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
202+
// {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
203+
// {PE_5, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
204+
// {PE_13, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
205+
{NC, NP, 0}
206+
};
207+
#endif
208+
209+
#ifdef HAL_SPI_MODULE_ENABLED
210+
const PinMap PinMap_SPI_SCLK[] = {
211+
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
212+
// {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
213+
// {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
214+
// {PB_10, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
215+
{PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
216+
// {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
217+
// {PD_3, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
218+
// {PE_2, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
219+
// {PE_12, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
220+
{NC, NP, 0}
221+
};
222+
#endif
223+
224+
#ifdef HAL_SPI_MODULE_ENABLED
225+
const PinMap PinMap_SPI_SSEL[] = {
226+
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
227+
// {PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
228+
// {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
229+
// {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)},
230+
// {PB_9, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
231+
{PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)},
232+
// {PE_4, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
233+
// {PE_11, SPI4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI4)},
234+
{NC, NP, 0}
235+
};
236+
#endif
237+
238+
//*** No CAN ***
239+
240+
//*** No ETHERNET ***
241+
242+
//*** No QUADSPI ***
243+
244+
//*** USB ***
245+
246+
#ifdef HAL_PCD_MODULE_ENABLED
247+
const PinMap PinMap_USB_OTG_FS[] = {
248+
// {PA_8, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_SOF
249+
// {PA_9, USB_OTG_FS, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_OTG_FS_VBUS
250+
// {PA_10, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_ID
251+
{PA_11, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DM
252+
{PA_12, USB_OTG_FS, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF10_OTG_FS)}, // USB_OTG_FS_DP
253+
{NC, NP, 0}
254+
};
255+
#endif
256+
257+
//*** No USB_OTG_HS ***

‎variants/ST3DP001_EVAL/PinNamesVar.h

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = PA_0,
4+
#endif
5+
#ifdef PWR_WAKEUP_PIN2
6+
SYS_WKUP2 = NC,
7+
#endif
8+
#ifdef PWR_WAKEUP_PIN3
9+
SYS_WKUP3 = NC,
10+
#endif
11+
#ifdef PWR_WAKEUP_PIN4
12+
SYS_WKUP4 = NC,
13+
#endif
14+
#ifdef PWR_WAKEUP_PIN5
15+
SYS_WKUP5 = NC,
16+
#endif
17+
#ifdef PWR_WAKEUP_PIN6
18+
SYS_WKUP6 = NC,
19+
#endif
20+
#ifdef PWR_WAKEUP_PIN7
21+
SYS_WKUP7 = NC,
22+
#endif
23+
#ifdef PWR_WAKEUP_PIN8
24+
SYS_WKUP8 = NC,
25+
#endif
26+
/* USB */
27+
#ifdef USBCON
28+
USB_OTG_FS_SOF = PA_8,
29+
USB_OTG_FS_VBUS = PA_9,
30+
USB_OTG_FS_ID = PA_10,
31+
USB_OTG_FS_DM = PA_11,
32+
USB_OTG_FS_DP = PA_12,
33+
#endif

‎variants/ST3DP001_EVAL/ldscript.ld

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

‎variants/ST3DP001_EVAL/variant.cpp

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
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 "variant.h"
20+
21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif
24+
25+
const PinName digitalPin[] = {
26+
PA_9, // TX
27+
PA_10, // RX
28+
29+
// WIFI
30+
PD_3, // CTS
31+
PD_4, // RTS
32+
PD_5, // TX
33+
PD_6, // RX
34+
PB_5, // WIFI_WAKEUP
35+
PE_11, // WIFI_RESET
36+
PE_12, // WIFI_BOOT
37+
38+
// STATUS_LED
39+
PE_1, //STATUS_LED
40+
41+
// SPI USER
42+
PB_12, // SPI_CS
43+
PB_15, // SPI_MOSI
44+
PB_14, // SPI_MISO
45+
PB_13, // SPI_SCK
46+
47+
// I2C USER
48+
PB_7, // SDA
49+
PB_6, // SCL
50+
51+
// SPI
52+
PA_4, // SPI_CS
53+
PA_5, // SPI_SCK
54+
PA_6, // SPI_MISO
55+
PA_7, // SPI_MOSI
56+
57+
// JTAG
58+
PA_13, // JTAG_TMS/SWDIO
59+
PA_14, // JTAG_TCK/SWCLK
60+
PB_3, // JTAG_TDO/SWO
61+
62+
// SDCARD
63+
PC_8, // SDIO_D0
64+
PC_9, // SDIO_D1
65+
PA_15, // SD_CARD_DETECT
66+
PC_10, // SDIO_D2
67+
PC_11, // SDIO_D3
68+
PC_12, // SDIO_CK
69+
PD_2, // SDIO_CMD
70+
71+
// OTG
72+
PA_11, // OTG_DM
73+
PA_12, // OTG_DP
74+
75+
// IR/PROBE
76+
PD_1, // IR_OUT
77+
PC_1, // IR_ON
78+
79+
// USER_PINS
80+
PD_7, // USER3
81+
PB_9, // USER1
82+
PE_0, // USER2
83+
PB_4, // USER4
84+
85+
// USERKET
86+
PE_7, // USER_BUTTON
87+
88+
// ENDSTOPS
89+
PD_8, // X_STOP
90+
PD_9, // Y_STOP
91+
PD_10, // Z_STOP
92+
PD_11, // U_STOP
93+
PA_8, // V_STOP
94+
PD_0, // W_STOP
95+
96+
// HEATERS
97+
PD_13, // BED_HEAT_2
98+
PD_14, // BED_HEAT_1
99+
PD_15, // BED_HEAT_3
100+
PC_7, // E1_HEAT_PWM
101+
PB_0, // E2_HEAT_PWM
102+
PB_1, // E3_HEAT_PWM
103+
104+
// THERMISTOR
105+
PC_2, // BED_THERMISTOR_1
106+
PC_3, // BED_THERMISTOR_2
107+
PA_3, // BED_THERMISTOR_3
108+
PA_0, // E1_THERMISTOR
109+
PA_1, // E2_THERMISTOR
110+
PA_2, // E3_THERMISTOR
111+
112+
// FANS
113+
PC_4, // E1_FAN
114+
PC_5, // E2_FAN
115+
PE_8, // E3_FAN
116+
117+
// X_MOTOR
118+
PE_13, // X_RESET
119+
PE_14, // X_PWM
120+
PE_15, // X_DIR
121+
122+
// Y_MOTOR
123+
PE_10, // Y_RESET
124+
PB_10, // Y_PWM
125+
PE_9, // Y_DIR
126+
127+
// Z_MOTOR
128+
PC_15, // Z_RESET
129+
PC_6, // Z_PWM
130+
PC_0, // Z_DIR
131+
132+
// E1_MOTOR
133+
PC_14, // E1_RESET
134+
PC_13, // E1_DIR
135+
PD_12, // E1_PWM
136+
137+
// E2_MOTOR
138+
PE_4, // E2_RESET
139+
PE_5, // E2_PWM
140+
PE_6, // E2_DIR
141+
142+
// E3_MOTOR
143+
PE_3, // E3_RESET
144+
PE_2, // E3_DIR
145+
PB_8 // E3_PWM
146+
};
147+
148+
#ifdef __cplusplus
149+
}
150+
#endif
151+
152+
// ----------------------------------------------------------------------------
153+
154+
#ifdef __cplusplus
155+
extern "C" {
156+
#endif
157+
/**
158+
* @brief System Clock Configuration
159+
* The system Clock is configured as follow :
160+
* System Clock source = PLL (HSI)
161+
* SYSCLK(Hz) = 84000000
162+
* HCLK(Hz) = 84000000
163+
* AHB Prescaler = 1
164+
* APB1 Prescaler = 2
165+
* APB2 Prescaler = 1
166+
* HSI Frequency(Hz) = 16000000
167+
* PLL_M = 16
168+
* PLL_N = 336
169+
* PLL_P = 4
170+
* PLL_Q = 7
171+
* VDD(V) = 3.3
172+
* Main regulator output voltage = Scale2 mode
173+
* Flash Latency(WS) = 2
174+
* @param None
175+
* @retval None
176+
*/
177+
WEAK void SystemClock_Config(void)
178+
{
179+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
180+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
181+
182+
/* Configure the main internal regulator output voltage */
183+
__HAL_RCC_PWR_CLK_ENABLE();
184+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
185+
186+
/* Initializes the CPU, AHB and APB busses clocks */
187+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
188+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
189+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
190+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
191+
RCC_OscInitStruct.PLL.PLLM = 15;
192+
RCC_OscInitStruct.PLL.PLLN = 144;
193+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV4;
194+
RCC_OscInitStruct.PLL.PLLQ = 5;
195+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
196+
Error_Handler();
197+
}
198+
/* Initializes the CPU, AHB and APB busses clocks */
199+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
200+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
201+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
202+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
203+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
204+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
205+
206+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) {
207+
Error_Handler();
208+
}
209+
}
210+
211+
#ifdef __cplusplus
212+
}
213+
#endif

‎variants/ST3DP001_EVAL/variant.h

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
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+
/*----------------------------------------------------------------------------
23+
* Headers
24+
*----------------------------------------------------------------------------*/
25+
#include "PeripheralPins.h"
26+
27+
#ifdef __cplusplus
28+
extern "C" {
29+
#endif // __cplusplus
30+
31+
/*----------------------------------------------------------------------------
32+
* Pins
33+
*----------------------------------------------------------------------------*/
34+
extern const PinName digitalPin[];
35+
// USART1_MAIN
36+
#define PA9 0 //TX
37+
#define PA10 1 //RX
38+
39+
// WIFI
40+
#define PD3 2 // CTS
41+
#define PD4 3 // RTS
42+
#define PD5 4 // TX
43+
#define PD6 5 // RX
44+
#define PB5 6 // WIFI_WAKEUP
45+
#define PE11 7 // WIFI_RESET
46+
#define PE12 8 // WIFI_BOOT
47+
48+
// STATUS_LED
49+
#define PE1 9 // STATUS_LED
50+
51+
// SPI USER
52+
#define PB12 10 // SPI_CS
53+
#define PB15 11 // SPI_MOSI
54+
#define PB14 12 // SPI_MISO
55+
#define PB13 13 // SPI_SCK
56+
57+
// I2C USER
58+
#define PB7 14 // SDA
59+
#define PB6 15 // SCL
60+
61+
// SPI
62+
#define PA4 16 // SPI_CS
63+
#define PA5 17 // SPI_SCK
64+
#define PA6 18 // SPI_MISO
65+
#define PA7 19 // SPI_MOSI
66+
67+
// JTAG
68+
#define PA13 20 // JTAG_TMS/SWDIO
69+
#define PA14 21 // JTAG_TCK/SWCLK
70+
#define PB3 22 // JTAG_TDO/SWO
71+
72+
// SDCARD
73+
#define PC8 23 // SDIO_D0
74+
#define PC9 24 // SDIO_D1
75+
#define PA15 25 // SD_CARD_DETECT
76+
#define PC10 26 // SDIO_D2
77+
#define PC11 27 // SDIO_D3
78+
#define PC12 28 // SDIO_CK
79+
#define PD2 29 // SDIO_CMD
80+
81+
// OTG
82+
#define PA11 30 //OTG_DM
83+
#define PA12 31 //OTG_DP
84+
85+
// IR/PROBE
86+
#define PD1 32 //IR_OUT
87+
#define PC1 33 //IR_ON
88+
89+
// USER_PINS
90+
#define PD7 34 // USER3
91+
#define PB9 35 // USER1
92+
#define PE0 36 // USER2
93+
#define PB4 37 // USER4
94+
95+
// USERKET
96+
#define PE7 38 // USER_BUTTON
97+
98+
// ENDSTOPS
99+
#define PD8 39 // X_STOP
100+
#define PD9 40 // Y_STOP
101+
#define PD10 41 // Z_STOP
102+
#define PD11 42 // U_STOP
103+
#define PA8 43 // V_STOP
104+
#define PD0 44 // W_STOP
105+
106+
// HEATERS
107+
#define PD13 45 // BED_HEAT_2
108+
#define PD14 46 // BED_HEAT_1
109+
#define PD15 47 // BED_HEAT_3
110+
#define PC7 48 // E1_HEAT_PWM
111+
#define PB0 49 // E2_HEAT_PWM
112+
#define PB1 50 // E3_HEAT_PWM
113+
114+
// THERMISTOR
115+
#define PC2 51 // BED_THERMISTOR_1
116+
#define PC3 52 // BED_THERMISTOR_2
117+
#define PA3 53 // BED_THERMISTOR_3
118+
#define PA0 54 // E1_THERMISTOR
119+
#define PA1 55 // E2_THERMISTOR
120+
#define PA2 56 // E3_THERMISTOR
121+
122+
// FANS
123+
#define PC4 57 // E1_FAN
124+
#define PC5 58 // E2_FAN
125+
#define PE8 59 // E3_FAN
126+
127+
// X_MOTOR
128+
#define PE13 60 // X_RESET
129+
#define PE14 61 // X_PWM
130+
#define PE15 62 // X_DIR
131+
132+
// Y_MOTOR
133+
#define PE10 63 // Y_RESET
134+
#define PB10 64 // Y_PWM
135+
#define PE9 65 // Y_DIR
136+
137+
// Z_MOTOR
138+
#define PC15 66 // Z_RESET
139+
#define PC6 67 // Z_PWM
140+
#define PC0 68 // Z_DIR
141+
142+
// E1_MOTOR
143+
#define PC14 69 // E1_RESET
144+
#define PC13 70 // E1_DIR
145+
#define PD12 71 // E1_PWM
146+
147+
// E2_MOTOR
148+
#define PE4 72 // E2_RESET
149+
#define PE5 73 // E2_PWM
150+
#define PE6 74 // E2_DIR
151+
152+
// E3_MOTOR
153+
#define PE3 75 // E3_RESET
154+
#define PE2 76 // E3_DIR
155+
#define PB8 77 // E3_PWM
156+
157+
// This must be a literal
158+
#define NUM_DIGITAL_PINS 78
159+
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
160+
#define NUM_ANALOG_INPUTS 6
161+
#define NUM_ANALOG_FIRST 45
162+
163+
// On-board LED pin number
164+
#define LED_BUILTIN PE1
165+
#define LED_GREEN LED_BUILTIN
166+
167+
// On-board user button
168+
#define USER_BTN PE7
169+
170+
// Timer Definitions
171+
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
172+
#define TIMER_TONE TIM4
173+
174+
// Do not use basic timer: OC is required
175+
#define TIMER_SERVO TIM3 //TODO: advanced-control timers don't work
176+
177+
// UART Definitions
178+
#define SERIAL_UART_INSTANCE 1 //Connected to ST-Link
179+
180+
// Default pin used for 'Serial' instance (ex: ST-Link)
181+
// Mandatory for Firmata
182+
#define PIN_SERIAL_RX PA10
183+
#define PIN_SERIAL_TX PA9
184+
185+
/* SD detect signal */
186+
#define SD_DETECT_PIN PA15
187+
188+
/* HAL configuration */
189+
#define HSE_VALUE 25000000U
190+
191+
/* Extra HAL modules */
192+
#define HAL_SD_MODULE_ENABLED
193+
194+
#ifdef __cplusplus
195+
} // extern "C"
196+
#endif
197+
/*----------------------------------------------------------------------------
198+
* Arduino objects - C++ only
199+
*----------------------------------------------------------------------------*/
200+
201+
#ifdef __cplusplus
202+
// These serial port names are intended to allow libraries and architecture-neutral
203+
// sketches to automatically default to the correct port name for a particular type
204+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
205+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
206+
//
207+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
208+
//
209+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
210+
//
211+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
212+
//
213+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
214+
//
215+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
216+
// pins are NOT connected to anything by default.
217+
#define SERIAL_PORT_MONITOR Serial
218+
#define SERIAL_PORT_HARDWARE Serial1
219+
#endif
220+
221+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)
Please sign in to comment.