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 ab99a7b

Browse files
MCUdudefpistm
authored andcommittedApr 21, 2020
Add generic F103Cx targets
1 parent 6eaa8d2 commit ab99a7b

File tree

7 files changed

+811
-0
lines changed

7 files changed

+811
-0
lines changed
 

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
117117
| :---: | --- | :---: | :--- |
118118
| :green_heart: | [BluePill F103C(6-8-B)](https://stm32-base.org/boards/STM32F103C8T6-Blue-Pill) | *1.2.0* | USB CDC support since *1.5.0*, Maple bootloaders support since *1.6.0* |
119119
| :green_heart: | [BlackPill F103C(8-B)](https://stm32-base.org/boards/STM32F103C8T6-Black-Pill) | *1.5.0* | |
120+
| :yellow_heart: | Generic F103C(4-6-8-B) | **1.9.0** | |
120121
| :yellow_heart: | [Generic F103R(6-8-B-C-D-E-F-G)](https://stm32-base.org/boards/STM32F103RET6-Generic-Board) | **1.9.0** | |
121122
| :yellow_heart: | Generic F103Z(C-D-E-F-G) | **1.9.0** | |
122123
| :green_heart: | HY-TinySTM103T | *1.5.0* | |

‎boards.txt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,35 @@ GenF1.menu.pnum.BLACKPILL_F103CB.build.board=BLACKPILL_F103CB
873873
GenF1.menu.pnum.BLACKPILL_F103CB.build.product_line=STM32F103xB
874874
GenF1.menu.pnum.BLACKPILL_F103CB.build.variant=PILL_F103XX
875875

876+
# Generic STM32F103Cx boards
877+
GenF1.menu.pnum.Generic_F103C4=Generic F103C4
878+
GenF1.menu.pnum.Generic_F103C4.upload.maximum_size=16384
879+
GenF1.menu.pnum.Generic_F103C4.upload.maximum_data_size=6144
880+
GenF1.menu.pnum.Generic_F103C4.build.board=GENERIC_F103C4
881+
GenF1.menu.pnum.Generic_F103C4.build.product_line=STM32F103x6
882+
GenF1.menu.pnum.Generic_F103C4.build.variant=Generic_F103Cx
883+
884+
GenF1.menu.pnum.Generic_F103C6=Generic F103C6
885+
GenF1.menu.pnum.Generic_F103C6.upload.maximum_size=32768
886+
GenF1.menu.pnum.Generic_F103C6.upload.maximum_data_size=10240
887+
GenF1.menu.pnum.Generic_F103C6.build.board=GENERIC_F103C6
888+
GenF1.menu.pnum.Generic_F103C6.build.product_line=STM32F103x6
889+
GenF1.menu.pnum.Generic_F103C6.build.variant=Generic_F103Cx
890+
891+
GenF1.menu.pnum.Generic_F103C8=Generic F103C8
892+
GenF1.menu.pnum.Generic_F103C8.upload.maximum_size=65536
893+
GenF1.menu.pnum.Generic_F103C8.upload.maximum_data_size=20480
894+
GenF1.menu.pnum.Generic_F103C8.build.board=GENERIC_F103C8
895+
GenF1.menu.pnum.Generic_F103C8.build.product_line=STM32F103xB
896+
GenF1.menu.pnum.Generic_F103C8.build.variant=Generic_F103Cx
897+
898+
GenF1.menu.pnum.Generic_F103CB=Generic F103CB
899+
GenF1.menu.pnum.Generic_F103CB.upload.maximum_size=131072
900+
GenF1.menu.pnum.Generic_F103CB.upload.maximum_data_size=20480
901+
GenF1.menu.pnum.Generic_F103CB.build.board=GENERIC_F103CB
902+
GenF1.menu.pnum.Generic_F103CB.build.product_line=STM32F103xB
903+
GenF1.menu.pnum.Generic_F103CB.build.variant=Generic_F103Cx
904+
876905
# Generic STM32F103Rx boards
877906
GenF1.menu.pnum.Generic_F103R4=Generic F103R4
878907
GenF1.menu.pnum.Generic_F103R4.upload.maximum_size=16384
Lines changed: 261 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,261 @@
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 STM32F103C(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)}, // ADC1_IN0
28+
// {PA_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC2_IN0
29+
{PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC1_IN1
30+
// {PA_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC2_IN1
31+
{PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC1_IN2
32+
// {PA_2, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC2_IN2
33+
{PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC1_IN3
34+
// {PA_3, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC2_IN3
35+
{PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC1_IN4
36+
// {PA_4, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC2_IN4
37+
{PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC1_IN5
38+
// {PA_5, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC2_IN5
39+
{PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC1_IN6
40+
// {PA_6, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC2_IN6
41+
{PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC1_IN7
42+
// {PA_7, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC2_IN7
43+
{PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC1_IN8
44+
// {PB_0, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC2_IN8
45+
{PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC1_IN9
46+
// {PB_1, ADC2, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC2_IN9
47+
{NC, NP, 0}
48+
};
49+
#endif
50+
51+
//*** No DAC ***
52+
53+
//*** I2C ***
54+
55+
#ifdef HAL_I2C_MODULE_ENABLED
56+
WEAK const PinMap PinMap_I2C_SDA[] = {
57+
{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_NONE)},
58+
{PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_I2C1_ENABLE)},
59+
#ifdef STM32F103xB
60+
{PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_NONE)},
61+
#endif
62+
{NC, NP, 0}
63+
};
64+
#endif
65+
66+
#ifdef HAL_I2C_MODULE_ENABLED
67+
WEAK const PinMap PinMap_I2C_SCL[] = {
68+
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_NONE)},
69+
{PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_I2C1_ENABLE)},
70+
#ifdef STM32F103xB
71+
{PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, AFIO_NONE)},
72+
#endif
73+
{NC, NP, 0}
74+
};
75+
#endif
76+
77+
//*** PWM ***
78+
79+
#ifdef HAL_TIM_MODULE_ENABLED
80+
WEAK const PinMap PinMap_PWM[] = {
81+
{PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM2_CH1
82+
// {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 1, 0)}, // TIM2_CH1
83+
{PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM2_CH2
84+
// {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 2, 0)}, // TIM2_CH2
85+
{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM2_CH3
86+
// {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 3, 0)}, // TIM2_CH3
87+
{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM2_CH4
88+
// {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 4, 0)}, // TIM2_CH4
89+
{PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM3_CH1
90+
// {PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 1, 1)}, // TIM1_CH1N
91+
{PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM3_CH2
92+
{PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM1_CH1
93+
// {PA_8, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 1, 0)}, // TIM1_CH1
94+
{PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM1_CH2
95+
// {PA_9, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 2, 0)}, // TIM1_CH2
96+
{PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM1_CH3
97+
// {PA_10, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 3, 0)}, // TIM1_CH3
98+
{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM1_CH4
99+
// {PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 4, 0)}, // TIM1_CH4
100+
// {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 1, 0)}, // TIM2_CH1
101+
{PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 1, 0)}, // TIM2_CH1
102+
// {PB_0, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 2, 1)}, // TIM1_CH2N
103+
{PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM3_CH3
104+
// {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 3, 0)}, // TIM3_CH3
105+
// {PB_1, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM1_PARTIAL, 3, 1)}, // TIM1_CH3N
106+
{PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM3_CH4
107+
// {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 4, 0)}, // TIM3_CH4
108+
// {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_1, 2, 0)}, // TIM2_CH2
109+
{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 2, 0)}, // TIM2_CH2
110+
{PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 1, 0)}, // TIM3_CH1
111+
{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM3_PARTIAL, 2, 0)}, // TIM3_CH2
112+
#ifdef STM32F103xB
113+
{PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 0)}, // TIM4_CH1
114+
{PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 0)}, // TIM4_CH2
115+
{PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 0)}, // TIM4_CH3
116+
{PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 4, 0)}, // TIM4_CH4
117+
#endif
118+
// {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 3, 0)}, // TIM2_CH3
119+
{PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 3, 0)}, // TIM2_CH3
120+
// {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_PARTIAL_2, 4, 0)}, // TIM2_CH4
121+
{PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_TIM2_ENABLE, 4, 0)}, // TIM2_CH4
122+
{PB_13, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 1, 1)}, // TIM1_CH1N
123+
{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 2, 1)}, // TIM1_CH2N
124+
{PB_15, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE, 3, 1)}, // TIM1_CH3N
125+
{NC, NP, 0}
126+
};
127+
#endif
128+
129+
//*** SERIAL ***
130+
131+
#ifdef HAL_UART_MODULE_ENABLED
132+
WEAK const PinMap PinMap_UART_TX[] = {
133+
{PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
134+
{PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
135+
{PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_USART1_ENABLE)},
136+
#ifdef STM32F103xB
137+
{PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
138+
#endif
139+
{NC, NP, 0}
140+
};
141+
#endif
142+
143+
#ifdef HAL_UART_MODULE_ENABLED
144+
WEAK const PinMap PinMap_UART_RX[] = {
145+
{PA_3, USART2, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_NONE)},
146+
{PA_10, USART1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_NONE)},
147+
{PB_7, USART1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_USART1_ENABLE)},
148+
#ifdef STM32F103xB
149+
{PB_11, USART3, STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, AFIO_NONE)},
150+
#endif
151+
{NC, NP, 0}
152+
};
153+
#endif
154+
155+
#ifdef HAL_UART_MODULE_ENABLED
156+
WEAK const PinMap PinMap_UART_RTS[] = {
157+
{PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
158+
{PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
159+
#ifdef STM32F103xB
160+
{PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
161+
// {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_USART3_PARTIAL)},
162+
#endif
163+
{NC, NP, 0}
164+
};
165+
#endif
166+
167+
#ifdef HAL_UART_MODULE_ENABLED
168+
WEAK const PinMap PinMap_UART_CTS[] = {
169+
{PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
170+
{PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
171+
#ifdef STM32F103xB
172+
{PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
173+
// {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_USART3_PARTIAL)},
174+
#endif
175+
{NC, NP, 0}
176+
};
177+
#endif
178+
179+
//*** SPI ***
180+
181+
#ifdef HAL_SPI_MODULE_ENABLED
182+
WEAK const PinMap PinMap_SPI_MOSI[] = {
183+
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
184+
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_SPI1_ENABLE)},
185+
#ifdef STM32F103xB
186+
{PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
187+
#endif
188+
{NC, NP, 0}
189+
};
190+
#endif
191+
192+
#ifdef HAL_SPI_MODULE_ENABLED
193+
WEAK const PinMap PinMap_SPI_MISO[] = {
194+
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
195+
{PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_SPI1_ENABLE)},
196+
#ifdef STM32F103xB
197+
{PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
198+
#endif
199+
{NC, NP, 0}
200+
};
201+
#endif
202+
203+
#ifdef HAL_SPI_MODULE_ENABLED
204+
WEAK const PinMap PinMap_SPI_SCLK[] = {
205+
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
206+
{PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_SPI1_ENABLE)},
207+
#ifdef STM32F103xB
208+
{PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
209+
#endif
210+
{NC, NP, 0}
211+
};
212+
#endif
213+
214+
#ifdef HAL_SPI_MODULE_ENABLED
215+
WEAK const PinMap PinMap_SPI_SSEL[] = {
216+
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
217+
{PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_SPI1_ENABLE)},
218+
#ifdef STM32F103xB
219+
{PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, AFIO_NONE)},
220+
#endif
221+
{NC, NP, 0}
222+
};
223+
#endif
224+
225+
//*** CAN ***
226+
227+
#ifdef HAL_CAN_MODULE_ENABLED
228+
WEAK const PinMap PinMap_CAN_RD[] = {
229+
{PA_11, CAN1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, AFIO_NONE)},
230+
{PB_8, CAN1, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, AFIO_CAN1_2)},
231+
{NC, NP, 0}
232+
};
233+
#endif
234+
235+
#ifdef HAL_CAN_MODULE_ENABLED
236+
WEAK const PinMap PinMap_CAN_TD[] = {
237+
{PA_12, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_NONE)},
238+
{PB_9, CAN1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, AFIO_CAN1_2)},
239+
{NC, NP, 0}
240+
};
241+
#endif
242+
243+
//*** No ETHERNET ***
244+
245+
//*** No QUADSPI ***
246+
247+
//*** USB ***
248+
249+
#ifdef HAL_PCD_MODULE_ENABLED
250+
WEAK const PinMap PinMap_USB[] = {
251+
{PA_11, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, AFIO_NONE)}, // USB_DM
252+
{PA_12, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, AFIO_NONE)}, // USB_DP
253+
{NC, NP, 0}
254+
};
255+
#endif
256+
257+
//*** No USB_OTG_FS ***
258+
259+
//*** No USB_OTG_HS ***
260+
261+
//*** No SD ***

