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 5a4817f

Browse files
committedDec 18, 2019
Add PRNTR V2 variant.
1 parent d2ebcd5 commit 5a4817f

File tree

6 files changed

+1052
-0
lines changed

6 files changed

+1052
-0
lines changed
 

‎boards.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,6 +1279,18 @@ LoRa.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
12791279
3dprinter.menu.pnum.PRNTR_F407_V1.build.variant=PRNTR_F407_V1
12801280
3dprinter.menu.pnum.PRNTR_F407_V1.build.cmsis_lib_gcc=arm_cortexM4lf_math
12811281

1282+
# PRNTR_V2 board
1283+
3dprinter.menu.pnum.PRNTR_V2=PRNTR v2
1284+
3dprinter.menu.pnum.PRNTR_V2.upload.maximum_size=524288
1285+
3dprinter.menu.pnum.PRNTR_V2.upload.maximum_data_size=196608
1286+
3dprinter.menu.pnum.PRNTR_V2.build.mcu=cortex-m4
1287+
3dprinter.menu.pnum.PRNTR_V2.build.flags.fp=-mfpu=fpv4-sp-d16 -mfloat-abi=hard
1288+
3dprinter.menu.pnum.PRNTR_V2.build.board=PRNTR_V2
1289+
3dprinter.menu.pnum.PRNTR_V2.build.series=STM32F4xx
1290+
3dprinter.menu.pnum.PRNTR_V2.build.product_line=STM32F407xx
1291+
3dprinter.menu.pnum.PRNTR_V2.build.variant=PRNTR_V2
1292+
3dprinter.menu.pnum.PRNTR_V2.build.cmsis_lib_gcc=arm_cortexM4lf_math
1293+
12821294
# EEXTR_F030_V1 board
12831295
3dprinter.menu.pnum.EEXTR_F030_V1=EExtruder F030 V1
12841296
3dprinter.menu.pnum.EEXTR_F030_V1.upload.maximum_size=65536

‎variants/PRNTR_V2/PeripheralPins.c

Lines changed: 396 additions & 0 deletions
Large diffs are not rendered by default.

‎variants/PRNTR_V2/PinNamesVar.h

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/* SYS_WKUP */
2+
#ifdef PWR_WAKEUP_PIN1
3+
SYS_WKUP1 = NC,
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+
USB_OTG_HS_ULPI_D0 = PA_3,
34+
USB_OTG_HS_SOF = PA_4,
35+
USB_OTG_HS_ULPI_CK = PA_5,
36+
USB_OTG_HS_ULPI_D1 = PB_0,
37+
USB_OTG_HS_ULPI_D2 = PB_1,
38+
USB_OTG_HS_ULPI_D7 = PB_5,
39+
USB_OTG_HS_ULPI_D3 = PB_10,
40+
USB_OTG_HS_ULPI_D4 = PB_11,
41+
USB_OTG_HS_ID = PB_12,
42+
USB_OTG_HS_ULPI_D5 = PB_12,
43+
USB_OTG_HS_ULPI_D6 = PB_13,
44+
USB_OTG_HS_VBUS = PB_13,
45+
USB_OTG_HS_DM = PB_14,
46+
USB_OTG_HS_DP = PB_15,
47+
USB_OTG_HS_ULPI_STP = PC_0,
48+
USB_OTG_HS_ULPI_DIR = PC_2,
49+
USB_OTG_HS_ULPI_NXT = PC_3,
50+
#endif

