Skip to content

Commit 38a78cb

Browse files
marwaiehm-sterwango
authored andcommitted
stm32cube: update stm32wba to cube version V1.6.0
Update Cube version for STM32WBAxx series on https://github.com/STMicroelectronics from version v1.5.0 to version v1.6.0 Signed-off-by: IBEN EL HADJ MESSAOUD Marwa <[email protected]>
1 parent 81544bf commit 38a78cb

File tree

86 files changed

+92876
-104
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+92876
-104
lines changed

stm32cube/stm32wbaxx/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,16 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_FLASH_EX drivers/src/stm32wbax
2222
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_GPIO drivers/src/stm32wbaxx_hal_gpio.c)
2323
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_GTZC drivers/src/stm32wbaxx_hal_gtzc.c)
2424
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_HASH drivers/src/stm32wbaxx_hal_hash.c)
25+
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_HCD drivers/src/stm32wbaxx_hal_hcd.c)
2526
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_HSEM drivers/src/stm32wbaxx_hal_hsem.c)
2627
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_I2C drivers/src/stm32wbaxx_hal_i2c.c)
2728
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_I2C_EX drivers/src/stm32wbaxx_hal_i2c_ex.c)
2829
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_ICACHE drivers/src/stm32wbaxx_hal_icache.c)
2930
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_IRDA drivers/src/stm32wbaxx_hal_irda.c)
3031
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_IWDG drivers/src/stm32wbaxx_hal_iwdg.c)
3132
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_LPTIM drivers/src/stm32wbaxx_hal_lptim.c)
33+
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PCD drivers/src/stm32wbaxx_hal_pcd.c)
34+
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PCD_EX drivers/src/stm32wbaxx_hal_pcd_ex.c)
3235
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PKA drivers/src/stm32wbaxx_hal_pka.c)
3336
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PWR drivers/src/stm32wbaxx_hal_pwr.c)
3437
zephyr_library_sources_ifdef(CONFIG_USE_STM32_HAL_PWR_EX drivers/src/stm32wbaxx_hal_pwr_ex.c)
@@ -71,4 +74,5 @@ zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_RTC drivers/src/stm32wbaxx_ll_r
7174
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_SPI drivers/src/stm32wbaxx_ll_spi.c)
7275
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_TIM drivers/src/stm32wbaxx_ll_tim.c)
7376
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_USART drivers/src/stm32wbaxx_ll_usart.c)
77+
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_USB drivers/src/stm32wbaxx_ll_usb.c)
7478
zephyr_library_sources_ifdef(CONFIG_USE_STM32_LL_UTILS drivers/src/stm32wbaxx_ll_utils.c)

stm32cube/stm32wbaxx/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Origin:
66
http://www.st.com/en/embedded-software/stm32cubewba.html
77

88
Status:
9-
version v1.5.0
9+
version v1.6.0
1010

1111
Purpose:
1212
ST Microelectronics official MCU package for STM32WBA series.
@@ -23,7 +23,7 @@ URL:
2323
https://github.com/STMicroelectronics/STM32CubeWBA
2424

2525
Commit:
26-
06402010bb3e1eb4d49ee22cbe45d3408ce413c5
26+
e7d27c496416aae8f4ba8b3e84f963f0c5a0b69f
2727

2828
Maintained-by:
2929
External