‎variants/Generic_F103Cx/PinNamesVar.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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_DM = PA_11,
29+
USB_DP = PA_12,
30+
#endif

‎variants/Generic_F103Cx/ldscript.ld

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

‎variants/Generic_F103Cx/variant.cpp

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
/*
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+
#include "pins_arduino.h"
31+
32+
#ifdef __cplusplus
33+
extern "C" {
34+
#endif
35+
36+
// Digital PinName array
37+
const PinName digitalPin[] = {
38+
PA_0, // Digital pin 0
39+
PA_1, // Digital pin 1
40+
PA_2, // Digital pin 2
41+
PA_3, // Digital pin 3
42+
PA_4, // Digital pin 4
43+
PA_5, // Digital pin 5
44+
PA_6, // Digital pin 6
45+
PA_7, // Digital pin 7
46+
PA_8, // Digital pin 8
47+
PA_9, // Digital pin 9
48+
PA_10, // Digital pin 10
49+
PA_11, // Digital pin 11
50+
PA_12, // Digital pin 12
51+
PA_13, // Digital pin 13
52+
PA_14, // Digital pin 14
53+
PA_15, // Digital pin 15
54+
55+
PB_0, // Digital pin 16
56+
PB_1, // Digital pin 17
57+
PB_2, // Digital pin 18
58+
PB_3, // Digital pin 19
59+
PB_4, // Digital pin 20
60+
PB_5, // Digital pin 21
61+
PB_6, // Digital pin 22
62+
PB_7, // Digital pin 23
63+
PB_8, // Digital pin 24
64+
PB_9, // Digital pin 25
65+
PB_10, // Digital pin 26
66+
PB_11, // Digital pin 27
67+
PB_12, // Digital pin 28
68+
PB_13, // Digital pin 29
69+
PB_14, // Digital pin 30
70+
PB_15, // Digital pin 31
71+
72+
PC_13, // Digital pin 32
73+
PC_14, // Digital pin 33
74+
PC_15, // Digital pin 34
75+
76+
PD_0, // Digital pin 35, used by the external oscillator
77+
PD_1 // Digital pin 36, used by the external oscillator
78+
};
79+
80+
// Analog (Ax) pin number array
81+
const uint32_t analogInputPin[] = {
82+
0, // A0, PA0
83+
1, // A1, PA1
84+
2, // A2, PA2
85+
3, // A3, PA3
86+
4, // A4, PA4
87+
5, // A5, PA5
88+
6, // A6, PA6
89+
7, // A7, PA7
90+
16, // A8, PB0
91+
17, // A9, PB1
92+
};
93+
94+
#ifdef __cplusplus
95+
}
96+
#endif
97+
98+
// ----------------------------------------------------------------------------
99+
100+
#ifdef __cplusplus
101+
extern "C" {
102+
#endif
103+
104+
/**
105+
* @brief System Clock Configuration
106+
* The system Clock is configured as follow :
107+
* System Clock source = PLL (HSE)
108+
* SYSCLK(Hz) = 72000000
109+
* HCLK(Hz) = 72000000
110+
* AHB Prescaler = 1
111+
* APB1 Prescaler = 2
112+
* APB2 Prescaler = 1
113+
* PLL_Source = HSE
114+
* PLL_Mul = 9
115+
* Flash Latency(WS) = 2
116+
* ADC Prescaler = 6
117+
* USB Prescaler = 1.5
118+
* @param None
119+
* @retval None
120+
*/
121+
WEAK void SystemClock_Config(void)
122+
{
123+
RCC_OscInitTypeDef RCC_OscInitStruct;
124+
RCC_ClkInitTypeDef RCC_ClkInitStruct;
125+
RCC_PeriphCLKInitTypeDef PeriphClkInit;
126+
127+
/* Initializes the CPU, AHB and APB busses clocks */
128+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
129+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
130+
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
131+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
132+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
133+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
134+
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
135+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
136+
while (1);
137+
}
138+
139+
/* Initializes the CPU, AHB and APB busses clocks */
140+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
141+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
142+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
143+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
144+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
145+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
146+
147+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
148+
while (1);
149+
}
150+
151+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC | RCC_PERIPHCLK_USB;
152+
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
153+
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL_DIV1_5;
154+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
155+
while (1);
156+
}
157+
}
158+
159+
#ifdef __cplusplus
160+
}
161+
#endif

