Skip to content

Commit e9e62a9

Browse files
authored
Create variant_DATABOARD.h - add variant.h
Signed-off-by: its-kronos <140297693+its-kronos@users.noreply.github.com>
1 parent cf278cb commit e9e62a9

File tree

1 file changed

+173
-0
lines changed

1 file changed

+173
-0
lines changed
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
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+
*/
13+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
#define PA0 PIN_A0
19+
#define PA1 PIN_A1
20+
#define PA2 PIN_A2
21+
#define PA3 PIN_A3
22+
#define PA4 PIN_A4
23+
#define PA5 PIN_A5
24+
#define PA6 PIN_A6
25+
#define PA7 PIN_A7
26+
#define PA8 8
27+
#define PA9 9
28+
#define PA10 10
29+
#define PA11 11
30+
#define PA12 12
31+
#define PA13 13
32+
#define PA14 14
33+
#define PA15 15
34+
#define PB0 PIN_A8
35+
#define PB1 PIN_A9
36+
#define PB2 18
37+
#define PB3 19
38+
#define PB4 20
39+
#define PB5 21
40+
#define PB6 22
41+
#define PB7 23
42+
#define PB8 24
43+
#define PB9 25
44+
#define PB10 26
45+
#define PB11 27
46+
#define PB12 28
47+
#define PB13 29
48+
#define PB14 30
49+
#define PB15 31
50+
#define PC13 32
51+
#define PC14 33
52+
#define PC15 34
53+
#define PD0 35
54+
#define PD1 36
55+
56+
// Alternate pins number
57+
#define PA0_ALT1 (PA0 | ALT1)
58+
#define PA1_ALT1 (PA1 | ALT1)
59+
#define PA2_ALT1 (PA2 | ALT1)
60+
#define PA3_ALT1 (PA3 | ALT1)
61+
#define PA4_ALT1 (PA4 | ALT1)
62+
#define PA5_ALT1 (PA5 | ALT1)
63+
#define PA6_ALT1 (PA6 | ALT1)
64+
#define PA7_ALT1 (PA7 | ALT1)
65+
#define PA8_ALT1 (PA8 | ALT1)
66+
#define PA9_ALT1 (PA9 | ALT1)
67+
#define PA10_ALT1 (PA10 | ALT1)
68+
#define PA11_ALT1 (PA11 | ALT1)
69+
#define PA15_ALT1 (PA15 | ALT1)
70+
#define PB0_ALT1 (PB0 | ALT1)
71+
#define PB0_ALT2 (PB0 | ALT2)
72+
#define PB1_ALT1 (PB1 | ALT1)
73+
#define PB1_ALT2 (PB1 | ALT2)
74+
#define PB3_ALT1 (PB3 | ALT1)
75+
#define PB10_ALT1 (PB10 | ALT1)
76+
#define PB11_ALT1 (PB11 | ALT1)
77+
#define PB13_ALT1 (PB13 | ALT1)
78+
#define PB14_ALT1 (PB14 | ALT1)
79+
80+
#define NUM_DIGITAL_PINS 37
81+
#define NUM_ANALOG_INPUTS 10
82+
83+
// On-board LED pin number
84+
#ifndef LED_BUILTIN
85+
#define LED_BUILTIN PNUM_NOT_DEFINED
86+
#endif
87+
88+
// On-board user button
89+
#ifndef USER_BTN
90+
#define USER_BTN PNUM_NOT_DEFINED
91+
#endif
92+
93+
// SPI definitions
94+
#ifndef PIN_SPI_SS
95+
#define PIN_SPI_SS PA4
96+
#endif
97+
#ifndef PIN_SPI_SS1
98+
#define PIN_SPI_SS1 PA15
99+
#endif
100+
#ifndef PIN_SPI_SS2
101+
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
102+
#endif
103+
#ifndef PIN_SPI_SS3
104+
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
105+
#endif
106+
#ifndef PIN_SPI_MOSI
107+
#define PIN_SPI_MOSI PA7
108+
#endif
109+
#ifndef PIN_SPI_MISO
110+
#define PIN_SPI_MISO PA6
111+
#endif
112+
#ifndef PIN_SPI_SCK
113+
#define PIN_SPI_SCK PA5
114+
#endif
115+
116+
// I2C definitions
117+
#ifndef PIN_WIRE_SDA
118+
#define PIN_WIRE_SDA PB7
119+
#endif
120+
#ifndef PIN_WIRE_SCL
121+
#define PIN_WIRE_SCL PB6
122+
#endif
123+
124+
// Timer Definitions
125+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
126+
#ifndef TIMER_TONE
127+
#define TIMER_TONE TIM3
128+
#endif
129+
#ifndef TIMER_SERVO
130+
#define TIMER_SERVO TIM4
131+
#endif
132+
133+
// UART Definitions
134+
#ifndef SERIAL_UART_INSTANCE
135+
#define SERIAL_UART_INSTANCE 2
136+
#endif
137+
138+
// Default pin used for generic 'Serial' instance
139+
// Mandatory for Firmata
140+
#ifndef PIN_SERIAL_RX
141+
#define PIN_SERIAL_RX PA3
142+
#endif
143+
#ifndef PIN_SERIAL_TX
144+
#define PIN_SERIAL_TX PA2
145+
#endif
146+
147+
/*----------------------------------------------------------------------------
148+
* Arduino objects - C++ only
149+
*----------------------------------------------------------------------------*/
150+
151+
#ifdef __cplusplus
152+
// These serial port names are intended to allow libraries and architecture-neutral
153+
// sketches to automatically default to the correct port name for a particular type
154+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
155+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
156+
//
157+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
158+
//
159+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
160+
//
161+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
162+
//
163+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
164+
//
165+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
166+
// pins are NOT connected to anything by default.
167+
#ifndef SERIAL_PORT_MONITOR
168+
#define SERIAL_PORT_MONITOR Serial
169+
#endif
170+
#ifndef SERIAL_PORT_HARDWARE
171+
#define SERIAL_PORT_HARDWARE Serial
172+
#endif
173+
#endif

0 commit comments

Comments
 (0)