Skip to content

Commit 58a1c20

Browse files
committed
Update for STM32L072KZTx chip.
Use PYn notation, instead of arduino pin numbers.
1 parent 3e35854 commit 58a1c20

File tree

4 files changed

+23
-19
lines changed

4 files changed

+23
-19
lines changed

variants/THUNDER_PACK/PeripheralPins.c

+7-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* opensource.org/licenses/BSD-3-Clause
1010
*
1111
*******************************************************************************
12-
* Automatically generated from STM32L072C(B-Z)Tx.xml
12+
* Automatically generated from STM32L072K(B-Z)Tx.xml
1313
*/
1414
#include "Arduino.h"
1515
#include "PeripheralPins.h"
@@ -57,7 +57,6 @@ WEAK const PinMap PinMap_I2C_SCL[] = {
5757
{PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF7_I2C3)},
5858
{PA_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF6_I2C1)},
5959
{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF1_I2C1)},
60-
{PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},
6160
{NC, NP, 0}
6261
};
6362
#endif
@@ -77,6 +76,8 @@ WEAK const PinMap PinMap_PWM[] = {
7776
// {PA_6, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 1, 0)}, // TIM22_CH1
7877
{PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2
7978
// {PA_7, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_TIM22, 2, 0)}, // TIM22_CH2
79+
{PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM3, 2, 0)}, // TIM3_CH2
80+
// {PB_5, TIM22, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_TIM22, 2, 0)}, // TIM22_CH2
8081
{NC, NP, 0}
8182
};
8283
#endif
@@ -121,6 +122,7 @@ WEAK const PinMap PinMap_UART_CTS[] = {
121122
#ifdef HAL_SPI_MODULE_ENABLED
122123
WEAK const PinMap PinMap_SPI_MOSI[] = {
123124
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
125+
{PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_SPI1)},
124126
{NC, NP, 0}
125127
};
126128
#endif
@@ -165,4 +167,6 @@ WEAK const PinMap PinMap_USB[] = {
165167

166168
//*** No USB_OTG_FS ***
167169

168-
//*** No USB_OTG_HS ***
170+
//*** No USB_OTG_HS ***
171+
172+
//*** No SD ***

variants/THUNDER_PACK/PinNamesVar.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* SYS_WKUP */
22
#ifdef PWR_WAKEUP_PIN1
3-
SYS_WKUP1 = PA_0,
3+
SYS_WKUP1 = NC,
44
#endif
55
#ifdef PWR_WAKEUP_PIN2
6-
SYS_WKUP2 = PC_13,
6+
SYS_WKUP2 = NC,
77
#endif
88
#ifdef PWR_WAKEUP_PIN3
99
SYS_WKUP3 = NC,

variants/THUNDER_PACK/variant.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ extern "C" {
7676
*/
7777
WEAK void SystemClock_Config(void)
7878
{
79-
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
80-
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
81-
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
79+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
80+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
81+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
8282

8383
/** Configure the main internal regulator output voltage
8484
*/

variants/THUNDER_PACK/variant.h

+11-11
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ extern "C" {
3939
* Pins
4040
*----------------------------------------------------------------------------*/
4141

42-
#define PA0 0
43-
#define PA1 1
44-
#define PA2 2
45-
#define PA3 3
42+
#define PA0 0 // LED 1
43+
#define PA1 1 // LED 2
44+
#define PA2 2 // LED 3
45+
#define PA3 3 // LED 4
4646
#define PA4 4 // A0
4747
#define PA5 5 // A1
4848
#define PA6 6 // A2
@@ -68,12 +68,12 @@ extern "C" {
6868
#define NUM_ANALOG_FIRST 4
6969

7070
// On-board LED pin number
71-
#define LED_BUILTIN 0
71+
#define LED_BUILTIN PA0
7272
#define LED_GREEN LED_BUILTIN
73-
#define LED_1 0
74-
#define LED_2 1
75-
#define LED_3 2
76-
#define LED_4 3
73+
#define LED_1 PA0
74+
#define LED_2 PA1
75+
#define LED_3 PA2
76+
#define LED_4 PA3
7777

7878
// On-board user button
7979
#define USER_BTN PB4
@@ -88,8 +88,8 @@ extern "C" {
8888

8989
// Default pin used for 'Serial' instance (ex: ST-Link)
9090
// Mandatory for Firmata
91-
#define PIN_SERIAL_RX 12
92-
#define PIN_SERIAL_TX 11
91+
#define PIN_SERIAL_RX PB7
92+
#define PIN_SERIAL_TX PB6
9393

9494
/* Extra HAL modules */
9595
#define HAL_DAC_MODULE_ENABLED

0 commit comments

Comments
 (0)