‎variants/PRNTR_V2/ldscript.ld

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
/*
2+
*****************************************************************************
3+
**
4+
5+
** File : LinkerScript.ld
6+
**
7+
** Abstract : Linker script for STM32F407VETx Device with
8+
** 512KByte FLASH, 128KByte 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 = 0x20020000; /* 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 = 128K
64+
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K
65+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
66+
}
67+
68+
/* Define output sections */
69+
SECTIONS
70+
{
71+
/* The startup code goes first into FLASH */
72+
.isr_vector :
73+
{
74+
. = ALIGN(4);
75+
KEEP(*(.isr_vector)) /* Startup code */
76+
. = ALIGN(4);
77+
} >FLASH
78+
79+
/* The program code and other data goes into FLASH */
80+
.text ALIGN(8):
81+
{
82+
. = ALIGN(4);
83+
*(.text) /* .text sections (code) */
84+
*(.text*) /* .text* sections (code) */
85+
*(.glue_7) /* glue arm to thumb code */
86+
*(.glue_7t) /* glue thumb to arm code */
87+
*(.eh_frame)
88+
89+
KEEP (*(.init))
90+
KEEP (*(.fini))
91+
92+
. = ALIGN(4);
93+
_etext = .; /* define a global symbols at end of code */
94+
} >FLASH
95+
96+
/* Constant data goes into FLASH */
97+
.rodata ALIGN(4):
98+
{
99+
. = ALIGN(4);
100+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
101+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
102+
. = ALIGN(4);
103+
} >FLASH
104+
105+
.ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH
106+
.ARM : {
107+
__exidx_start = .;
108+
*(.ARM.exidx*)
109+
__exidx_end = .;
110+
} >FLASH
111+
112+
.preinit_array :
113+
{
114+
PROVIDE_HIDDEN (__preinit_array_start = .);
115+
KEEP (*(.preinit_array*))
116+
PROVIDE_HIDDEN (__preinit_array_end = .);
117+
} >FLASH
118+
.init_array :
119+
{
120+
PROVIDE_HIDDEN (__init_array_start = .);
121+
KEEP (*(SORT(.init_array.*)))
122+
KEEP (*(.init_array*))
123+
PROVIDE_HIDDEN (__init_array_end = .);
124+
} >FLASH
125+
.fini_array :
126+
{
127+
PROVIDE_HIDDEN (__fini_array_start = .);
128+
KEEP (*(SORT(.fini_array.*)))
129+
KEEP (*(.fini_array*))
130+
PROVIDE_HIDDEN (__fini_array_end = .);
131+
} >FLASH
132+
133+
/* used by the startup to initialize data */
134+
_sidata = LOADADDR(.data);
135+
136+
/* Initialized data sections goes into RAM, load LMA copy after code */
137+
.data :
138+
{
139+
. = ALIGN(4);
140+
_sdata = .; /* create a global symbol at data start */
141+
*(.data) /* .data sections */
142+
*(.data*) /* .data* sections */
143+
144+
. = ALIGN(4);
145+
_edata = .; /* define a global symbol at data end */
146+
} >RAM AT> FLASH
147+
148+
_siccmram = LOADADDR(.ccmram);
149+
150+
/* CCM-RAM section
151+
*
152+
* IMPORTANT NOTE!
153+
* If initialized variables will be placed in this section,
154+
* the startup code needs to be modified to copy the init-values.
155+
*/
156+
.ccmram :
157+
{
158+
. = ALIGN(4);
159+
_sccmram = .; /* create a global symbol at ccmram start */
160+
*(.ccmram)
161+
*(.ccmram*)
162+
163+
. = ALIGN(4);
164+
_eccmram = .; /* create a global symbol at ccmram end */
165+
} >CCMRAM AT> FLASH
166+
167+
168+
/* Uninitialized data section */
169+
. = ALIGN(4);
170+
.bss :
171+
{
172+
/* This is used by the startup in order to initialize the .bss secion */
173+
_sbss = .; /* define a global symbol at bss start */
174+
__bss_start__ = _sbss;
175+
*(.bss)
176+
*(.bss*)
177+
*(COMMON)
178+
179+
. = ALIGN(4);
180+
_ebss = .; /* define a global symbol at bss end */
181+
__bss_end__ = _ebss;
182+
} >RAM
183+
184+
/* User_heap_stack section, used to check that there is enough RAM left */
185+
._user_heap_stack :
186+
{
187+
. = ALIGN(8);
188+
PROVIDE ( end = . );
189+
PROVIDE ( _end = . );
190+
. = . + _Min_Heap_Size;
191+
. = . + _Min_Stack_Size;
192+
. = ALIGN(8);
193+
} >RAM
194+
195+
196+
197+
/* Remove information from the standard libraries */
198+
/DISCARD/ :
199+
{
200+
libc.a ( * )
201+
libm.a ( * )
202+
libgcc.a ( * )
203+
}
204+
205+
.ARM.attributes 0 : { *(.ARM.attributes) }
206+
}
207+
208+