stm32cube/stm32wbaxx/drivers/include/Legacy/stm32_hal_legacy.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,9 @@ extern "C" {
472472
#define TYPEPROGRAMDATA_FASTBYTE FLASH_TYPEPROGRAMDATA_FASTBYTE
473473
#define TYPEPROGRAMDATA_FASTHALFWORD FLASH_TYPEPROGRAMDATA_FASTHALFWORD
474474
#define TYPEPROGRAMDATA_FASTWORD FLASH_TYPEPROGRAMDATA_FASTWORD
475+
#if !defined(STM32F2) && !defined(STM32F4) && !defined(STM32F7) && !defined(STM32H7) && !defined(STM32H5)
475476
/* #define PAGESIZE FLASH_PAGE_SIZE */
477+
#endif /* STM32F2 && STM32F4 && STM32F7 && STM32H7 && STM32H5 */
476478
#define TYPEPROGRAM_FASTBYTE FLASH_TYPEPROGRAM_BYTE
477479
#define TYPEPROGRAM_FASTHALFWORD FLASH_TYPEPROGRAM_HALFWORD
478480
#define TYPEPROGRAM_FASTWORD FLASH_TYPEPROGRAM_WORD
@@ -536,6 +538,10 @@ extern "C" {
536538
#define FLASH_FLAG_WDW FLASH_FLAG_WBNE
537539
#define OB_WRP_SECTOR_All OB_WRP_SECTOR_ALL
538540
#endif /* STM32H7 */
541+
#if defined(STM32H7RS)
542+
#define FLASH_OPTKEY1 FLASH_OPT_KEY1
543+
#define FLASH_OPTKEY2 FLASH_OPT_KEY2
544+
#endif /* STM32H7RS */
539545
#if defined(STM32U5)
540546
#define OB_USER_nRST_STOP OB_USER_NRST_STOP
541547
#define OB_USER_nRST_STDBY OB_USER_NRST_STDBY
@@ -1297,22 +1303,22 @@ extern "C" {
12971303
#define TAMP_SECRETDEVICE_ERASE_ENABLE TAMP_SECRETDEVICE_ERASE_ALL
12981304
#endif /* STM32H5 || STM32WBA || STM32H7RS */
12991305

1300-
#if defined(STM32F7)
1306+
#if defined(STM32F7) || defined(STM32WB)
13011307
#define RTC_TAMPCR_TAMPXE RTC_TAMPER_ENABLE_BITS_MASK
13021308
#define RTC_TAMPCR_TAMPXIE RTC_TAMPER_IT_ENABLE_BITS_MASK
1303-
#endif /* STM32F7 */
1309+
#endif /* STM32F7 || STM32WB */
13041310

13051311
#if defined(STM32H7)
13061312
#define RTC_TAMPCR_TAMPXE RTC_TAMPER_X
13071313
#define RTC_TAMPCR_TAMPXIE RTC_TAMPER_X_INTERRUPT
13081314
#endif /* STM32H7 */
13091315

1310-
#if defined(STM32F7) || defined(STM32H7) || defined(STM32L0)
1316+
#if defined(STM32F7) || defined(STM32H7) || defined(STM32L0) || defined(STM32WB)
13111317
#define RTC_TAMPER1_INTERRUPT RTC_IT_TAMP1
13121318
#define RTC_TAMPER2_INTERRUPT RTC_IT_TAMP2
13131319
#define RTC_TAMPER3_INTERRUPT RTC_IT_TAMP3
13141320
#define RTC_ALL_TAMPER_INTERRUPT RTC_IT_TAMP
1315-
#endif /* STM32F7 || STM32H7 || STM32L0 */
1321+
#endif /* STM32F7 || STM32H7 || STM32L0 || STM32WB */
13161322

13171323
/**
13181324
* @}

stm32cube/stm32wbaxx/drivers/include/stm32wbaxx_hal.h

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ extern HAL_TickFreqTypeDef uwTickFreq;
7979
* @brief STM32WBAxx HAL Driver version number
8080
*/
8181
#define __STM32WBAxx_HAL_VERSION_MAIN (0x01U) /*!< [31:24] main version */
82-
#define __STM32WBAxx_HAL_VERSION_SUB1 (0x05U) /*!< [23:16] sub1 version */
82+
#define __STM32WBAxx_HAL_VERSION_SUB1 (0x06U) /*!< [23:16] sub1 version */
8383
#define __STM32WBAxx_HAL_VERSION_SUB2 (0x00U) /*!< [15:8] sub2 version */
8484
#define __STM32WBAxx_HAL_VERSION_RC (0x00U) /*!< [7:0] release candidate */
8585
#define __STM32WBAxx_HAL_VERSION ((__STM32WBAxx_HAL_VERSION_MAIN << 24U)\
@@ -150,6 +150,27 @@ extern HAL_TickFreqTypeDef uwTickFreq;
150150
* @}
151151
*/
152152

153+
#if defined(VREFBUF)
154+
/** @defgroup SYSCFG_VREFBUF_VoltageScale VREFBUF Voltage Scale
155+
* @{
156+
*/
157+
#define SYSCFG_VREFBUF_VOLTAGE_SCALE0 VREFBUF_CSR_VRS_OUT1 /*!< Voltage reference scale 0 (VREF_OUT1) */
158+
#define SYSCFG_VREFBUF_VOLTAGE_SCALE1 VREFBUF_CSR_VRS_OUT2 /*!< Voltage reference scale 1 (VREF_OUT2) */
159+
#define SYSCFG_VREFBUF_VOLTAGE_SCALE2 VREFBUF_CSR_VRS_OUT3 /*!< Voltage reference scale 2 (VREF_OUT3) */
160+
#define SYSCFG_VREFBUF_VOLTAGE_SCALE3 VREFBUF_CSR_VRS_OUT4 /*!< Voltage reference scale 3 (VREF_OUT4) */
161+
/**
162+
* @}
163+
*/
164+
165+
/** @defgroup SYSCFG_VREFBUF_HighImpedance VREFBUF High Impedance
166+
* @{
167+
*/
168+
#define SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE 0x00000000U /*!< VREF_plus pin is internally connected to Voltage reference buffer output */
169+
#define SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE VREFBUF_CSR_HIZ /*!< VREF_plus pin is high impedance */
170+
/**
171+
* @}
172+
*/
173+
#endif /* VREFBUF */
153174

154175
/** @defgroup SYSCFG_Flags_Definition Flags
155176
* @{
@@ -524,6 +545,17 @@ extern HAL_TickFreqTypeDef uwTickFreq;
524545
((__CONFIG__) == SYSCFG_BREAK_SRAM2_PARITY) || \
525546
((__CONFIG__) == SYSCFG_BREAK_LOCKUP))
526547

548+
#if defined(VREFBUF)
549+
#define IS_SYSCFG_VREFBUF_VOLTAGE_SCALE(__SCALE__) (((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE0) || \
550+
((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE1) || \
551+
((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE2) || \
552+
((__SCALE__) == SYSCFG_VREFBUF_VOLTAGE_SCALE3))
553+
554+
#define IS_SYSCFG_VREFBUF_HIGH_IMPEDANCE(__VALUE__) (((__VALUE__) == SYSCFG_VREFBUF_HIGH_IMPEDANCE_DISABLE) || \
555+
((__VALUE__) == SYSCFG_VREFBUF_HIGH_IMPEDANCE_ENABLE))
556+
557+
#define IS_SYSCFG_VREFBUF_TRIMMING(__VALUE__) (((__VALUE__) > 0U) && ((__VALUE__) <= VREFBUF_CCR_TRIM))
558+
#endif /* VREFBUF */
527559

528560
#define IS_SYSCFG_FASTMODEPLUS(__PIN__) ((((__PIN__) & SYSCFG_FASTMODEPLUS_ALL) != 0x00U) && \
529561
(((__PIN__) & ~SYSCFG_FASTMODEPLUS_ALL) == 0x00U))
@@ -646,6 +678,13 @@ void HAL_SYSCFG_DisableIOAnalogSwitchBooster(void);
646678
void HAL_SYSCFG_EnableIOAnalogSwitchVdd(void);
647679
void HAL_SYSCFG_DisableIOAnalogSwitchVdd(void);
648680

681+
#ifdef VREFBUF
682+
void HAL_SYSCFG_VREFBUF_VoltageScalingConfig(uint32_t VoltageScaling);
683+
void HAL_SYSCFG_VREFBUF_HighImpedanceConfig(uint32_t Mode);
684+
void HAL_SYSCFG_VREFBUF_TrimmingConfig(uint32_t TrimmingValue);
685+
HAL_StatusTypeDef HAL_SYSCFG_EnableVREFBUF(void);
686+
void HAL_SYSCFG_DisableVREFBUF(void);
687+
#endif /* VREFBUF */
649688

650689
#ifdef SYSCFG_OTGHSPHYCR_EN
651690
void HAL_SYSCFG_SetOTGPHYReferenceClockSelection(uint32_t RefClockSelection);

stm32cube/stm32wbaxx/drivers/include/stm32wbaxx_hal_conf.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,14 @@ extern "C" {
4545
#define HAL_GPIO_MODULE_ENABLED
4646
#define HAL_GTZC_MODULE_ENABLED
4747
#define HAL_HASH_MODULE_ENABLED
48+
#define HAL_HCD_MODULE_ENABLED
4849
#define HAL_HSEM_MODULE_ENABLED
4950
#define HAL_I2C_MODULE_ENABLED
5051
#define HAL_ICACHE_MODULE_ENABLED
5152
#define HAL_IRDA_MODULE_ENABLED
5253
#define HAL_IWDG_MODULE_ENABLED
5354
#define HAL_LPTIM_MODULE_ENABLED
55+
#define HAL_PCD_MODULE_ENABLED
5456
#define HAL_PKA_MODULE_ENABLED
5557
#define HAL_PWR_MODULE_ENABLED
5658
#define HAL_RAMCFG_MODULE_ENABLED
@@ -159,10 +161,12 @@ extern "C" {
159161
#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */
160162
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */
161163
#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */
164+
#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
162165
#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
163166
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
164167
#define USE_HAL_IWDG_REGISTER_CALLBACKS 0U /* IWDG register callback disabled */
165168
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */
169+
#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
166170
#define USE_HAL_PKA_REGISTER_CALLBACKS 0U /* PKA register callback disabled */
167171
#define USE_HAL_RAMCFG_REGISTER_CALLBACKS 0U /* RAMCFG register callback disabled */
168172
#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */
@@ -241,6 +245,10 @@ extern "C" {
241245
#include "stm32wbaxx_hal_hash.h"
242246
#endif /* HAL_HASH_MODULE_ENABLED */
243247

248+
#ifdef HAL_HCD_MODULE_ENABLED
249+
#include "stm32wbaxx_hal_hcd.h"
250+
#endif /* HAL_HCD_MODULE_ENABLED */
251+
244252
#ifdef HAL_HSEM_MODULE_ENABLED
245253
#include "stm32wbaxx_hal_hsem.h"
246254
#endif /* HAL_HSEM_MODULE_ENABLED */
@@ -265,6 +273,10 @@ extern "C" {
265273
#include "stm32wbaxx_hal_lptim.h"
266274
#endif /* HAL_LPTIM_MODULE_ENABLED */
267275

276+
#ifdef HAL_PCD_MODULE_ENABLED
277+
#include "stm32wbaxx_hal_pcd.h"
278+
#endif /* HAL_PCD_MODULE_ENABLED */
279+
268280
#ifdef HAL_PKA_MODULE_ENABLED
269281
#include "stm32wbaxx_hal_pka.h"
270282
#endif /* HAL_PKA_MODULE_ENABLED */

stm32cube/stm32wbaxx/drivers/include/stm32wbaxx_hal_dma.h

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,48 @@ typedef struct __DMA_HandleTypeDef
250250
* @brief DMA Request Selection
251251
* @{
252252
*/
253+
#if defined (LPDMA1)
254+
/* LPDMA1 requests */
255+
#define LPDMA1_REQUEST_ADC4 0U /*!< LPDMA1 HW request is ADC4 */
256+
257+
#define LPDMA1_REQUEST_SPI3_RX 3U /*!< LPDMA1 HW request is SPI3_RX */
258+
#define LPDMA1_REQUEST_SPI3_TX 4U /*!< LPDMA1 HW request is SPI3_TX */
259+
#define LPDMA1_REQUEST_I2C1_RX 5U /*!< LPDMA1 HW request is I2C1_RX */
260+
#define LPDMA1_REQUEST_I2C1_TX 6U /*!< LPDMA1 HW request is I2C1_TX */
261+
#define LPDMA1_REQUEST_I2C1_EVC 7U /*!< LPDMA1 HW request is I2C1_EVC */
262+
#define LPDMA1_REQUEST_I2C3_RX 8U /*!< LPDMA1 HW request is I2C3_RX */
263+
#define LPDMA1_REQUEST_I2C3_TX 9U /*!< LPDMA1 HW request is I2C3_TX */
264+
#define LPDMA1_REQUEST_I2C3_EVC 10U /*!< LPDMA1 HW request is I2C3_EVC */
265+
#define LPDMA1_REQUEST_USART1_RX 11U /*!< LPDMA1 HW request is USART1_RX */
266+
#define LPDMA1_REQUEST_USART1_TX 12U /*!< LPDMA1 HW request is USART1_TX */
267+
268+
#define LPDMA1_REQUEST_LPUART1_RX 15U /*!< LPDMA1 HW request is LPUART1_RX */
269+
#define LPDMA1_REQUEST_LPUART1_TX 16U /*!< LPDMA1 HW request is LPUART1_TX */
270+
#define LPDMA1_REQUEST_SAI1_A 17U /*!< LPDMA1 HW request is SAI1_A */
271+
#define LPDMA1_REQUEST_SAI1_B 18U /*!< LPDMA1 HW request is SAI1_B */
272+
273+
#define LPDMA1_REQUEST_TIM2_CH1 26U /*!< LPDMA1 HW request is TIM2_CH1 */
274+
#define LPDMA1_REQUEST_TIM2_CH2 27U /*!< LPDMA1 HW request is TIM2_CH2 */
275+
#define LPDMA1_REQUEST_TIM2_CH3 28U /*!< LPDMA1 HW request is TIM2_CH3 */
276+
#define LPDMA1_REQUEST_TIM2_CH4 29U /*!< LPDMA1 HW request is TIM2_CH4 */
277+
#define LPDMA1_REQUEST_TIM2_UP 30U /*!< LPDMA1 HW request is TIM2_UP */
278+
#define LPDMA1_REQUEST_TIM16_CH1 31U /*!< LPDMA1 HW request is TIM16_CH1 */
279+
#define LPDMA1_REQUEST_TIM16_UP 32U /*!< LPDMA1 HW request is TIM16_UP */
280+
#define LPDMA1_REQUEST_TIM17_CH1 33U /*!< LPDMA1 HW request is TIM17_CH1 */
281+
#define LPDMA1_REQUEST_TIM17_UP 34U /*!< LPDMA1 HW request is TIM17_UP */
282+
283+
#define LPDMA1_REQUEST_AES_IN 35U /*!< LPDMA1 HW request is AES_IN */
284+
#define LPDMA1_REQUEST_AES_OUT 36U /*!< LPDMA1 HW request is AES_OUT */
285+
#define LPDMA1_REQUEST_HASH_IN 37U /*!< LPDMA1 HW request is HASH_IN */
286+
#define LPDMA1_REQUEST_LPTIM1_IC1 38U /*!< LPDMA1 HW request is LPTIM1_IC1 */
287+
#define LPDMA1_REQUEST_LPTIM1_IC2 39U /*!< LPDMA1 HW request is LPTIM1_IC2 */
288+
#define LPDMA1_REQUEST_LPTIM1_UE 40U /*!< LPDMA1 HW request is LPTIM1_UE */
289+
#define LPDMA1_REQUEST_LPTIM2_IC1 41U /*!< LPDMA1 HW request is LPTIM2_IC1 */
290+
#define LPDMA1_REQUEST_LPTIM2_IC2 42U /*!< LPDMA1 HW request is LPTIM2_IC2 */
291+
#define LPDMA1_REQUEST_LPTIM2_UE 46U /*!< LPDMA1 HW request is LPTIM2_UE */
292+
293+
#define LPDMA1_REQUEST_XSPI1 44U /*!< LPDMA1 HW request is XSPI1 */
294+
#else
253295
/* GPDMA1 requests */
254296
#define GPDMA1_REQUEST_ADC4 0U /*!< GPDMA1 HW request is ADC4 */
255297
#if defined (SPI1)
@@ -321,6 +363,32 @@ typedef struct __DMA_HandleTypeDef
321363
#define GPDMA1_REQUEST_LPTIM2_IC2 50U /*!< GPDMA1 HW request is LPTIM2_IC2 */
322364
#define GPDMA1_REQUEST_LPTIM2_UE 51U /*!< GPDMA1 HW request is LPTIM2_UE */
323365
#endif /* LPTIM2 */
366+
#if defined (SPI2)
367+
#define GPDMA1_REQUEST_SPI2_RX 52U /*!< GPDMA1 HW request is SPI2_RX */
368+
#define GPDMA1_REQUEST_SPI2_TX 53U /*!< GPDMA1 HW request is SPI2_TX */
369+
#endif /* SPI2 */
370+
#if defined (I2C2)
371+
#define GPDMA1_REQUEST_I2C2_RX 54U /*!< GPDMA1 HW request is I2C2_RX */
372+
#define GPDMA1_REQUEST_I2C2_TX 55U /*!< GPDMA1 HW request is I2C2_TX */
373+
#define GPDMA1_REQUEST_I2C2_EVC 56U /*!< GPDMA1 HW request is I2C2_EVC */
374+
#endif /* I2C2 */
375+
#if defined (I2C4)
376+
#define GPDMA1_REQUEST_I2C4_RX 57U /*!< GPDMA1 HW request is I2C4_RX */
377+
#define GPDMA1_REQUEST_I2C4_TX 58U /*!< GPDMA1 HW request is I2C4_TX */
378+
#define GPDMA1_REQUEST_I2C4_EVC 59U /*!< GPDMA1 HW request is I2C4_EVC */
379+
#endif /* I2C4 */
380+
#if defined (TIM4)
381+
#define GPDMA1_REQUEST_TIM4_CH1 60U /*!< GPDMA1 HW request is TIM4_CH1 */
382+
#define GPDMA1_REQUEST_TIM4_CH2 61U /*!< GPDMA1 HW request is TIM4_CH2 */
383+
#define GPDMA1_REQUEST_TIM4_CH3 62U /*!< GPDMA1 HW request is TIM4_CH3 */
384+
#define GPDMA1_REQUEST_TIM4_CH4 63U /*!< GPDMA1 HW request is TIM4_CH4 */
385+
#define GPDMA1_REQUEST_TIM4_UP 64U /*!< GPDMA1 HW request is TIM4_UP */
386+
#endif /* TIM4 */
387+
#if defined (USART3)
388+
#define GPDMA1_REQUEST_USART3_RX 65U /*!< GPDMA1 HW request is USART3_RX */
389+
#define GPDMA1_REQUEST_USART3_TX 66U /*!< GPDMA1 HW request is USART3_TX */
390+
#endif /* USART3 */
391+
#endif /* LPDMA1 */
324392

325393
/* Software request */
326394
#define DMA_REQUEST_SW DMA_CTR2_SWREQ /*!< DMA SW request */
@@ -342,9 +410,16 @@ typedef struct __DMA_HandleTypeDef
342410
* @brief DMA transfer direction
343411
* @{
344412
*/
413+
#if defined(GPDMA1)
345414
#define DMA_PERIPH_TO_MEMORY 0x00000000U /*!< Peripheral to memory direction */
346415
#define DMA_MEMORY_TO_PERIPH DMA_CTR2_DREQ /*!< Memory to peripheral direction */
347416
#define DMA_MEMORY_TO_MEMORY DMA_CTR2_SWREQ /*!< Memory to memory direction */
417+
#endif /* GPDMA1 */
418+
#if defined(LPDMA1)
419+
#define DMA_PERIPH_TO_MEMORY 0x00000000U /*!< Kept for porting purpose */
420+
#define DMA_MEMORY_TO_PERIPH DMA_PERIPH_TO_MEMORY /*!< Kept for porting purpose */
421+
#define DMA_MEMORY_TO_MEMORY DMA_CTR2_SWREQ /*!< Memory to memory direction */
422+
#endif /* LPDMA1 */
348423
/**
349424
* @}
350425
*/
@@ -408,10 +483,18 @@ typedef struct __DMA_HandleTypeDef
408483
* @brief DMA Transfer Allocated Port
409484
* @{
410485
*/
486+
#if defined(GPDMA1)
411487
#define DMA_SRC_ALLOCATED_PORT0 0x00000000U /*!< Source allocated Port 0 */
412488
#define DMA_SRC_ALLOCATED_PORT1 DMA_CTR1_SAP /*!< Source allocated Port 1 */
413489
#define DMA_DEST_ALLOCATED_PORT0 0x00000000U /*!< Destination allocated Port 0 */
414490
#define DMA_DEST_ALLOCATED_PORT1 DMA_CTR1_DAP /*!< Destination allocated Port 1 */
491+
#endif /* GPDMA1 */
492+
#if defined(LPDMA1)
493+
#define DMA_SRC_ALLOCATED_PORT0 0x00000000U /*!< Kept for porting purpose */
494+
#define DMA_SRC_ALLOCATED_PORT1 DMA_SRC_ALLOCATED_PORT0 /*!< Kept for porting purpose */
495+
#define DMA_DEST_ALLOCATED_PORT0 0x00000000U /*!< Kept for porting purpose */
496+
#define DMA_DEST_ALLOCATED_PORT1 DMA_DEST_ALLOCATED_PORT0 /*!< Kept for porting purpose */
497+
#endif /* LPDMA1 */
415498

416499
/**
417500
* @}
@@ -660,11 +743,11 @@ uint32_t HAL_DMA_GetError(DMA_HandleTypeDef const *const hdma);
660743
* @}
661744
*/
662745

746+
#if defined (DMA_PRIVCFGR_PRIV0)
663747
/** @defgroup DMA_Exported_Functions_Group4 DMA Attributes Functions
664748
* @brief DMA Attributes Functions
665749
* @{
666750
*/
667-
#if defined (DMA_PRIVCFGR_PRIV0)
668751
HAL_StatusTypeDef HAL_DMA_ConfigChannelAttributes(DMA_HandleTypeDef *const hdma,
669752
uint32_t ChannelAttributes);
670753
HAL_StatusTypeDef HAL_DMA_GetConfigChannelAttributes(DMA_HandleTypeDef const *const hdma,
@@ -677,10 +760,10 @@ HAL_StatusTypeDef HAL_DMA_GetLockChannelAttributes(DMA_HandleTypeDef const *cons
677760
uint32_t *const pLockState);
678761

679762
#endif /* DMA_RCFGLOCKR_LOCK0 */
680-
#endif /* DMA_PRIVCFGR_PRIV0 */
681763
/**
682764
* @}
683765
*/
766+
#endif /* DMA_PRIVCFGR_PRIV0 */
684767

685768
/**
686769
* @}
@@ -723,10 +806,17 @@ HAL_StatusTypeDef HAL_DMA_GetLockChannelAttributes(DMA_HandleTypeDef const *cons
723806
#define IS_DMA_MODE(MODE) \
724807
((MODE) == DMA_NORMAL)
725808

809+
#if defined(GPDMA1)
726810
#define IS_DMA_DIRECTION(DIRECTION) \
727811
(((DIRECTION) == DMA_PERIPH_TO_MEMORY) || \
728812
((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \
729813
((DIRECTION) == DMA_MEMORY_TO_MEMORY))
814+
#endif /* GPDMA1 */
815+
#if defined(LPDMA1)
816+
#define IS_DMA_DIRECTION(DIRECTION) \
817+
(((DIRECTION) == DMA_PERIPH_TO_MEMORY) || \
818+
((DIRECTION) == DMA_MEMORY_TO_MEMORY))
819+
#endif /* LPDMA1 */
730820

731821
#define IS_DMA_LEVEL_COMPLETE(LEVEL) \
732822
(((LEVEL) == HAL_DMA_FULL_TRANSFER) || \
@@ -763,6 +853,12 @@ HAL_StatusTypeDef HAL_DMA_GetLockChannelAttributes(DMA_HandleTypeDef const *cons
763853
#define IS_DMA_TRANSFER_ALLOCATED_PORT(ALLOCATED_PORT) \
764854
(((ALLOCATED_PORT) & (~(DMA_CTR1_SAP | DMA_CTR1_DAP))) == 0U)
765855

856+
#if defined (GPDMA1)
857+
#if defined (USART3)
858+
#define IS_DMA_REQUEST(REQUEST) \
859+
(((REQUEST) == DMA_REQUEST_SW) || \
860+
((REQUEST) <= GPDMA1_REQUEST_USART3_TX))
861+
#else
766862
#if defined (LPTIM2)
767863
#define IS_DMA_REQUEST(REQUEST) \
768864
(((REQUEST) == DMA_REQUEST_SW) || \
@@ -772,6 +868,13 @@ HAL_StatusTypeDef HAL_DMA_GetLockChannelAttributes(DMA_HandleTypeDef const *cons
772868
(((REQUEST) == DMA_REQUEST_SW) || \
773869
((REQUEST) <= GPDMA1_REQUEST_LPTIM1_UE))
774870
#endif /* LPTIM2 */
871+
#endif /* USART3 */
872+
#endif /* GPDMA1 */
873+
#if defined (LPDMA1)
874+
#define IS_DMA_REQUEST(REQUEST) \
875+
(((REQUEST) == DMA_REQUEST_SW) || \
876+
((REQUEST) <= LPDMA1_REQUEST_XSPI1))
877+
#endif /* LPDMA1 */
775878

776879
#define IS_DMA_BLOCK_HW_REQUEST(MODE) \
777880
(((MODE) == DMA_BREQ_SINGLE_BURST) || \

0 commit comments

Comments
 (0)