Skip to content

Commit

Permalink
Support new board NUCLEO_L552ZE-Q
Browse files Browse the repository at this point in the history
Signed-off-by: Francois Ramu <francois.ramu@st.com>
  • Loading branch information
FRASTM committed Dec 9, 2020
1 parent 433a0a6 commit b013d99
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions cores/arduino/stm32/backup.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static inline void setBackupRegister(uint32_t index, uint32_t value)
LL_RTC_BKP_SetRegister(BKP, index, value);
#elif defined(STM32G0xx)
LL_RTC_BKP_SetRegister(TAMP, index, value);
#elif defined(STM32G4xx)
#elif defined(STM32G4xx) || defined(STM32L5xx)
LL_RTC_BKP_SetRegister(RTC, index, value);
#else
#ifdef ENABLE_BACKUP_SUPPORT
Expand All @@ -143,7 +143,7 @@ static inline uint32_t getBackupRegister(uint32_t index)
return LL_RTC_BKP_GetRegister(BKP, index);
#elif defined(STM32G0xx)
return LL_RTC_BKP_GetRegister(TAMP, index);
#elif defined(STM32G4xx)
#elif defined(STM32G4xx) || defined(STM32L5xx)
return LL_RTC_BKP_GetRegister(RTC, index);
#else
#ifdef ENABLE_BACKUP_SUPPORT
Expand Down
2 changes: 2 additions & 0 deletions cores/arduino/stm32/stm32_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
#include "stm32l1xx.h"
#elif defined(STM32L4xx)
#include "stm32l4xx.h"
#elif defined(STM32L5xx)
#include "stm32l5xx.h"
#elif defined(STM32MP1xx)
#include "stm32mp1xx.h"
#elif defined(STM32WBxx)
Expand Down
15 changes: 11 additions & 4 deletions cores/arduino/stm32/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ extern "C" {
#endif

#if defined(TIM1_BASE) && !defined(TIM1_IRQn)
#if defined(STM32F0xx) || defined(STM32G0xx)
#if defined(STM32L5xx)
#define TIM1_IRQn TIM1_UP_IRQn
#define TIM1_IRQHandler TIM1_UP_IRQHandler
#elif defined(STM32F0xx) || defined(STM32G0xx)
#define TIM1_IRQn TIM1_BRK_UP_TRG_COM_IRQn
#define TIM1_IRQHandler TIM1_BRK_UP_TRG_COM_IRQHandler
#elif defined(STM32F1xx) ||defined(STM32G4xx)
Expand All @@ -63,17 +66,19 @@ extern "C" {
#define TIM1_IRQHandler TIM1_UP_IRQHandler
#endif
#endif

#if defined(TIM6_BASE) && !defined(TIM6_IRQn)
#if defined(DAC_BASE) || defined(DAC1_BASE)
#if defined(STM32G0xx)
#define TIM6_IRQn TIM6_DAC_LPTIM1_IRQn
#define TIM6_IRQHandler TIM6_DAC_LPTIM1_IRQHandler
#elif !defined(STM32F1xx) && !defined(STM32L1xx) && !defined(STM32MP1xx)
#elif !defined(STM32F1xx) && !defined(STM32L1xx) && !defined(STM32L5xx) && !defined(STM32MP1xx)
#define TIM6_IRQn TIM6_DAC_IRQn
#define TIM6_IRQHandler TIM6_DAC_IRQHandler
#define TIM6_IRQHandler TIM2_DAC_IRQHandler
#endif
#endif
#endif

#if defined(TIM7_BASE) && !defined(TIM7_IRQn)
#if defined(STM32G0xx) && defined(LPTIM2_BASE)
#define TIM7_IRQn TIM7_LPTIM2_IRQn
Expand All @@ -89,11 +94,13 @@ extern "C" {
|| defined(STM32H7xx)
#define TIM8_IRQn TIM8_UP_TIM13_IRQn
#define TIM8_IRQHandler TIM8_UP_TIM13_IRQHandler
#elif defined(STM32F3xx) || defined(STM32G4xx) || defined(STM32L4xx) || defined(STM32MP1xx)
#elif defined(STM32F3xx) || defined(STM32G4xx) || defined(STM32L4xx)\
|| defined(STM32L5xx) || defined(STM32MP1xx)
#define TIM8_IRQn TIM8_UP_IRQn
#define TIM8_IRQHandler TIM8_UP_IRQHandler
#endif
#endif

#if defined(TIM9_BASE) && !defined(TIM9_IRQn)
#if defined(STM32F1xx) || defined(STM32F2xx) ||defined(STM32F4xx) || defined(STM32F7xx)
#define TIM9_IRQn TIM1_BRK_TIM9_IRQn
Expand Down
6 changes: 3 additions & 3 deletions libraries/SrcWrapper/src/stm32/analog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,8 +842,8 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)
#endif
#if !defined(STM32F1xx) && !defined(STM32F2xx) && !defined(STM32F3xx) && \
!defined(STM32F4xx) && !defined(STM32F7xx) && !defined(STM32G4xx) && \
!defined(STM32H7xx) && !defined(STM32L4xx) && !defined(STM32MP1xx) && \
!defined(STM32WBxx)
!defined(STM32H7xx) && !defined(STM32L4xx) && !defined(STM32L5xx) && \
!defined(STM32MP1xx) && !defined(STM32WBxx)
AdcHandle.Init.LowPowerAutoPowerOff = DISABLE; /* ADC automatically powers-off after a conversion and automatically wakes-up when a new conversion is triggered */
#endif
#ifdef ADC_CHANNELS_BANK_A
Expand Down Expand Up @@ -913,7 +913,7 @@ uint16_t adc_read_value(PinName pin, uint32_t resolution)

AdcChannelConf.Channel = channel; /* Specifies the channel to configure into ADC */

#if defined(STM32L4xx) || defined(STM32WBxx)
#if defined(STM32L4xx) || defined(STM32L5xx) || defined(STM32WBxx)
if (!IS_ADC_CHANNEL(&AdcHandle, AdcChannelConf.Channel)) {
#elif defined(STM32G4xx)
if (!IS_ADC_CHANNEL(&AdcHandle, AdcChannelConf.Channel)) {
Expand Down
2 changes: 1 addition & 1 deletion libraries/SrcWrapper/src/stm32/interrupt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static gpio_irq_conf_str gpio_irq_conf[NB_EXTI] = {
{.irqnb = EXTI4_15_IRQn, .callback = NULL}, //GPIO_PIN_13
{.irqnb = EXTI4_15_IRQn, .callback = NULL}, //GPIO_PIN_14
{.irqnb = EXTI4_15_IRQn, .callback = NULL} //GPIO_PIN_15
#elif defined (STM32MP1xx)
#elif defined (STM32MP1xx) || defined (STM32L5xx)
{.irqnb = EXTI0_IRQn, .callback = NULL}, //GPIO_PIN_0
{.irqnb = EXTI1_IRQn, .callback = NULL}, //GPIO_PIN_1
{.irqnb = EXTI2_IRQn, .callback = NULL}, //GPIO_PIN_2
Expand Down
3 changes: 3 additions & 0 deletions libraries/SrcWrapper/src/stm32/system_stm32yyxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
#ifdef STM32L4xx
#include "system_stm32l4xx.c"
#endif
#ifdef STM32L5xx
#include "system_stm32l5xx.c"
#endif
#ifdef STM32MP1xx
#include "system_stm32mp1xx.c"
#endif
Expand Down

0 comments on commit b013d99

Please sign in to comment.