‎variants/PRNTR_V2/variant.cpp

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2017, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#include "pins_arduino.h"
32+
33+
#ifdef __cplusplus
34+
extern "C" {
35+
#endif
36+
37+
// Pin number
38+
const PinName digitalPin[] = {
39+
PE_0,
40+
PE_1,
41+
PE_2,
42+
PE_3,
43+
PE_4,
44+
PE_5,
45+
PE_6,
46+
PE_7,
47+
PE_8,
48+
PE_9,
49+
PE_10,
50+
PE_11,
51+
PE_12,
52+
PE_13,
53+
PE_14,
54+
PE_15,
55+
56+
PB_0,
57+
PB_1,
58+
PB_2,
59+
PB_3,
60+
PB_4,
61+
PB_5,
62+
PB_6,
63+
PB_7,
64+
PB_8,
65+
PB_9,
66+
PB_10,
67+
PB_11,
68+
PB_12,
69+
PB_13,
70+
PB_14,
71+
PB_15,
72+
73+
PC_0,
74+
PC_1,
75+
PC_2,
76+
PC_3,
77+
PC_4,
78+
PC_5,
79+
PC_6,
80+
PC_7,
81+
PC_8,
82+
PC_9,
83+
PC_10,
84+
PC_11,
85+
PC_12,
86+
PC_13,
87+
PC_14,
88+
PC_15,
89+
90+
PD_0,
91+
PD_1,
92+
PD_2,
93+
PD_3,
94+
PD_4,
95+
PD_5,
96+
PD_6,
97+
PD_7,
98+
PD_8,
99+
PD_9,
100+
PD_10,
101+
PD_11,
102+
PD_12,
103+
PD_13,
104+
PD_14,
105+
PD_15,
106+
107+
PA_0, // A0
108+
PA_1, // A1
109+
PA_2, // A2
110+
PA_3, // A3
111+
PA_4, // A4
112+
PA_5, // A5
113+
PA_6, // A6
114+
PA_7, // A7
115+
PA_8,
116+
PA_9,
117+
PA_10,
118+
PA_11,
119+
PA_12,
120+
PA_13,
121+
PA_14,
122+
PA_15,
123+
};
124+
125+
#ifdef __cplusplus
126+
}
127+
#endif
128+
129+
// ----------------------------------------------------------------------------
130+
131+
#ifdef __cplusplus
132+
extern "C" {
133+
#endif
134+
135+
/**
136+
* @brief System Clock Configuration
137+
* The system Clock is configured as follow :
138+
* System Clock source = PLL (HSE)
139+
* SYSCLK(Hz) = 168000000
140+
* HCLK(Hz) = 168000000
141+
* AHB Prescaler = 1
142+
* APB1 Prescaler = 4
143+
* APB2 Prescaler = 2
144+
* HSE Frequency(Hz) = 8000000
145+
* PLL_M = 8
146+
* PLL_N = 336
147+
* PLL_P = 2
148+
* PLL_Q = 7
149+
* VDD(V) = 3.3
150+
* Main regulator output voltage = Scale1 mode
151+
* Flash Latency(WS) = 5
152+
* @param None
153+
* @retval None
154+
*/
155+
WEAK void SystemClock_Config(void)
156+
{
157+
RCC_ClkInitTypeDef RCC_ClkInitStruct;
158+
RCC_OscInitTypeDef RCC_OscInitStruct;
159+
160+
/**Configure the main internal regulator output voltage
161+
*/
162+
__HAL_RCC_PWR_CLK_ENABLE();
163+
164+
/* The voltage scaling allows optimizing the power consumption when the device is
165+
clocked below the maximum system frequency, to update the voltage scaling value
166+
regarding system frequency refer to product datasheet. */
167+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
168+
169+
/* Enable HSE Oscillator and activate PLL with HSE as source */
170+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
171+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
172+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
173+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
174+
RCC_OscInitStruct.PLL.PLLM = 8;
175+
RCC_OscInitStruct.PLL.PLLN = 336;
176+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
177+
RCC_OscInitStruct.PLL.PLLQ = 7;
178+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
179+
_Error_Handler(__FILE__, __LINE__);
180+
}
181+
182+
/* Select PLL as system clock source and configure the HCLK, PCLK1 and PCLK2
183+
clocks dividers */
184+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK |
185+
RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
186+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
187+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
188+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4;
189+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV2;
190+
191+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_5) != HAL_OK) {
192+
_Error_Handler(__FILE__, __LINE__);
193+
}
194+
}
195+
196+
#ifdef __cplusplus
197+
}
198+
#endif

