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 3eb08f8

Browse files
committedFeb 23, 2019
Merge branch 'master' into cdc
2 parents e1fab94 + 54478a1 commit 3eb08f8

File tree

21 files changed

+1538
-548
lines changed

21 files changed

+1538
-548
lines changed
 

‎README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
115115
| :---: | --- | :---: | :--- |
116116
| :green_heart: | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | Basic support |
117117

118+
| Status | Sparky flight controllers | Release | Comment |
119+
| :---: | --- | :---: | :--- |
120+
| :yellow_heart: | [Sparky V1](https://github.com/TauLabs/TauLabs/wiki/Sparky) | **1.5.1/1.6.0** | |
121+
118122
## Next release
119123

120124
See [milestones](https://github.com/stm32duino/Arduino_Core_STM32/milestones) to have an overview of the next release content.

‎boards.txt

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,33 @@ GenF4.menu.upload_method.bmpMethod=BMP (Black Magic Probe)
709709
GenF4.menu.upload_method.bmpMethod.upload.protocol=gdb_bmp
710710
GenF4.menu.upload_method.bmpMethod.upload.tool=bmp_upload
711711

712+
###############################
713+
# Sparky Flight Controllers
714+
715+
Sparky.name=Sparky flight controllers
716+
717+
Sparky.build.vid=0x0483
718+
Sparky.build.core=arduino
719+
Sparky.build.board=Sparky
720+
Sparky.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial}
721+
722+
# Sparky_V1 board
723+
# Support: Serial1 (USART1 on PA10, PA9)
724+
Sparky.menu.pnum.Sparky_V1=Sparky V1
725+
Sparky.menu.pnum.Sparky_V1.upload.maximum_size=262144
726+
Sparky.menu.pnum.Sparky_V1.upload.maximum_data_size=40960
727+
Sparky.menu.pnum.Sparky_V1.build.mcu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
728+
Sparky.menu.pnum.Sparky_V1.build.board=Sparky_V1
729+
Sparky.menu.pnum.Sparky_V1.build.series=STM32F3xx
730+
Sparky.menu.pnum.Sparky_V1.build.product_line=STM32F303xC
731+
Sparky.menu.pnum.Sparky_V1.build.variant=SPARKY_F303CC
732+
Sparky.menu.pnum.Sparky_V1.build.cmsis_lib_gcc=arm_cortexM4l_math
733+
734+
# Upload menu
735+
Sparky.menu.upload_method.STLinkMethod=STLink
736+
Sparky.menu.upload_method.STLinkMethod.upload.protocol=STLink
737+
Sparky.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
738+
712739
################################################################################
713740
# RAK boards
714741

@@ -897,6 +924,12 @@ GenF4.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
897924
GenF4.menu.xserial.disabled=Disabled (no Serial support)
898925
GenF4.menu.xserial.disabled.build.xSerial=
899926

927+
Sparky.menu.xserial.generic=Enabled (generic 'Serial')
928+
Sparky.menu.xserial.none=Enabled (no generic 'Serial')
929+
Sparky.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
930+
Sparky.menu.xserial.disabled=Disabled (no Serial support)
931+
Sparky.menu.xserial.disabled.build.xSerial=
932+
900933
RAK.menu.xserial.generic=Enabled (generic 'Serial')
901934
RAK.menu.xserial.none=Enabled (no generic 'Serial')
902935
RAK.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
@@ -988,6 +1021,17 @@ GenF4.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS
9881021
GenF4.menu.xusb.HSFS=High Speed in Full Speed mode
9891022
GenF4.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS
9901023

1024+
Sparky.menu.usb.none=None
1025+
Sparky.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
1026+
Sparky.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
1027+
Sparky.menu.usb.CDC=CDC (no generic 'Serial')
1028+
Sparky.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB
1029+
Sparky.menu.xusb.FS=Low/Full Speed
1030+
Sparky.menu.xusb.HS=High Speed
1031+
Sparky.menu.xusb.HS.build.usb_speed=-DUSE_USB_HS
1032+
Sparky.menu.xusb.HSFS=High Speed in Full Speed mode
1033+
Sparky.menu.xusb.HSFS.build.usb_speed=-DUSE_USB_HS -DUSE_USB_HS_IN_FS
1034+
9911035
3dprinter.menu.usb.none=None
9921036
3dprinter.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
9931037
3dprinter.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC
@@ -1127,6 +1171,24 @@ GenF4.menu.opt.o3lto.build.flags.optimize=-O3 -flto
11271171
GenF4.menu.opt.ogstd=Debug (-g)
11281172
GenF4.menu.opt.ogstd.build.flags.optimize=-g -Og
11291173

1174+
Sparky.menu.opt.osstd=Smallest (-Os default)
1175+
Sparky.menu.opt.oslto=Smallest (-Os) with LTO
1176+
Sparky.menu.opt.oslto.build.flags.optimize=-Os -flto
1177+
Sparky.menu.opt.o1std=Fast (-O1)
1178+
Sparky.menu.opt.o1std.build.flags.optimize=-O1
1179+
Sparky.menu.opt.o1lto=Fast (-O1) with LTO
1180+
Sparky.menu.opt.o1lto.build.flags.optimize=-O1 -flto
1181+
Sparky.menu.opt.o2std=Faster (-O2)
1182+
Sparky.menu.opt.o2std.build.flags.optimize=-O2
1183+
Sparky.menu.opt.o2lto=Faster (-O2) with LTO
1184+
Sparky.menu.opt.o2lto.build.flags.optimize=-O2 -flto
1185+
Sparky.menu.opt.o3std=Fastest (-O3)
1186+
Sparky.menu.opt.o3std.build.flags.optimize=-O3
1187+
Sparky.menu.opt.o3lto=Fastest (-O3) with LTO
1188+
Sparky.menu.opt.o3lto.build.flags.optimize=-O3 -flto
1189+
Sparky.menu.opt.ogstd=Debug (-g)
1190+
Sparky.menu.opt.ogstd.build.flags.optimize=-g -Og
1191+
11301192
RAK.menu.opt.osstd=Smallest (-Os default)
11311193
RAK.menu.opt.oslto=Smallest (-Os) with LTO
11321194
RAK.menu.opt.oslto.build.flags.optimize=-Os -flto
@@ -1234,6 +1296,16 @@ GenF4.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float
12341296
GenF4.menu.rtlib.full=Newlib Standard
12351297
GenF4.menu.rtlib.full.build.flags.ldspecs=
12361298

1299+
Sparky.menu.rtlib.nano=Newlib Nano (default)
1300+
Sparky.menu.rtlib.nanofp=Newlib Nano + Float Printf
1301+
Sparky.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float
1302+
Sparky.menu.rtlib.nanofs=Newlib Nano + Float Scanf
1303+
Sparky.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float
1304+
Sparky.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
1305+
Sparky.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
1306+
Sparky.menu.rtlib.full=Newlib Standard
1307+
Sparky.menu.rtlib.full.build.flags.ldspecs=
1308+
12371309
RAK.menu.rtlib.nano=Newlib Nano (default)
12381310
RAK.menu.rtlib.nanofp=Newlib Nano + Float Printf
12391311
RAK.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float

‎cores/arduino/board.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* Core and peripherals registers definitions
66
*/
77
#include "interrupt.h"
8-
#ifdef __cplusplus
9-
extern "C" {
10-
#endif // __cplusplus
118
#include "analog.h"
129
#include "clock.h"
1310
#include "core_callback.h"
@@ -21,8 +18,11 @@ extern "C" {
2118
#include "twi.h"
2219
#include "uart.h"
2320

21+
#ifdef __cplusplus
22+
extern "C" {
23+
#endif /* __cplusplus */
2424
void init(void) ;
2525
#ifdef __cplusplus
2626
}
27-
#endif // __cplusplus
27+
#endif /* __cplusplus */
2828
#endif /* _BOARD_H_ */

‎cores/arduino/stm32/analog.c

Lines changed: 3 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@
3535
*
3636
******************************************************************************
3737
*/
38-
/** @addtogroup CMSIS
39-
* @{
40-
*/
41-
42-
/** @addtogroup stm32f4xx_system
43-
* @{
44-
*/
45-
46-
/** @addtogroup STM32F4xx_System_Private_Includes
47-
* @{
48-
*/
4938
#include "stm32_def.h"
5039
#include "analog.h"
5140
#include "timer.h"
@@ -55,20 +44,7 @@
5544
extern "C" {
5645
#endif
5746

58-
/**
59-
* @}
60-
*/
61-
62-
/** @addtogroup STM32F4xx_System_Private_TypesDefinitions
63-
* @{
64-
*/
65-
/**
66-
* @}
67-
*/
68-
69-
/** @addtogroup STM32F4xx_System_Private_Defines
70-
* @{
71-
*/
47+
/* Private_Defines */
7248
#if defined(ADC_SAMPLETIME_8CYCLES_5)
7349
#define SAMPLINGTIME ADC_SAMPLETIME_8CYCLES_5;
7450
#elif defined(ADC_SAMPLETIME_12CYCLES_5)
@@ -102,30 +78,11 @@ extern "C" {
10278
#ifndef ADC_REGULAR_RANK_1
10379
#define ADC_REGULAR_RANK_1 1
10480
#endif
105-
/**
106-
* @}
107-
*/
108-
109-
/** @addtogroup STM32F4xx_System_Private_Macros
110-
* @{
111-
*/
112-
113-
/**
114-
* @}
115-
*/
11681

117-
/** @addtogroup STM32F4xx_System_Private_Variables
118-
* @{
119-
*/
82+
/* Private_Variables */
12083
static PinName g_current_pin = NC;
12184

122-
/**
123-
* @}
124-
*/
125-
126-
/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes
127-
* @{
128-
*/
85+
/* Private Functions */
12986
static uint32_t get_adc_channel(PinName pin)
13087
{
13188
uint32_t function = pinmap_function(pin, PinMap_ADC);
@@ -804,23 +761,6 @@ void pwm_stop(PinName pin)
804761
HAL_TIM_PWM_DeInit(&timHandle);
805762
}
806763

807-
808-
/**
809-
* @}
810-
*/
811-
812-
813-
/**
814-
* @}
815-
*/
816-
817-
/**
818-
* @}
819-
*/
820-
821-
/**
822-
* @}
823-
*/
824764
#ifdef __cplusplus
825765
}
826766
#endif

‎cores/arduino/stm32/analog.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@
4747
extern "C" {
4848
#endif
4949

50-
/* Exported types ------------------------------------------------------------*/
51-
/* Exported constants --------------------------------------------------------*/
52-
/* Exported macro ------------------------------------------------------------*/
5350
/* Exported functions ------------------------------------------------------- */
5451
void dac_write_value(PinName pin, uint32_t value, uint8_t do_init);
5552
void dac_stop(PinName pin);

‎cores/arduino/stm32/interrupt.cpp

Lines changed: 5 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -35,57 +35,21 @@
3535
*
3636
******************************************************************************
3737
*/
38-
/** @addtogroup CMSIS
39-
* @{
40-
*/
41-
42-
/** @addtogroup stm32f4xx_system
43-
* @{
44-
*/
45-
46-
/** @addtogroup STM32F4xx_System_Private_Includes
47-
* @{
48-
*/
4938
#include "stm32_def.h"
5039
#include "interrupt.h"
5140

52-
/**
53-
* @}
54-
*/
55-
56-
/** @addtogroup STM32F4xx_System_Private_TypesDefinitions
57-
* @{
58-
*/
41+
/* Private Types */
5942

6043
/*As we can have only one interrupt/pin id, don't need to get the port info*/
6144
typedef struct {
6245
IRQn_Type irqnb;
6346
std::function<void(void)> callback;
6447
} gpio_irq_conf_str;
6548

66-
/**
67-
* @}
68-
*/
69-
70-
/** @addtogroup STM32F4xx_System_Private_Defines
71-
* @{
72-
*/
49+
/* Private_Defines */
7350
#define NB_EXTI (16)
74-
/**
75-
* @}
76-
*/
77-
78-
/** @addtogroup STM32F4xx_System_Private_Macros
79-
* @{
80-
*/
81-
82-
/**
83-
* @}
84-
*/
8551

86-
/** @addtogroup STM32F4xx_System_Private_Variables
87-
* @{
88-
*/
52+
/* Private Variables */
8953
static gpio_irq_conf_str gpio_irq_conf[NB_EXTI] = {
9054
#if defined (STM32F0xx) || defined (STM32L0xx)
9155
{.irqnb = EXTI0_1_IRQn, .callback = NULL}, //GPIO_PIN_0
@@ -123,25 +87,14 @@ static gpio_irq_conf_str gpio_irq_conf[NB_EXTI] = {
12387
{.irqnb = EXTI15_10_IRQn, .callback = NULL} //GPIO_PIN_15
12488
#endif
12589
};
126-
/**
127-
* @}
128-
*/
12990

130-
/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes
131-
* @{
132-
*/
133-
134-
static uint8_t get_pin_id(uint16_t pin);
135-
136-
/**
137-
* @}
138-
*/
91+
/* Private Functions */
13992
/**
14093
* @brief This function returns the pin ID function of the HAL PIN definition
14194
* @param pin : one of the gpio pin
14295
* @retval None
14396
*/
144-
uint8_t get_pin_id(uint16_t pin)
97+
static uint8_t get_pin_id(uint16_t pin)
14598
{
14699
uint8_t id = 0;
147100

@@ -397,15 +350,4 @@ void EXTI15_10_IRQHandler(void)
397350
}
398351
#endif
399352
#endif
400-
/**
401-
* @}
402-
*/
403-
404-
/**
405-
* @}
406-
*/
407-
408-
/**
409-
* @}
410-
*/
411353
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

‎cores/arduino/stm32/interrupt.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ typedef std::function<void(void)> callback_function_t;
5454
void stm32_interrupt_enable(GPIO_TypeDef *port, uint16_t pin, callback_function_t callback, uint32_t mode);
5555
#endif
5656

57-
/* Exported types ------------------------------------------------------------*/
58-
/* Exported constants --------------------------------------------------------*/
59-
/* Exported macro ------------------------------------------------------------*/
6057
/* Exported functions ------------------------------------------------------- */
6158
void stm32_interrupt_enable(GPIO_TypeDef *port, uint16_t pin, void (*callback)(void), uint32_t mode);
6259
void stm32_interrupt_disable(GPIO_TypeDef *port, uint16_t pin);

‎cores/arduino/stm32/rtc.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,16 @@ static void RTC_initClock(sourceClock_t source)
146146
#ifndef RCC_RTCCLKSOURCE_HSE_DIVX
147147
#define RCC_RTCCLKSOURCE_HSE_DIVX 0x00000300U
148148
#endif /* RCC_RTCCLKSOURCE_HSE_DIVX */
149-
for (HSEDiv = 2; HSEDiv < 32; HSEDiv++) {
149+
#if defined(STM32H7xx)
150+
#define HSEDIV_MAX 64
151+
#define HSESHIFT 12
152+
#else
153+
#define HSEDIV_MAX 32
154+
#define HSESHIFT 16
155+
#endif
156+
for (HSEDiv = 2; HSEDiv < HSEDIV_MAX; HSEDiv++) {
150157
if ((HSE_VALUE / HSEDiv) <= HSE_RTC_MAX) {
151-
PeriphClkInit.RTCClockSelection = (HSEDiv << 16) | RCC_RTCCLKSOURCE_HSE_DIVX;
158+
PeriphClkInit.RTCClockSelection = (HSEDiv << HSESHIFT) | RCC_RTCCLKSOURCE_HSE_DIVX;
152159
break;
153160
}
154161
}

‎cores/arduino/stm32/spi_com.c

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,6 @@
3535
*
3636
******************************************************************************
3737
*/
38-
/** @addtogroup CMSIS
39-
* @{
40-
*/
41-
42-
/** @addtogroup stm32f4xx_system
43-
* @{
44-
*/
45-
46-
/** @addtogroup STM32F4xx_System_Private_Includes
47-
* @{
48-
*/
4938
#include "core_debug.h"
5039
#include "stm32_def.h"
5140
#include "spi_com.h"
@@ -56,53 +45,7 @@
5645
extern "C" {
5746
#endif
5847

59-
/**
60-
* @}
61-
*/
62-
63-
/** @addtogroup STM32F4xx_System_Private_Defines
64-
* @{
65-
*/
66-
67-
/**
68-
* @}
69-
*/
70-
71-
/** @addtogroup STM32F4xx_System_Private_TypesDefinitions
72-
* @{
73-
*/
74-
75-
/**
76-
* @}
77-
*/
78-
79-
/** @addtogroup STM32F4xx_System_Private_Macros
80-
* @{
81-
*/
82-
83-
/**
84-
* @}
85-
*/
86-
87-
/** @addtogroup STM32F4xx_System_Private_Variables
88-
* @{
89-
*/
90-
91-
/**
92-
* @}
93-
*/
94-
95-
/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes
96-
* @{
97-
*/
98-
99-
/**
100-
* @}
101-
*/
102-
103-
/** @addtogroup STM32F4xx_System_Private_Functions
104-
* @{
105-
*/
48+
/* Private Functions */
10649
/**
10750
* @brief return clock freq of an SPI instance
10851
* @param spi_inst : SPI instance
@@ -460,18 +403,6 @@ spi_status_e spi_transfer(spi_t *obj, uint8_t *tx_buffer,
460403
return ret;
461404
}
462405

463-
464-
/**
465-
* @}
466-
*/
467-
468-
/**
469-
* @}
470-
*/
471-
472-
/**
473-
* @}
474-
*/
475406
#ifdef __cplusplus
476407
}
477408
#endif

‎cores/arduino/stm32/spi_com.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,6 @@ typedef enum {
9494
SPI_ERROR = 2
9595
} spi_status_e;
9696

97-
/* Exported constants --------------------------------------------------------*/
98-
99-
/* Exported macro ------------------------------------------------------------*/
10097
/* Exported functions ------------------------------------------------------- */
10198
void spi_init(spi_t *obj, uint32_t speed, spi_mode_e mode, uint8_t msb);
10299
void spi_deinit(spi_t *obj);

‎cores/arduino/stm32/timer.c

Lines changed: 143 additions & 139 deletions
Large diffs are not rendered by default.

‎cores/arduino/stm32/timer.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ struct timer_s {
182182
#endif
183183
#endif
184184

185-
/* Exported macro ------------------------------------------------------------*/
186185
/* Exported functions ------------------------------------------------------- */
187186

188187
void timer_enable_clock(TIM_HandleTypeDef *htim);

‎cores/arduino/stm32/twi.c

Lines changed: 28 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -35,104 +35,43 @@
3535
*
3636
******************************************************************************
3737
*/
38-
39-
/** @addtogroup CMSIS
40-
* @{
41-
*/
42-
43-
/** @addtogroup stm32f4xx_system
44-
* @{
45-
*/
46-
47-
/** @addtogroup STM32F4xx_System_Private_Includes
48-
* @{
49-
*/
5038
#include "core_debug.h"
5139
#include "stm32_def.h"
5240
#include "twi.h"
5341
#include "PinAF_STM32F1.h"
5442

55-
/**
56-
* @}
57-
*/
58-
5943
#ifdef __cplusplus
6044
extern "C" {
6145
#endif
6246

63-
/** @addtogroup STM32F4xx_System_Private_TypesDefinitions
64-
* @{
65-
*/
66-
/**
67-
* @}
68-
*/
69-
70-
/** @addtogroup STM32F4xx_System_Private_Defines
71-
* @{
72-
*/
73-
47+
/* Private Defines */
7448
/// @brief I2C timout in tick unit
7549
#define I2C_TIMEOUT_TICK 100
7650

7751
#define SLAVE_MODE_TRANSMIT 0
7852
#define SLAVE_MODE_RECEIVE 1
7953
#define SLAVE_MODE_LISTEN 2
8054

81-
82-
/**
83-
* @}
84-
*/
85-
86-
/** @addtogroup STM32F4xx_System_Private_Macros
87-
* @{
88-
*/
89-
90-
/**
91-
* @}
92-
*/
93-
94-
/** @addtogroup STM32F4xx_System_Private_TypesDefinitions
95-
* @{
96-
*/
97-
98-
/**
99-
* @}
100-
*/
101-
102-
/** @addtogroup STM32F4xx_System_Private_Variables
103-
* @{
104-
*/
105-
10655
/* Family specific description for I2C */
107-
#if defined(STM32F7xx) || defined(STM32H7xx) || defined(STM32L4xx)
108-
#define I2C_NUM (4)
109-
#elif defined(STM32F2xx) || defined(STM32F3xx) || defined(STM32F4xx) || defined(STM32L0xx)
110-
#define I2C_NUM (3)
111-
#elif defined(STM32F0xx) || defined(STM32F1xx) || defined(STM32L1xx)
112-
#define I2C_NUM (2)
113-
#else
114-
#error "Unknown Family - unknown I2C_NUM"
56+
typedef enum {
57+
#if defined(I2C1_BASE)
58+
I2C1_INDEX,
59+
#endif
60+
#if defined(I2C2_BASE)
61+
I2C2_INDEX,
62+
#endif
63+
#if defined(I2C3_BASE)
64+
I2C3_INDEX,
11565
#endif
66+
#if defined(I2C4_BASE)
67+
I2C4_INDEX,
68+
#endif
69+
I2C_NUM
70+
} i2c_index_t;
11671

72+
/* Private Variables */
11773
static I2C_HandleTypeDef *i2c_handles[I2C_NUM];
11874

119-
/**
120-
* @}
121-
*/
122-
123-
/** @addtogroup STM32F4xx_System_Private_FunctionPrototypes
124-
* @{
125-
*/
126-
127-
/**
128-
* @}
129-
*/
130-
131-
/** @addtogroup STM32F4xx_System_Private_Functions
132-
* @{
133-
*/
134-
135-
13675
/**
13776
* @brief Default init and setup GPIO and I2C peripheral
13877
* @param obj : pointer to i2c_t structure
@@ -188,7 +127,7 @@ void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode, u
188127
#if !defined(STM32F0xx) && !defined(STM32L0xx)
189128
obj->irqER = I2C1_ER_IRQn;
190129
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
191-
i2c_handles[0] = handle;
130+
i2c_handles[I2C1_INDEX] = handle;
192131
}
193132
#endif // I2C1_BASE
194133
#if defined I2C2_BASE
@@ -201,7 +140,7 @@ void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode, u
201140
#if !defined(STM32F0xx) && !defined(STM32L0xx)
202141
obj->irqER = I2C2_ER_IRQn;
203142
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
204-
i2c_handles[1] = handle;
143+
i2c_handles[I2C2_INDEX] = handle;
205144
}
206145
#endif // I2C2_BASE
207146
#if defined I2C3_BASE
@@ -214,7 +153,7 @@ void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode, u
214153
#if !defined(STM32F0xx) && !defined(STM32L0xx)
215154
obj->irqER = I2C3_ER_IRQn;
216155
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
217-
i2c_handles[2] = handle;
156+
i2c_handles[I2C3_INDEX] = handle;
218157
}
219158
#endif // I2C3_BASE
220159
#if defined I2C4_BASE
@@ -227,7 +166,7 @@ void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode, u
227166
#if !defined(STM32F0xx) && !defined(STM32L0xx)
228167
obj->irqER = I2C4_ER_IRQn;
229168
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
230-
i2c_handles[3] = handle;
169+
i2c_handles[I2C4_INDEX] = handle;
231170
}
232171
#endif // I2C4_BASE
233172

@@ -644,7 +583,7 @@ void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c)
644583
*/
645584
void I2C1_EV_IRQHandler(void)
646585
{
647-
I2C_HandleTypeDef *handle = i2c_handles[0];
586+
I2C_HandleTypeDef *handle = i2c_handles[I2C1_INDEX];
648587
HAL_I2C_EV_IRQHandler(handle);
649588
#if defined(STM32F0xx) || defined(STM32L0xx)
650589
HAL_I2C_ER_IRQHandler(handle);
@@ -659,7 +598,7 @@ void I2C1_EV_IRQHandler(void)
659598
*/
660599
void I2C1_ER_IRQHandler(void)
661600
{
662-
I2C_HandleTypeDef *handle = i2c_handles[0];
601+
I2C_HandleTypeDef *handle = i2c_handles[I2C1_INDEX];
663602
HAL_I2C_ER_IRQHandler(handle);
664603
}
665604
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
@@ -673,7 +612,7 @@ void I2C1_ER_IRQHandler(void)
673612
*/
674613
void I2C2_EV_IRQHandler(void)
675614
{
676-
I2C_HandleTypeDef *handle = i2c_handles[1];
615+
I2C_HandleTypeDef *handle = i2c_handles[I2C2_INDEX];
677616
HAL_I2C_EV_IRQHandler(handle);
678617
#if defined(STM32F0xx) || defined(STM32L0xx)
679618
HAL_I2C_ER_IRQHandler(handle);
@@ -688,7 +627,7 @@ void I2C2_EV_IRQHandler(void)
688627
*/
689628
void I2C2_ER_IRQHandler(void)
690629
{
691-
I2C_HandleTypeDef *handle = i2c_handles[1];
630+
I2C_HandleTypeDef *handle = i2c_handles[I2C2_INDEX];
692631
HAL_I2C_ER_IRQHandler(handle);
693632
}
694633
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
@@ -702,7 +641,7 @@ void I2C2_ER_IRQHandler(void)
702641
*/
703642
void I2C3_EV_IRQHandler(void)
704643
{
705-
I2C_HandleTypeDef *handle = i2c_handles[2];
644+
I2C_HandleTypeDef *handle = i2c_handles[I2C3_INDEX];
706645
HAL_I2C_EV_IRQHandler(handle);
707646
#if defined(STM32F0xx) || defined(STM32L0xx)
708647
HAL_I2C_ER_IRQHandler(handle);
@@ -717,7 +656,7 @@ void I2C3_EV_IRQHandler(void)
717656
*/
718657
void I2C3_ER_IRQHandler(void)
719658
{
720-
I2C_HandleTypeDef *handle = i2c_handles[2];
659+
I2C_HandleTypeDef *handle = i2c_handles[I2C3_INDEX];
721660
HAL_I2C_ER_IRQHandler(handle);
722661
}
723662
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
@@ -731,7 +670,7 @@ void I2C3_ER_IRQHandler(void)
731670
*/
732671
void I2C4_EV_IRQHandler(void)
733672
{
734-
I2C_HandleTypeDef *handle = i2c_handles[3];
673+
I2C_HandleTypeDef *handle = i2c_handles[I2C4_INDEX];
735674
HAL_I2C_EV_IRQHandler(handle);
736675
#if defined(STM32F0xx) || defined(STM32L0xx)
737676
HAL_I2C_ER_IRQHandler(handle);
@@ -746,24 +685,12 @@ void I2C4_EV_IRQHandler(void)
746685
*/
747686
void I2C4_ER_IRQHandler(void)
748687
{
749-
I2C_HandleTypeDef *handle = i2c_handles[3];
688+
I2C_HandleTypeDef *handle = i2c_handles[I2C4_INDEX];
750689
HAL_I2C_ER_IRQHandler(handle);
751690
}
752691
#endif // !defined(STM32F0xx) && !defined(STM32L0xx)
753692
#endif // I2C4_BASE
754693

755-
/**
756-
* @}
757-
*/
758-
759-
/**
760-
* @}
761-
*/
762-
763-
/**
764-
* @}
765-
*/
766-
767694
#ifdef __cplusplus
768695
}
769696
#endif

‎cores/arduino/stm32/twi.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ typedef enum {
141141
#endif
142142
} i2c_timing_e;
143143

144-
/* Exported constants --------------------------------------------------------*/
145-
/* Exported macro ------------------------------------------------------------*/
146144
/* Exported functions ------------------------------------------------------- */
147145
void i2c_init(i2c_t *obj);
148146
void i2c_custom_init(i2c_t *obj, i2c_timing_e timing, uint32_t addressingMode,

‎cores/arduino/stm32/uart.c

Lines changed: 101 additions & 94 deletions
Large diffs are not rendered by default.

‎variants/SPARKY_F303CC/PeripheralPins.c

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

‎variants/SPARKY_F303CC/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 = PC_13,
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/SPARKY_F303CC/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 STM32F303CC Device with
8+
** 256KByte FLASH, 40KByte RAM, 8KByte CCMRAM
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 = 0x2000A000; /* 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 = 40K
64+
CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 8K
65+
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
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(4):
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 :
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+
Lines changed: 344 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,344 @@
1+
/**
2+
******************************************************************************
3+
* @file stm32f3xx_hal_conf.h
4+
* @author MCD Application Team
5+
* @version V1.4.0
6+
* @date 16-December-2016
7+
* @brief HAL configuration file.
8+
******************************************************************************
9+
* @attention
10+
*
11+
* <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
12+
*
13+
* Redistribution and use in source and binary forms, with or without modification,
14+
* are permitted provided that the following conditions are met:
15+
* 1. Redistributions of source code must retain the above copyright notice,
16+
* this list of conditions and the following disclaimer.
17+
* 2. Redistributions in binary form must reproduce the above copyright notice,
18+
* this list of conditions and the following disclaimer in the documentation
19+
* and/or other materials provided with the distribution.
20+
* 3. Neither the name of STMicroelectronics nor the names of its contributors
21+
* may be used to endorse or promote products derived from this software
22+
* without specific prior written permission.
23+
*
24+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34+
*
35+
******************************************************************************
36+
*/
37+
38+
/* Define to prevent recursive inclusion -------------------------------------*/
39+
#ifndef __STM32F3xx_HAL_CONF_H
40+
#define __STM32F3xx_HAL_CONF_H
41+
42+
#ifdef __cplusplus
43+
extern "C" {
44+
#endif
45+
46+
/* Exported types ------------------------------------------------------------*/
47+
/* Exported constants --------------------------------------------------------*/
48+
49+
/* ########################## Module Selection ############################## */
50+
/**
51+
* @brief This is the list of modules to be used in the HAL driver
52+
*/
53+
#define HAL_MODULE_ENABLED
54+
#define HAL_ADC_MODULE_ENABLED
55+
#define HAL_CAN_MODULE_ENABLED
56+
// #define HAL_CAN_LEGACY_MODULE_ENABLED
57+
// #define HAL_CEC_MODULE_ENABLED
58+
// #define HAL_COMP_MODULE_ENABLED
59+
#define HAL_CORTEX_MODULE_ENABLED
60+
// #define HAL_CRC_MODULE_ENABLED
61+
#define HAL_DAC_MODULE_ENABLED
62+
#define HAL_DMA_MODULE_ENABLED
63+
#define HAL_FLASH_MODULE_ENABLED
64+
// #define HAL_SRAM_MODULE_ENABLED
65+
// #define HAL_NOR_MODULE_ENABLED
66+
// #define HAL_NAND_MODULE_ENABLED
67+
// #define HAL_PCCARD_MODULE_ENABLED
68+
#define HAL_GPIO_MODULE_ENABLED
69+
// #define HAL_HRTIM_MODULE_ENABLED
70+
#define HAL_I2C_MODULE_ENABLED
71+
// #define HAL_I2S_MODULE_ENABLED
72+
// #define HAL_IRDA_MODULE_ENABLED
73+
// #define HAL_IWDG_MODULE_ENABLED
74+
// #define HAL_OPAMP_MODULE_ENABLED
75+
// #define HAL_PCD_MODULE_ENABLED
76+
#define HAL_PWR_MODULE_ENABLED
77+
#define HAL_RCC_MODULE_ENABLED
78+
#define HAL_RTC_MODULE_ENABLED
79+
// #define HAL_SDADC_MODULE_ENABLED
80+
// #define HAL_SMARTCARD_MODULE_ENABLED
81+
// #define HAL_SMBUS_MODULE_ENABLED
82+
#define HAL_SPI_MODULE_ENABLED
83+
#define HAL_TIM_MODULE_ENABLED
84+
// #define HAL_TSC_MODULE_ENABLED
85+
// #define HAL_UART_MODULE_ENABLED
86+
// #define HAL_USART_MODULE_ENABLED
87+
// #define HAL_WWDG_MODULE_ENABLED
88+
89+
/* ########################## HSE/HSI Values adaptation ##################### */
90+
/**
91+
* @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
92+
* This value is used by the RCC HAL module to compute the system frequency
93+
* (when HSE is used as system clock source, directly or through the PLL).
94+
*/
95+
#if !defined (HSE_VALUE)
96+
#define HSE_VALUE (8000000U) /*!< Value of the External oscillator in Hz */
97+
#endif /* HSE_VALUE */
98+
99+
/**
100+
* @brief In the following line adjust the External High Speed oscillator (HSE) Startup
101+
* Timeout value
102+
*/
103+
#if !defined (HSE_STARTUP_TIMEOUT)
104+
#define HSE_STARTUP_TIMEOUT (100U) /*!< Time out for HSE start up, in ms */
105+
#endif /* HSE_STARTUP_TIMEOUT */
106+
107+
/**
108+
* @brief Internal High Speed oscillator (HSI) value.
109+
* This value is used by the RCC HAL module to compute the system frequency
110+
* (when HSI is used as system clock source, directly or through the PLL).
111+
*/
112+
#if !defined (HSI_VALUE)
113+
#define HSI_VALUE (8000000U) /*!< Value of the Internal oscillator in Hz*/
114+
#endif /* HSI_VALUE */
115+
116+
/**
117+
* @brief In the following line adjust the Internal High Speed oscillator (HSI) Startup
118+
* Timeout value
119+
*/
120+
#if !defined (HSI_STARTUP_TIMEOUT)
121+
#define HSI_STARTUP_TIMEOUT (5000U) /*!< Time out for HSI start up */
122+
#endif /* HSI_STARTUP_TIMEOUT */
123+
124+
/**
125+
* @brief Internal Low Speed oscillator (LSI) value.
126+
*/
127+
#if !defined (LSI_VALUE)
128+
#define LSI_VALUE (40000U)
129+
#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
130+
The real value may vary depending on the variations
131+
in voltage and temperature. */
132+
/**
133+
* @brief External Low Speed oscillator (LSE) value.
134+
*/
135+
#if !defined (LSE_VALUE)
136+
#define LSE_VALUE (32768U) /*!< Value of the External Low Speed oscillator in Hz */
137+
#endif /* LSE_VALUE */
138+
139+
/**
140+
* @brief Time out for LSE start up value in ms.
141+
*/
142+
#if !defined (LSE_STARTUP_TIMEOUT)
143+
#define LSE_STARTUP_TIMEOUT (5000U) /*!< Time out for LSE start up, in ms */
144+
#endif /* LSE_STARTUP_TIMEOUT */
145+
146+
/**
147+
* @brief External clock source for I2S peripheral
148+
* This value is used by the I2S HAL module to compute the I2S clock source
149+
* frequency, this source is inserted directly through I2S_CKIN pad.
150+
* - External clock generated through external PLL component on EVAL 303 (based on MCO or crystal)
151+
* - External clock not generated on EVAL 373
152+
*/
153+
#if !defined (EXTERNAL_CLOCK_VALUE)
154+
#define EXTERNAL_CLOCK_VALUE (8000000U) /*!< Value of the External oscillator in Hz*/
155+
#endif /* EXTERNAL_CLOCK_VALUE */
156+
157+
/* Tip: To avoid modifying this file each time you need to use different HSE,
158+
=== you can define the HSE value in your toolchain compiler preprocessor. */
159+
160+
/* ########################### System Configuration ######################### */
161+
/**
162+
* @brief This is the HAL system configuration section
163+
*/
164+
#define VDD_VALUE (3300U) /*!< Value of VDD in mv */
165+
#define TICK_INT_PRIORITY ((uint32_t)(1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority (lowest by default) */
166+
#define USE_RTOS 0U
167+
#define PREFETCH_ENABLE 1U
168+
#define INSTRUCTION_CACHE_ENABLE 0U
169+
#define DATA_CACHE_ENABLE 0U
170+
#define USE_SPI_CRC 1U
171+
172+
/* ########################## Assert Selection ############################## */
173+
/**
174+
* @brief Uncomment the line below to expanse the "assert_param" macro in the
175+
* HAL drivers code
176+
*/
177+
/*#define USE_FULL_ASSERT 1U*/
178+
179+
/* Includes ------------------------------------------------------------------*/
180+
/**
181+
* @brief Include module's header file
182+
*/
183+
184+
#ifdef HAL_RCC_MODULE_ENABLED
185+
#include "stm32f3xx_hal_rcc.h"
186+
#endif /* HAL_RCC_MODULE_ENABLED */
187+
188+
#ifdef HAL_GPIO_MODULE_ENABLED
189+
#include "stm32f3xx_hal_gpio.h"
190+
#endif /* HAL_GPIO_MODULE_ENABLED */
191+
192+
#ifdef HAL_DMA_MODULE_ENABLED
193+
#include "stm32f3xx_hal_dma.h"
194+
#endif /* HAL_DMA_MODULE_ENABLED */
195+
196+
#ifdef HAL_CORTEX_MODULE_ENABLED
197+
#include "stm32f3xx_hal_cortex.h"
198+
#endif /* HAL_CORTEX_MODULE_ENABLED */
199+
200+
#ifdef HAL_ADC_MODULE_ENABLED
201+
#include "stm32f3xx_hal_adc.h"
202+
#endif /* HAL_ADC_MODULE_ENABLED */
203+
204+
#ifdef HAL_CAN_MODULE_ENABLED
205+
#include "stm32f3xx_hal_can.h"
206+
#endif /* HAL_CAN_MODULE_ENABLED */
207+
208+
#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
209+
#include "stm32f3xx_hal_can_legacy.h"
210+
#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
211+
212+
#ifdef HAL_CEC_MODULE_ENABLED
213+
#include "stm32f3xx_hal_cec.h"
214+
#endif /* HAL_CEC_MODULE_ENABLED */
215+
216+
#ifdef HAL_COMP_MODULE_ENABLED
217+
#include "stm32f3xx_hal_comp.h"
218+
#endif /* HAL_COMP_MODULE_ENABLED */
219+
220+
#ifdef HAL_CRC_MODULE_ENABLED
221+
#include "stm32f3xx_hal_crc.h"
222+
#endif /* HAL_CRC_MODULE_ENABLED */
223+
224+
#ifdef HAL_DAC_MODULE_ENABLED
225+
#include "stm32f3xx_hal_dac.h"
226+
#endif /* HAL_DAC_MODULE_ENABLED */
227+
228+
#ifdef HAL_FLASH_MODULE_ENABLED
229+
#include "stm32f3xx_hal_flash.h"
230+
#endif /* HAL_FLASH_MODULE_ENABLED */
231+
232+
#ifdef HAL_SRAM_MODULE_ENABLED
233+
#include "stm32f3xx_hal_sram.h"
234+
#endif /* HAL_SRAM_MODULE_ENABLED */
235+
236+
#ifdef HAL_NOR_MODULE_ENABLED
237+
#include "stm32f3xx_hal_nor.h"
238+
#endif /* HAL_NOR_MODULE_ENABLED */
239+
240+
#ifdef HAL_NAND_MODULE_ENABLED
241+
#include "stm32f3xx_hal_nand.h"
242+
#endif /* HAL_NAND_MODULE_ENABLED */
243+
244+
#ifdef HAL_PCCARD_MODULE_ENABLED
245+
#include "stm32f3xx_hal_pccard.h"
246+
#endif /* HAL_PCCARD_MODULE_ENABLED */
247+
248+
#ifdef HAL_HRTIM_MODULE_ENABLED
249+
#include "stm32f3xx_hal_hrtim.h"
250+
#endif /* HAL_HRTIM_MODULE_ENABLED */
251+
252+
#ifdef HAL_I2C_MODULE_ENABLED
253+
#include "stm32f3xx_hal_i2c.h"
254+
#endif /* HAL_I2C_MODULE_ENABLED */
255+
256+
#ifdef HAL_I2S_MODULE_ENABLED
257+
#include "stm32f3xx_hal_i2s.h"
258+
#endif /* HAL_I2S_MODULE_ENABLED */
259+
260+
#ifdef HAL_IRDA_MODULE_ENABLED
261+
#include "stm32f3xx_hal_irda.h"
262+
#endif /* HAL_IRDA_MODULE_ENABLED */
263+
264+
#ifdef HAL_IWDG_MODULE_ENABLED
265+
#include "stm32f3xx_hal_iwdg.h"
266+
#endif /* HAL_IWDG_MODULE_ENABLED */
267+
268+
#ifdef HAL_OPAMP_MODULE_ENABLED
269+
#include "stm32f3xx_hal_opamp.h"
270+
#endif /* HAL_OPAMP_MODULE_ENABLED */
271+
272+
#ifdef HAL_PCD_MODULE_ENABLED
273+
#include "stm32f3xx_hal_pcd.h"
274+
#endif /* HAL_PCD_MODULE_ENABLED */
275+
276+
#ifdef HAL_PWR_MODULE_ENABLED
277+
#include "stm32f3xx_hal_pwr.h"
278+
#endif /* HAL_PWR_MODULE_ENABLED */
279+
280+
#ifdef HAL_RTC_MODULE_ENABLED
281+
#include "stm32f3xx_hal_rtc.h"
282+
#endif /* HAL_RTC_MODULE_ENABLED */
283+
284+
#ifdef HAL_SDADC_MODULE_ENABLED
285+
#include "stm32f3xx_hal_sdadc.h"
286+
#endif /* HAL_SDADC_MODULE_ENABLED */
287+
288+
#ifdef HAL_SMARTCARD_MODULE_ENABLED
289+
#include "stm32f3xx_hal_smartcard.h"
290+
#endif /* HAL_SMARTCARD_MODULE_ENABLED */
291+
292+
#ifdef HAL_SMBUS_MODULE_ENABLED
293+
#include "stm32f3xx_hal_smbus.h"
294+
#endif /* HAL_SMBUS_MODULE_ENABLED */
295+
296+
#ifdef HAL_SPI_MODULE_ENABLED
297+
#include "stm32f3xx_hal_spi.h"
298+
#endif /* HAL_SPI_MODULE_ENABLED */
299+
300+
#ifdef HAL_TIM_MODULE_ENABLED
301+
#include "stm32f3xx_hal_tim.h"
302+
#endif /* HAL_TIM_MODULE_ENABLED */
303+
304+
#ifdef HAL_TSC_MODULE_ENABLED
305+
#include "stm32f3xx_hal_tsc.h"
306+
#endif /* HAL_TSC_MODULE_ENABLED */
307+
308+
#ifdef HAL_UART_MODULE_ENABLED
309+
#include "stm32f3xx_hal_uart.h"
310+
#endif /* HAL_UART_MODULE_ENABLED */
311+
312+
#ifdef HAL_USART_MODULE_ENABLED
313+
#include "stm32f3xx_hal_usart.h"
314+
#endif /* HAL_USART_MODULE_ENABLED */
315+
316+
#ifdef HAL_WWDG_MODULE_ENABLED
317+
#include "stm32f3xx_hal_wwdg.h"
318+
#endif /* HAL_WWDG_MODULE_ENABLED */
319+
320+
/* Exported macro ------------------------------------------------------------*/
321+
#ifdef USE_FULL_ASSERT
322+
/**
323+
* @brief The assert_param macro is used for function's parameters check.
324+
* @param expr If expr is false, it calls assert_failed function
325+
* which reports the name of the source file and the source
326+
* line number of the call that failed.
327+
* If expr is true, it returns no value.
328+
* @retval None
329+
*/
330+
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((char *)__FILE__, __LINE__))
331+
/* Exported functions ------------------------------------------------------- */
332+
void assert_failed(char *file, uint32_t line);
333+
#else
334+
#define assert_param(expr) ((void)0U)
335+
#endif /* USE_FULL_ASSERT */
336+
337+
#ifdef __cplusplus
338+
}
339+
#endif
340+
341+
#endif /* __STM32F3xx_HAL_CONF_H */
342+
343+
344+
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

‎variants/SPARKY_F303CC/variant.cpp

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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 "variant.h"
31+
32+
#ifdef __cplusplus
33+
extern "C" {
34+
#endif
35+
36+
// Pin number
37+
const PinName digitalPin[] = {
38+
PB_9, //D0 - CAN_TX
39+
PB_8, //D1 - CAN_RX
40+
PB_7, //D2 - UART1_RX or I2C1_SDC
41+
PB_6, //D3 - UART1_TX or I2C1_SCL
42+
PB_5, //D4 - LED_RED
43+
PB_4, //D5 - LED_BLUE
44+
PB_3, //D6
45+
PA_15, //D7
46+
PA_12, //D8 - USB_DP
47+
PA_11, //D9 - USB_DM
48+
PA_10, //D10 - SDA MPU-9150
49+
PA_9, //D11 - SCL MPU-9150
50+
PA_8, //D12
51+
PB_15, //D13
52+
PB_14, //D14
53+
PB_13, //D15
54+
PB_12, //D16
55+
PC_13, //D17 - LED on Bluepill Board
56+
PC_14, //D18
57+
PC_15, //D19
58+
PA_0, //D20/A0
59+
PA_1, //D21/A1
60+
PA_2, //D22/A2
61+
PA_3, //D23/A3 - RCX
62+
PA_4, //D24/A4
63+
PA_5, //D25/A5
64+
PA_6, //D26/A6
65+
PA_7, //D27/A7
66+
PB_0, //D28/A8
67+
PB_1, //D29/A9
68+
PB_10, //D30 - UART3_TX
69+
PB_11, //D31 - UART3_RX
70+
PB_2, //D32 - BOOT1
71+
PA_13, //D33 - SWDI0
72+
PA_14, //D34 - SWCLK
73+
};
74+
75+
#ifdef __cplusplus
76+
}
77+
#endif
78+
79+
// ----------------------------------------------------------------------------
80+
81+
#ifdef __cplusplus
82+
extern "C" {
83+
#endif
84+
85+
WEAK void SystemClock_Config(void)
86+
{
87+
88+
RCC_OscInitTypeDef RCC_OscInitStruct;
89+
RCC_ClkInitTypeDef RCC_ClkInitStruct;
90+
RCC_PeriphCLKInitTypeDef PeriphClkInit;
91+
92+
/**Initializes the CPU, AHB and APB busses clocks
93+
*/
94+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI | RCC_OSCILLATORTYPE_HSE;
95+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
96+
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
97+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
98+
RCC_OscInitStruct.HSICalibrationValue = 16;
99+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
100+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
101+
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
102+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
103+
_Error_Handler(__FILE__, __LINE__);
104+
}
105+
106+
/**Initializes the CPU, AHB and APB busses clocks
107+
*/
108+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
109+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
110+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
111+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
112+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
113+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
114+
115+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
116+
_Error_Handler(__FILE__, __LINE__);
117+
}
118+
119+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USART1 | RCC_PERIPHCLK_USART3
120+
| RCC_PERIPHCLK_I2C1;
121+
PeriphClkInit.Usart1ClockSelection = RCC_USART1CLKSOURCE_PCLK2;
122+
PeriphClkInit.Usart3ClockSelection = RCC_USART3CLKSOURCE_PCLK1;
123+
PeriphClkInit.I2c1ClockSelection = RCC_I2C1CLKSOURCE_HSI;
124+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
125+
_Error_Handler(__FILE__, __LINE__);
126+
}
127+
128+
/**Configure the Systick interrupt time
129+
*/
130+
HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq() / 1000);
131+
132+
/**Configure the Systick
133+
*/
134+
HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK);
135+
136+
/* SysTick_IRQn interrupt configuration */
137+
HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
138+
139+
}
140+
141+
#ifdef __cplusplus
142+
}
143+
#endif

‎variants/SPARKY_F303CC/variant.h

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
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+
/*----------------------------------------------------------------------------
34+
* Headers
35+
*----------------------------------------------------------------------------*/
36+
#include "PeripheralPins.h"
37+
38+
#ifdef __cplusplus
39+
extern "C" {
40+
#endif // __cplusplus
41+
42+
/*----------------------------------------------------------------------------
43+
* Pins
44+
*----------------------------------------------------------------------------*/
45+
extern const PinName digitalPin[];
46+
47+
// USB connector on the top, MCU side
48+
// Left Side
49+
#define PB9 0 // CAN_TX
50+
#define PB8 1 // CAN_RX
51+
#define PB7 2 // UART1_RX or I2C1_SDC
52+
#define PB6 3 // UART1_TX or I2C1_SCL
53+
#define PB5 4 // LED_BLUE
54+
#define PB4 5 // LED_RED
55+
#define PB3 6
56+
#define PA15 7
57+
#define PA12 8 // USB_DP
58+
#define PA11 9 // USB_DM
59+
#define PA10 10 // SDA MPU-9150
60+
#define PA9 11 // SCL MPU-9150
61+
#define PA8 12
62+
#define PB15 13
63+
#define PB14 14
64+
#define PB13 15
65+
#define PB12 16
66+
// Right side
67+
#define PC13 17 // LED on Bluepill Board
68+
#define PC14 18
69+
#define PC15 19
70+
#define PA0 20 // A0
71+
#define PA1 21 // A1
72+
#define PA2 22 // A2
73+
#define PA3 23 // A3 - RCX
74+
#define PA4 24 // A4
75+
#define PA5 25 // A5
76+
#define PA6 26 // A6
77+
#define PA7 27 // A7
78+
#define PB0 28 // A8
79+
#define PB1 29 // A9
80+
#define PB10 30 // UART3_TX
81+
#define PB11 31 // UART3_RX
82+
// Other
83+
#define PB2 32 // BOOT1
84+
#define PA13 33 // SWDI0
85+
#define PA14 34 // SWCLK
86+
87+
// This must be a literal
88+
#define NUM_DIGITAL_PINS 35
89+
// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS
90+
#define NUM_ANALOG_INPUTS 10
91+
#define NUM_ANALOG_FIRST 20
92+
93+
// On-board LED pin number
94+
#define LED_RED PB4
95+
#define LED_BLUE PB5
96+
#define LED_BUILTIN LED_BLUE
97+
98+
// SPI Definitions
99+
#define PIN_SPI_SS PA4
100+
#define PIN_SPI_MOSI PA7
101+
#define PIN_SPI_MISO PA6
102+
#define PIN_SPI_SCK PA5
103+
104+
// I2C Definitions
105+
#define PIN_WIRE_SDA PA10
106+
#define PIN_WIRE_SCL PA9
107+
108+
// Timer Definitions
109+
// Do not use timer used by PWM pins when possible. See PinMap_PWM.
110+
#define TIMER_TONE TIM6
111+
112+
// Do not use basic timer: OC is required
113+
#define TIMER_SERVO TIM2 //TODO: advanced-control timers don't work
114+
115+
// UART Definitions
116+
#define SERIAL_UART_INSTANCE 3
117+
// Default pin used for 'Serial' instance
118+
// Mandatory for Firmata
119+
#define PIN_SERIAL_RX PB11
120+
#define PIN_SERIAL_TX PB10
121+
122+
#ifdef __cplusplus
123+
} // extern "C"
124+
#endif
125+
/*----------------------------------------------------------------------------
126+
* Arduino objects - C++ only
127+
*----------------------------------------------------------------------------*/
128+
129+
#ifdef __cplusplus
130+
// These serial port names are intended to allow libraries and architecture-neutral
131+
// sketches to automatically default to the correct port name for a particular type
132+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
133+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
134+
//
135+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
136+
//
137+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
138+
//
139+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
140+
//
141+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
142+
//
143+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
144+
// pins are NOT connected to anything by default.
145+
#define SERIAL_PORT_MONITOR Serial
146+
#define SERIAL_PORT_HARDWARE Serial3
147+
#endif
148+
149+
#endif /* _VARIANT_ARDUINO_STM32_ */

0 commit comments

Comments
 (0)
Please sign in to comment.