@@ -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 )
668751HAL_StatusTypeDef HAL_DMA_ConfigChannelAttributes (DMA_HandleTypeDef * const hdma ,
669752 uint32_t ChannelAttributes );
670753HAL_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