|
STM32G474xx HAL User Manual
|
00001 /** 00002 ****************************************************************************** 00003 * @file stm32g4xx_hal_dma_ex.h 00004 * @author MCD Application Team 00005 * @brief Header file of DMA HAL extension module. 00006 ****************************************************************************** 00007 * @attention 00008 * 00009 * Copyright (c) 2019 STMicroelectronics. 00010 * All rights reserved. 00011 * 00012 * This software is licensed under terms that can be found in the LICENSE file 00013 * in the root directory of this software component. 00014 * If no LICENSE file comes with this software, it is provided AS-IS. 00015 * 00016 ****************************************************************************** 00017 */ 00018 00019 /* Define to prevent recursive inclusion -------------------------------------*/ 00020 #ifndef __STM32G4xx_HAL_DMA_EX_H 00021 #define __STM32G4xx_HAL_DMA_EX_H 00022 00023 #ifdef __cplusplus 00024 extern "C" { 00025 #endif 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm32g4xx_hal_def.h" 00029 00030 /** @addtogroup STM32G4xx_HAL_Driver 00031 * @{ 00032 */ 00033 00034 /** @addtogroup DMAEx 00035 * @{ 00036 */ 00037 00038 /* Exported types ------------------------------------------------------------*/ 00039 /** @defgroup DMAEx_Exported_Types DMAEx Exported Types 00040 * @{ 00041 */ 00042 00043 /** 00044 * @brief HAL DMA Synchro definition 00045 */ 00046 00047 00048 /** 00049 * @brief HAL DMAMUX Synchronization configuration structure definition 00050 */ 00051 typedef struct 00052 { 00053 uint32_t SyncSignalID; /*!< Specifies the synchronization signal gating the DMA request in periodic mode. 00054 This parameter can be a value of @ref DMAEx_DMAMUX_SyncSignalID_selection */ 00055 00056 uint32_t SyncPolarity; /*!< Specifies the polarity of the signal on which the DMA request is synchronized. 00057 This parameter can be a value of @ref DMAEx_DMAMUX_SyncPolarity_selection */ 00058 00059 FunctionalState SyncEnable; /*!< Specifies if the synchronization shall be enabled or disabled 00060 This parameter can take the value ENABLE or DISABLE*/ 00061 00062 00063 FunctionalState EventEnable; /*!< Specifies if an event shall be generated once the RequestNumber is reached. 00064 This parameter can take the value ENABLE or DISABLE */ 00065 00066 uint32_t RequestNumber; /*!< Specifies the number of DMA request that will be authorized after a sync event 00067 This parameter must be a number between Min_Data = 1 and Max_Data = 32 */ 00068 00069 00070 } HAL_DMA_MuxSyncConfigTypeDef; 00071 00072 00073 /** 00074 * @brief HAL DMAMUX request generator parameters structure definition 00075 */ 00076 typedef struct 00077 { 00078 uint32_t SignalID; /*!< Specifies the ID of the signal used for DMAMUX request generator 00079 This parameter can be a value of @ref DMAEx_DMAMUX_SignalGeneratorID_selection */ 00080 00081 uint32_t Polarity; /*!< Specifies the polarity of the signal on which the request is generated. 00082 This parameter can be a value of @ref DMAEx_DMAMUX_RequestGeneneratorPolarity_selection */ 00083 00084 uint32_t RequestNumber; /*!< Specifies the number of DMA request that will be generated after a signal event 00085 This parameter must be a number between Min_Data = 1 and Max_Data = 32 */ 00086 00087 } HAL_DMA_MuxRequestGeneratorConfigTypeDef; 00088 00089 /** 00090 * @} 00091 */ 00092 00093 /* Exported constants --------------------------------------------------------*/ 00094 /** @defgroup DMAEx_Exported_Constants DMAEx Exported Constants 00095 * @{ 00096 */ 00097 00098 /** @defgroup DMAEx_DMAMUX_SyncSignalID_selection DMAMUX SyncSignalID selection 00099 * @{ 00100 */ 00101 #define HAL_DMAMUX1_SYNC_EXTI0 0U /*!< Synchronization Signal is EXTI0 IT */ 00102 #define HAL_DMAMUX1_SYNC_EXTI1 1U /*!< Synchronization Signal is EXTI1 IT */ 00103 #define HAL_DMAMUX1_SYNC_EXTI2 2U /*!< Synchronization Signal is EXTI2 IT */ 00104 #define HAL_DMAMUX1_SYNC_EXTI3 3U /*!< Synchronization Signal is EXTI3 IT */ 00105 #define HAL_DMAMUX1_SYNC_EXTI4 4U /*!< Synchronization Signal is EXTI4 IT */ 00106 #define HAL_DMAMUX1_SYNC_EXTI5 5U /*!< Synchronization Signal is EXTI5 IT */ 00107 #define HAL_DMAMUX1_SYNC_EXTI6 6U /*!< Synchronization Signal is EXTI6 IT */ 00108 #define HAL_DMAMUX1_SYNC_EXTI7 7U /*!< Synchronization Signal is EXTI7 IT */ 00109 #define HAL_DMAMUX1_SYNC_EXTI8 8U /*!< Synchronization Signal is EXTI8 IT */ 00110 #define HAL_DMAMUX1_SYNC_EXTI9 9U /*!< Synchronization Signal is EXTI9 IT */ 00111 #define HAL_DMAMUX1_SYNC_EXTI10 10U /*!< Synchronization Signal is EXTI10 IT */ 00112 #define HAL_DMAMUX1_SYNC_EXTI11 11U /*!< Synchronization Signal is EXTI11 IT */ 00113 #define HAL_DMAMUX1_SYNC_EXTI12 12U /*!< Synchronization Signal is EXTI12 IT */ 00114 #define HAL_DMAMUX1_SYNC_EXTI13 13U /*!< Synchronization Signal is EXTI13 IT */ 00115 #define HAL_DMAMUX1_SYNC_EXTI14 14U /*!< Synchronization Signal is EXTI14 IT */ 00116 #define HAL_DMAMUX1_SYNC_EXTI15 15U /*!< Synchronization Signal is EXTI15 IT */ 00117 #define HAL_DMAMUX1_SYNC_DMAMUX1_CH0_EVT 16U /*!< Synchronization Signal is DMAMUX1 Channel0 Event */ 00118 #define HAL_DMAMUX1_SYNC_DMAMUX1_CH1_EVT 17U /*!< Synchronization Signal is DMAMUX1 Channel1 Event */ 00119 #define HAL_DMAMUX1_SYNC_DMAMUX1_CH2_EVT 18U /*!< Synchronization Signal is DMAMUX1 Channel2 Event */ 00120 #define HAL_DMAMUX1_SYNC_DMAMUX1_CH3_EVT 19U /*!< Synchronization Signal is DMAMUX1 Channel3 Event */ 00121 #define HAL_DMAMUX1_SYNC_LPTIM1_OUT 20U /*!< Synchronization Signal is LPTIM1 OUT */ 00122 00123 /** 00124 * @} 00125 */ 00126 00127 /** @defgroup DMAEx_DMAMUX_SyncPolarity_selection DMAMUX SyncPolarity selection 00128 * @{ 00129 */ 00130 #define HAL_DMAMUX_SYNC_NO_EVENT 0U /*!< block synchronization events */ 00131 #define HAL_DMAMUX_SYNC_RISING ((uint32_t)DMAMUX_CxCR_SPOL_0) /*!< synchronize with rising edge events */ 00132 #define HAL_DMAMUX_SYNC_FALLING ((uint32_t)DMAMUX_CxCR_SPOL_1) /*!< synchronize with falling edge events */ 00133 #define HAL_DMAMUX_SYNC_RISING_FALLING ((uint32_t)DMAMUX_CxCR_SPOL) /*!< synchronize with rising and falling edge events */ 00134 00135 /** 00136 * @} 00137 */ 00138 00139 /** @defgroup DMAEx_DMAMUX_SignalGeneratorID_selection DMAMUX SignalGeneratorID selection 00140 * @{ 00141 */ 00142 #define HAL_DMAMUX1_REQ_GEN_EXTI0 0U /*!< Request generator Signal is EXTI0 IT */ 00143 #define HAL_DMAMUX1_REQ_GEN_EXTI1 1U /*!< Request generator Signal is EXTI1 IT */ 00144 #define HAL_DMAMUX1