‎variants/PRNTR_V2/variant.h

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2017, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without
7+
* modification, are permitted provided that the following conditions are met:
8+
*
9+
* 1. Redistributions of source code must retain the above copyright notice,
10+
* this list of conditions and the following disclaimer.
11+
* 2. Redistributions in binary form must reproduce the above copyright notice,
12+
* this list of conditions and the following disclaimer in the documentation
13+
* and/or other materials provided with the distribution.
14+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
15+
* may be used to endorse or promote products derived from this software
16+
* without specific prior written permission.
17+
*
18+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28+
*******************************************************************************
29+
*/
30+
31+
#ifndef _VARIANT_ARDUINO_STM32_
32+
#define _VARIANT_ARDUINO_STM32_
33+
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif // __cplusplus
37+
38+
/*----------------------------------------------------------------------------
39+
* Pins
40+
*----------------------------------------------------------------------------*/
41+
42+
#define PE0 0
43+
#define PE1 1
44+
#define PE2 2
45+
#define PE3 3
46+
#define PE4 4
47+
#define PE5 5
48+
#define PE6 6
49+
#define PE7 7
50+
#define PE8 8
51+
#define PE9 9
52+
#define PE10 10
53+
#define PE11 11
54+
#define PE12 12
55+
#define PE13 13
56+
#define PE14 14
57+
#define PE15 15
58+
59+
#define PB0 16
60+
#define PB1 17
61+
#define PB2 18
62+
#define PB3 19
63+
#define PB4 20
64+
#define PB5 21
65+
#define PB6 22
66+
#define PB7 23
67+
#define PB8 24
68+
#define PB9 25
69+
#define PB10 26
70+
#define PB11 27
71+
#define PB12 28
72+
#define PB13 29
73+
#define PB14 30
74+
#define PB15 31
75+
76+
#define PC0 32
77+
#define PC1 33
78+
#define PC2 34
79+
#define PC3 35
80+
#define PC4 36
81+
#define PC5 37
82+
#define PC6 38
83+
#define PC7 39
84+
#define PC8 40
85+
#define PC9 41
86+
#define PC10 42
87+
#define PC11 43
88+
#define PC12 44
89+
#define PC13 45
90+
#define PC14 46
91+
#define PC15 47
92+
93+
#define PD0 48
94+
#define PD1 49
95+
#define PD2 50
96+
#define PD3 51
97+
#define PD4 52
98+
#define PD5 53
99+
#define PD6 54
100+
#define PD7 55
101+
#define PD8 56
102+
#define PD9 57
103+
#define PD10 58
104+
#define PD11 59
105+
#define PD12 60
106+
#define PD13 61
107+
#define PD14 62
108+
#define PD15 63
109+
110+
#define PA0 64
111+
#define PA1 65
112+
#define PA2 66
113+
#define PA3 67
114+
#define PA4 68
115+
#define PA5 69
116+
#define PA6 70
117+
#define PA7 71
118+
#define PA8 72
119+
#define PA9 73
120+
#define PA10 74
121+
#define PA11 75
122+
#define PA12 76
123+
#define PA13 77
124+
#define PA14 78
125+
#define PA15 79
126+
127+
// This must be a literal
128+
#define NUM_DIGITAL_PINS 80
129+
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
130+
#define NUM_ANALOG_INPUTS 8
131+
#define NUM_ANALOG_FIRST 64
132+
133+
// SPI Definitions
134+
//#define PIN_SPI_SS2 -1
135+
#define PIN_SPI_MOSI PA7
136+
#define PIN_SPI_MISO PA6
137+
#define PIN_SPI_SCK PB3
138+
139+
// I2C Definitions
140+
#define PIN_WIRE_SDA PB7
141+
#define PIN_WIRE_SCL PB6
142+
143+
// Timer Definitions
144+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
145+
#define TIMER_TONE TIM6
146+
#define TIMER_SERVO TIM7
147+
#define TIMER_SERIAL TIM12
148+
149+
// UART Definitions
150+
#define SERIAL_UART_INSTANCE 1
151+
152+
// Default pin used for 'Serial' instance (ex: ST-Link)
153+
// Mandatory for Firmata
154+
#define PIN_SERIAL_RX PA10
155+
#define PIN_SERIAL_TX PA9
156+
157+
/* Extra HAL modules */
158+
//#define HAL_DAC_MODULE_ENABLED
159+
#define HAL_SD_MODULE_ENABLED
160+
161+
#ifdef __cplusplus
162+
} // extern "C"
163+
#endif
164+
/*----------------------------------------------------------------------------
165+
* Arduino objects - C++ only
166+
*----------------------------------------------------------------------------*/
167+
168+
#ifdef __cplusplus
169+
// These serial port names are intended to allow libraries and architecture-neutral
170+
// sketches to automatically default to the correct port name for a particular type
171+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
172+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
173+
//
174+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
175+
//
176+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
177+
//
178+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
179+
//
180+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
181+
//
182+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
183+
// pins are NOT connected to anything by default.
184+
#define SERIAL_PORT_MONITOR Serial
185+
#define SERIAL_PORT_HARDWARE Serial1
186+
#endif
187+
188+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)
Please sign in to comment.