‎variants/Generic_F103Cx/variant.h

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
/*
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+
#ifndef _VARIANT_ARDUINO_STM32_
31+
#define _VARIANT_ARDUINO_STM32_
32+
33+
#ifdef __cplusplus
34+
extern "C" {
35+
#endif // __cplusplus
36+
37+
// * = F103C8-CB | DIGITAL | ANALOG | USART | TWI | SPI | SPECIAL |
38+
// |---------|--------|------------|-----------|------------|-----------|
39+
#define PA0 A0 // | 0 | A0 | | | | |
40+
#define PA1 A1 // | 1 | A1 | | | | |
41+
#define PA2 A2 // | 2 | A2 | USART2_TX | | | |
42+
#define PA3 A3 // | 2 | A2 | USART2_RX | | | |
43+
#define PA4 A4 // | 4 | A4 | | | SPI1_SS | |
44+
#define PA5 A5 // | 5 | A5 | | | SPI1_SCK | |
45+
#define PA6 A6 // | 6 | A6 | | | SPI1_MISO | |
46+
#define PA7 A7 // | 7 | A7 | | | SPI1_MOSI | |
47+
#define PA8 8 // | 8 | | | | | |
48+
#define PA9 9 // | 9 | | USART1_TX | | | |
49+
#define PA10 10 // | 10 | | USART1_RX | | | |
50+
#define PA11 11 // | 11 | | | | | USB_DN |
51+
#define PA12 12 // | 12 | | | | | USB_DP |
52+
#define PA13 13 // | 13 | | | | | SWD_SWDIO |
53+
#define PA14 14 // | 14 | | | | | SWD_SWCLK |
54+
#define PA15 15 // | 15 | | | | SPI1_SS | |
55+
// |---------|--------|------------|-----------|------------|-----------|
56+
#define PB0 A8 // | 16 | A8 | | | | |
57+
#define PB1 A9 // | 17 | A9 | | | | |
58+
#define PB2 18 // | 18 | | | | | BOOT1 |
59+
#define PB3 19 // | 19 | | | | SPI1_SCK | |
60+
#define PB4 20 // | 20 | | | | SPI1_MISO | |
61+
#define PB5 21 // | 21 | | | | SPI1_MOSI | |
62+
#define PB6 22 // | 22 | | USART1_TX | TWI1_SCL | | |
63+
#define PB7 23 // | 23 | | USART1_RX | TWI1_SDA | | |
64+
#define PB8 24 // | 24 | | | TWI1_SCL | | |
65+
#define PB9 25 // | 25 | | | TWI1_SDA | | |
66+
#define PB10 26 // | 26 | | USART3_TX* | TWI2_SCL* | | |
67+
#define PB11 27 // | 27 | | USART3_RX* | TWI2_SDA* | | |
68+
#define PB12 28 // | 28 | | | | SPI2_SS* | |
69+
#define PB13 29 // | 29 | | | | SPI2_SCK* | |
70+
#define PB14 30 // | 30 | | | | SPI2_MISO* | |
71+
#define PB15 31 // | 31 | | | | SPI2_MOSI* | |
72+
// |---------|--------|------------|-----------|------------|-----------|
73+
#define PC13 32 // | 32 | | | | | |
74+
#define PC14 33 // | 33 | | | | | OSC32_IN |
75+
#define PC15 34 // | 34 | | | | | OSC32_OUT |
76+
// |---------|--------|------------|-----------|------------|-----------|
77+
#define PD0 35 // | 35 | | | | | OSC_IN |
78+
#define PD1 36 // | 36 | | | | | OSC_OUT |
79+
// |---------|--------|------------|-----------|------------|-----------|
80+
81+
82+
// This must be a literal
83+
#define NUM_DIGITAL_PINS 37
84+
#define NUM_ANALOG_INPUTS 10
85+
86+
// On-board LED pin number
87+
#ifndef LED_BUILTIN
88+
#define LED_BUILTIN PC13
89+
#endif
90+
#define LED_GREEN LED_BUILTIN
91+
92+
// SPI Definitions
93+
#define PIN_SPI_SS PA4
94+
#define PIN_SPI_MOSI PA7
95+
#define PIN_SPI_MISO PA6
96+
#define PIN_SPI_SCK PA5
97+
98+
// I2C Definitions
99+
#define PIN_WIRE_SDA PB7
100+
#define PIN_WIRE_SCL PB6
101+
102+
// Timer Definitions
103+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
104+
#define TIMER_TONE TIM3
105+
#define TIMER_SERVO TIM2
106+
107+
// UART Definitions
108+
#define SERIAL_UART_INSTANCE 1
109+
// Default pin used for 'Serial' instance
110+
// Mandatory for Firmata
111+
#define PIN_SERIAL_RX PA10
112+
#define PIN_SERIAL_TX PA9
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 Serial1
139+
#endif
140+
141+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)
Please sign in to comment.