001
targets/TARGET_STM/TARGET_STM32F4/device/stm32f4xx_hal_tim_ex.h@0:13413ea9a877, 2022-06-12 (annotated)
- Committer:
- ganlikun
- Date:
- Sun Jun 12 14:02:44 2022 +0000
- Revision:
- 0:13413ea9a877
00
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ganlikun | 0:13413ea9a877 | 1 | /** |
ganlikun | 0:13413ea9a877 | 2 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 3 | * @file stm32f4xx_hal_tim_ex.h |
ganlikun | 0:13413ea9a877 | 4 | * @author MCD Application Team |
ganlikun | 0:13413ea9a877 | 5 | * @version V1.7.1 |
ganlikun | 0:13413ea9a877 | 6 | * @date 14-April-2017 |
ganlikun | 0:13413ea9a877 | 7 | * @brief Header file of TIM HAL Extension module. |
ganlikun | 0:13413ea9a877 | 8 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 9 | * @attention |
ganlikun | 0:13413ea9a877 | 10 | * |
ganlikun | 0:13413ea9a877 | 11 | * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2> |
ganlikun | 0:13413ea9a877 | 12 | * |
ganlikun | 0:13413ea9a877 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
ganlikun | 0:13413ea9a877 | 14 | * are permitted provided that the following conditions are met: |
ganlikun | 0:13413ea9a877 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
ganlikun | 0:13413ea9a877 | 16 | * this list of conditions and the following disclaimer. |
ganlikun | 0:13413ea9a877 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
ganlikun | 0:13413ea9a877 | 18 | * this list of conditions and the following disclaimer in the documentation |
ganlikun | 0:13413ea9a877 | 19 | * and/or other materials provided with the distribution. |
ganlikun | 0:13413ea9a877 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
ganlikun | 0:13413ea9a877 | 21 | * may be used to endorse or promote products derived from this software |
ganlikun | 0:13413ea9a877 | 22 | * without specific prior written permission. |
ganlikun | 0:13413ea9a877 | 23 | * |
ganlikun | 0:13413ea9a877 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
ganlikun | 0:13413ea9a877 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
ganlikun | 0:13413ea9a877 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
ganlikun | 0:13413ea9a877 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
ganlikun | 0:13413ea9a877 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
ganlikun | 0:13413ea9a877 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
ganlikun | 0:13413ea9a877 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
ganlikun | 0:13413ea9a877 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
ganlikun | 0:13413ea9a877 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
ganlikun | 0:13413ea9a877 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
ganlikun | 0:13413ea9a877 | 34 | * |
ganlikun | 0:13413ea9a877 | 35 | ****************************************************************************** |
ganlikun | 0:13413ea9a877 | 36 | */ |
ganlikun | 0:13413ea9a877 | 37 | |
ganlikun | 0:13413ea9a877 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 39 | #ifndef __STM32F4xx_HAL_TIM_EX_H |
ganlikun | 0:13413ea9a877 | 40 | #define __STM32F4xx_HAL_TIM_EX_H |
ganlikun | 0:13413ea9a877 | 41 | |
ganlikun | 0:13413ea9a877 | 42 | #ifdef __cplusplus |
ganlikun | 0:13413ea9a877 | 43 | extern "C" { |
ganlikun | 0:13413ea9a877 | 44 | #endif |
ganlikun | 0:13413ea9a877 | 45 | |
ganlikun | 0:13413ea9a877 | 46 | /* Includes ------------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 47 | #include "stm32f4xx_hal_def.h" |
ganlikun | 0:13413ea9a877 | 48 | |
ganlikun | 0:13413ea9a877 | 49 | /** @addtogroup STM32F4xx_HAL_Driver |
ganlikun | 0:13413ea9a877 | 50 | * @{ |
ganlikun | 0:13413ea9a877 | 51 | */ |
ganlikun | 0:13413ea9a877 | 52 | |
ganlikun | 0:13413ea9a877 | 53 | /** @addtogroup TIMEx |
ganlikun | 0:13413ea9a877 | 54 | * @{ |
ganlikun | 0:13413ea9a877 | 55 | */ |
ganlikun | 0:13413ea9a877 | 56 | |
ganlikun | 0:13413ea9a877 | 57 | /* Exported types ------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 58 | /** @defgroup TIMEx_Exported_Types TIM Exported Types |
ganlikun | 0:13413ea9a877 | 59 | * @{ |
ganlikun | 0:13413ea9a877 | 60 | */ |
ganlikun | 0:13413ea9a877 | 61 | |
ganlikun | 0:13413ea9a877 | 62 | /** |
ganlikun | 0:13413ea9a877 | 63 | * @brief TIM Hall sensor Configuration Structure definition |
ganlikun | 0:13413ea9a877 | 64 | */ |
ganlikun | 0:13413ea9a877 | 65 | |
ganlikun | 0:13413ea9a877 | 66 | typedef struct |
ganlikun | 0:13413ea9a877 | 67 | { |
ganlikun | 0:13413ea9a877 | 68 | |
ganlikun | 0:13413ea9a877 | 69 | uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal. |
ganlikun | 0:13413ea9a877 | 70 | This parameter can be a value of @ref TIM_Input_Capture_Polarity */ |
ganlikun | 0:13413ea9a877 | 71 | |
ganlikun | 0:13413ea9a877 | 72 | uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler. |
ganlikun | 0:13413ea9a877 | 73 | This parameter can be a value of @ref TIM_Input_Capture_Prescaler */ |
ganlikun | 0:13413ea9a877 | 74 | |
ganlikun | 0:13413ea9a877 | 75 | uint32_t IC1Filter; /*!< Specifies the input capture filter. |
ganlikun | 0:13413ea9a877 | 76 | This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */ |
ganlikun | 0:13413ea9a877 | 77 | |
ganlikun | 0:13413ea9a877 | 78 | uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register. |
ganlikun | 0:13413ea9a877 | 79 | This parameter can be a number between Min_Data = 0x0000U and Max_Data = 0xFFFFU */ |
ganlikun | 0:13413ea9a877 | 80 | } TIM_HallSensor_InitTypeDef; |
ganlikun | 0:13413ea9a877 | 81 | |
ganlikun | 0:13413ea9a877 | 82 | /** |
ganlikun | 0:13413ea9a877 | 83 | * @brief TIM Master configuration Structure definition |
ganlikun | 0:13413ea9a877 | 84 | */ |
ganlikun | 0:13413ea9a877 | 85 | typedef struct { |
ganlikun | 0:13413ea9a877 | 86 | uint32_t MasterOutputTrigger; /*!< Trigger output (TRGO) selection. |
ganlikun | 0:13413ea9a877 | 87 | This parameter can be a value of @ref TIM_Master_Mode_Selection */ |
ganlikun | 0:13413ea9a877 | 88 | |
ganlikun | 0:13413ea9a877 | 89 | uint32_t MasterSlaveMode; /*!< Master/slave mode selection. |
ganlikun | 0:13413ea9a877 | 90 | This parameter can be a value of @ref TIM_Master_Slave_Mode */ |
ganlikun | 0:13413ea9a877 | 91 | }TIM_MasterConfigTypeDef; |
ganlikun | 0:13413ea9a877 | 92 | |
ganlikun | 0:13413ea9a877 | 93 | /** |
ganlikun | 0:13413ea9a877 | 94 | * @brief TIM Break and Dead time configuration Structure definition |
ganlikun | 0:13413ea9a877 | 95 | */ |
ganlikun | 0:13413ea9a877 | 96 | typedef struct |
ganlikun | 0:13413ea9a877 | 97 | { |
ganlikun | 0:13413ea9a877 | 98 | uint32_t OffStateRunMode; /*!< TIM off state in run mode. |
ganlikun | 0:13413ea9a877 | 99 | This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */ |
ganlikun | 0:13413ea9a877 | 100 | uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode. |
ganlikun | 0:13413ea9a877 | 101 | This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */ |
ganlikun | 0:13413ea9a877 | 102 | uint32_t LockLevel; /*!< TIM Lock level. |
ganlikun | 0:13413ea9a877 | 103 | This parameter can be a value of @ref TIM_Lock_level */ |
ganlikun | 0:13413ea9a877 | 104 | uint32_t DeadTime; /*!< TIM dead Time. |
ganlikun | 0:13413ea9a877 | 105 | This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */ |
ganlikun | 0:13413ea9a877 | 106 | uint32_t BreakState; /*!< TIM Break State. |
ganlikun | 0:13413ea9a877 | 107 | This parameter can be a value of @ref TIM_Break_Input_enable_disable */ |
ganlikun | 0:13413ea9a877 | 108 | uint32_t BreakPolarity; /*!< TIM Break input polarity. |
ganlikun | 0:13413ea9a877 | 109 | This parameter can be a value of @ref TIM_Break_Polarity */ |
ganlikun | 0:13413ea9a877 | 110 | uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state. |
ganlikun | 0:13413ea9a877 | 111 | This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */ |
ganlikun | 0:13413ea9a877 | 112 | }TIM_BreakDeadTimeConfigTypeDef; |
ganlikun | 0:13413ea9a877 | 113 | /** |
ganlikun | 0:13413ea9a877 | 114 | * @} |
ganlikun | 0:13413ea9a877 | 115 | */ |
ganlikun | 0:13413ea9a877 | 116 | |
ganlikun | 0:13413ea9a877 | 117 | /* Exported constants --------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 118 | /** @defgroup TIMEx_Exported_Constants TIM Exported Constants |
ganlikun | 0:13413ea9a877 | 119 | * @{ |
ganlikun | 0:13413ea9a877 | 120 | */ |
ganlikun | 0:13413ea9a877 | 121 | |
ganlikun | 0:13413ea9a877 | 122 | /** @defgroup TIMEx_Remap TIM Remap |
ganlikun | 0:13413ea9a877 | 123 | * @{ |
ganlikun | 0:13413ea9a877 | 124 | */ |
ganlikun | 0:13413ea9a877 | 125 | #define TIM_TIM2_TIM8_TRGO 0x00000000U |
ganlikun | 0:13413ea9a877 | 126 | #define TIM_TIM2_ETH_PTP 0x00000400U |
ganlikun | 0:13413ea9a877 | 127 | #define TIM_TIM2_USBFS_SOF 0x00000800U |
ganlikun | 0:13413ea9a877 | 128 | #define TIM_TIM2_USBHS_SOF 0x00000C00U |
ganlikun | 0:13413ea9a877 | 129 | #define TIM_TIM5_GPIO 0x00000000U |
ganlikun | 0:13413ea9a877 | 130 | #define TIM_TIM5_LSI 0x00000040U |
ganlikun | 0:13413ea9a877 | 131 | #define TIM_TIM5_LSE 0x00000080U |
ganlikun | 0:13413ea9a877 | 132 | #define TIM_TIM5_RTC 0x000000C0U |
ganlikun | 0:13413ea9a877 | 133 | #define TIM_TIM11_GPIO 0x00000000U |
ganlikun | 0:13413ea9a877 | 134 | #define TIM_TIM11_HSE 0x00000002U |
ganlikun | 0:13413ea9a877 | 135 | |
ganlikun | 0:13413ea9a877 | 136 | #if defined(STM32F413xx) || defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 137 | #define TIM_TIM9_TIM3_TRGO 0x10000000U |
ganlikun | 0:13413ea9a877 | 138 | #define TIM_TIM9_LPTIM 0x10000010U |
ganlikun | 0:13413ea9a877 | 139 | #define TIM_TIM5_TIM3_TRGO 0x10000000U |
ganlikun | 0:13413ea9a877 | 140 | #define TIM_TIM5_LPTIM 0x10000008U |
ganlikun | 0:13413ea9a877 | 141 | #define TIM_TIM1_TIM3_TRGO 0x10000000U |
ganlikun | 0:13413ea9a877 | 142 | #define TIM_TIM1_LPTIM 0x10000004U |
ganlikun | 0:13413ea9a877 | 143 | #endif /* STM32F413xx | STM32F423xx */ |
ganlikun | 0:13413ea9a877 | 144 | |
ganlikun | 0:13413ea9a877 | 145 | #if defined (STM32F446xx) |
ganlikun | 0:13413ea9a877 | 146 | #define TIM_TIM11_SPDIFRX 0x00000001U |
ganlikun | 0:13413ea9a877 | 147 | #endif /* STM32F446xx */ |
ganlikun | 0:13413ea9a877 | 148 | /** |
ganlikun | 0:13413ea9a877 | 149 | * @} |
ganlikun | 0:13413ea9a877 | 150 | */ |
ganlikun | 0:13413ea9a877 | 151 | |
ganlikun | 0:13413ea9a877 | 152 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F413xx) || defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 153 | /** @defgroup TIMEx_SystemBreakInput TIM System Break Input |
ganlikun | 0:13413ea9a877 | 154 | * @{ |
ganlikun | 0:13413ea9a877 | 155 | */ |
ganlikun | 0:13413ea9a877 | 156 | #define TIM_SYSTEMBREAKINPUT_HARDFAULT 0x00000001U /* Core Lockup lock output(Hardfault) is connected to Break Input of TIM1 and TIM8 */ |
ganlikun | 0:13413ea9a877 | 157 | #define TIM_SYSTEMBREAKINPUT_PVD 0x00000004U /* PVD Interrupt is connected to Break Input of TIM1 and TIM8 */ |
ganlikun | 0:13413ea9a877 | 158 | #define TIM_SYSTEMBREAKINPUT_HARDFAULT_PVD 0x00000005U /* Core Lockup lock output(Hardfault) and PVD Interrupt are connected to Break Input of TIM1 and TIM8 */ |
ganlikun | 0:13413ea9a877 | 159 | /** |
ganlikun | 0:13413ea9a877 | 160 | * @} |
ganlikun | 0:13413ea9a877 | 161 | */ |
ganlikun | 0:13413ea9a877 | 162 | #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx || STM32F413xx || STM32F423xx */ |
ganlikun | 0:13413ea9a877 | 163 | |
ganlikun | 0:13413ea9a877 | 164 | /** |
ganlikun | 0:13413ea9a877 | 165 | * @} |
ganlikun | 0:13413ea9a877 | 166 | */ |
ganlikun | 0:13413ea9a877 | 167 | /* Exported macro ------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 168 | /* Exported functions --------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 169 | /** @addtogroup TIMEx_Exported_Functions |
ganlikun | 0:13413ea9a877 | 170 | * @{ |
ganlikun | 0:13413ea9a877 | 171 | */ |
ganlikun | 0:13413ea9a877 | 172 | |
ganlikun | 0:13413ea9a877 | 173 | /** @addtogroup TIMEx_Exported_Functions_Group1 |
ganlikun | 0:13413ea9a877 | 174 | * @{ |
ganlikun | 0:13413ea9a877 | 175 | */ |
ganlikun | 0:13413ea9a877 | 176 | /* Timer Hall Sensor functions **********************************************/ |
ganlikun | 0:13413ea9a877 | 177 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef* htim, TIM_HallSensor_InitTypeDef* sConfig); |
ganlikun | 0:13413ea9a877 | 178 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 179 | |
ganlikun | 0:13413ea9a877 | 180 | void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 181 | void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 182 | |
ganlikun | 0:13413ea9a877 | 183 | /* Blocking mode: Polling */ |
ganlikun | 0:13413ea9a877 | 184 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 185 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 186 | /* Non-Blocking mode: Interrupt */ |
ganlikun | 0:13413ea9a877 | 187 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 188 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 189 | /* Non-Blocking mode: DMA */ |
ganlikun | 0:13413ea9a877 | 190 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef* htim, uint32_t *pData, uint16_t Length); |
ganlikun | 0:13413ea9a877 | 191 | HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 192 | /** |
ganlikun | 0:13413ea9a877 | 193 | * @} |
ganlikun | 0:13413ea9a877 | 194 | */ |
ganlikun | 0:13413ea9a877 | 195 | |
ganlikun | 0:13413ea9a877 | 196 | /** @addtogroup TIMEx_Exported_Functions_Group2 |
ganlikun | 0:13413ea9a877 | 197 | * @{ |
ganlikun | 0:13413ea9a877 | 198 | */ |
ganlikun | 0:13413ea9a877 | 199 | /* Timer Complementary Output Compare functions *****************************/ |
ganlikun | 0:13413ea9a877 | 200 | /* Blocking mode: Polling */ |
ganlikun | 0:13413ea9a877 | 201 | HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 202 | HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 203 | |
ganlikun | 0:13413ea9a877 | 204 | /* Non-Blocking mode: Interrupt */ |
ganlikun | 0:13413ea9a877 | 205 | HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 206 | HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 207 | |
ganlikun | 0:13413ea9a877 | 208 | /* Non-Blocking mode: DMA */ |
ganlikun | 0:13413ea9a877 | 209 | HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length); |
ganlikun | 0:13413ea9a877 | 210 | HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 211 | /** |
ganlikun | 0:13413ea9a877 | 212 | * @} |
ganlikun | 0:13413ea9a877 | 213 | */ |
ganlikun | 0:13413ea9a877 | 214 | |
ganlikun | 0:13413ea9a877 | 215 | /** @addtogroup TIMEx_Exported_Functions_Group3 |
ganlikun | 0:13413ea9a877 | 216 | * @{ |
ganlikun | 0:13413ea9a877 | 217 | */ |
ganlikun | 0:13413ea9a877 | 218 | /* Timer Complementary PWM functions ****************************************/ |
ganlikun | 0:13413ea9a877 | 219 | /* Blocking mode: Polling */ |
ganlikun | 0:13413ea9a877 | 220 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 221 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 222 | |
ganlikun | 0:13413ea9a877 | 223 | /* Non-Blocking mode: Interrupt */ |
ganlikun | 0:13413ea9a877 | 224 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 225 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 226 | /* Non-Blocking mode: DMA */ |
ganlikun | 0:13413ea9a877 | 227 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length); |
ganlikun | 0:13413ea9a877 | 228 | HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel); |
ganlikun | 0:13413ea9a877 | 229 | /** |
ganlikun | 0:13413ea9a877 | 230 | * @} |
ganlikun | 0:13413ea9a877 | 231 | */ |
ganlikun | 0:13413ea9a877 | 232 | |
ganlikun | 0:13413ea9a877 | 233 | /** @addtogroup TIMEx_Exported_Functions_Group4 |
ganlikun | 0:13413ea9a877 | 234 | * @{ |
ganlikun | 0:13413ea9a877 | 235 | */ |
ganlikun | 0:13413ea9a877 | 236 | /* Timer Complementary One Pulse functions **********************************/ |
ganlikun | 0:13413ea9a877 | 237 | /* Blocking mode: Polling */ |
ganlikun | 0:13413ea9a877 | 238 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef* htim, uint32_t OutputChannel); |
ganlikun | 0:13413ea9a877 | 239 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef* htim, uint32_t OutputChannel); |
ganlikun | 0:13413ea9a877 | 240 | |
ganlikun | 0:13413ea9a877 | 241 | /* Non-Blocking mode: Interrupt */ |
ganlikun | 0:13413ea9a877 | 242 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel); |
ganlikun | 0:13413ea9a877 | 243 | HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel); |
ganlikun | 0:13413ea9a877 | 244 | /** |
ganlikun | 0:13413ea9a877 | 245 | * @} |
ganlikun | 0:13413ea9a877 | 246 | */ |
ganlikun | 0:13413ea9a877 | 247 | |
ganlikun | 0:13413ea9a877 | 248 | /** @addtogroup TIMEx_Exported_Functions_Group5 |
ganlikun | 0:13413ea9a877 | 249 | * @{ |
ganlikun | 0:13413ea9a877 | 250 | */ |
ganlikun | 0:13413ea9a877 | 251 | /* Extension Control functions ************************************************/ |
ganlikun | 0:13413ea9a877 | 252 | HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource); |
ganlikun | 0:13413ea9a877 | 253 | HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource); |
ganlikun | 0:13413ea9a877 | 254 | HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource); |
ganlikun | 0:13413ea9a877 | 255 | HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef* htim, TIM_MasterConfigTypeDef * sMasterConfig); |
ganlikun | 0:13413ea9a877 | 256 | HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef* htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig); |
ganlikun | 0:13413ea9a877 | 257 | HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef* htim, uint32_t Remap); |
ganlikun | 0:13413ea9a877 | 258 | /** |
ganlikun | 0:13413ea9a877 | 259 | * @} |
ganlikun | 0:13413ea9a877 | 260 | */ |
ganlikun | 0:13413ea9a877 | 261 | |
ganlikun | 0:13413ea9a877 | 262 | /** @addtogroup TIMEx_Exported_Functions_Group6 |
ganlikun | 0:13413ea9a877 | 263 | * @{ |
ganlikun | 0:13413ea9a877 | 264 | */ |
ganlikun | 0:13413ea9a877 | 265 | /* Extension Callback *********************************************************/ |
ganlikun | 0:13413ea9a877 | 266 | void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 267 | void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 268 | void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma); |
ganlikun | 0:13413ea9a877 | 269 | /** |
ganlikun | 0:13413ea9a877 | 270 | * @} |
ganlikun | 0:13413ea9a877 | 271 | */ |
ganlikun | 0:13413ea9a877 | 272 | |
ganlikun | 0:13413ea9a877 | 273 | /** @addtogroup TIMEx_Exported_Functions_Group7 |
ganlikun | 0:13413ea9a877 | 274 | * @{ |
ganlikun | 0:13413ea9a877 | 275 | */ |
ganlikun | 0:13413ea9a877 | 276 | /* Extension Peripheral State functions **************************************/ |
ganlikun | 0:13413ea9a877 | 277 | HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef* htim); |
ganlikun | 0:13413ea9a877 | 278 | /** |
ganlikun | 0:13413ea9a877 | 279 | * @} |
ganlikun | 0:13413ea9a877 | 280 | */ |
ganlikun | 0:13413ea9a877 | 281 | |
ganlikun | 0:13413ea9a877 | 282 | /** |
ganlikun | 0:13413ea9a877 | 283 | * @} |
ganlikun | 0:13413ea9a877 | 284 | */ |
ganlikun | 0:13413ea9a877 | 285 | |
ganlikun | 0:13413ea9a877 | 286 | /* Private types -------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 287 | /* Private variables ---------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 288 | /* Private constants ---------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 289 | /* Private macros ------------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 290 | /** @defgroup TIMEx_Private_Macros TIM Private Macros |
ganlikun | 0:13413ea9a877 | 291 | * @{ |
ganlikun | 0:13413ea9a877 | 292 | */ |
ganlikun | 0:13413ea9a877 | 293 | #if defined (STM32F446xx) |
ganlikun | 0:13413ea9a877 | 294 | #define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\ |
ganlikun | 0:13413ea9a877 | 295 | ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\ |
ganlikun | 0:13413ea9a877 | 296 | ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\ |
ganlikun | 0:13413ea9a877 | 297 | ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\ |
ganlikun | 0:13413ea9a877 | 298 | ((TIM_REMAP) == TIM_TIM5_GPIO)||\ |
ganlikun | 0:13413ea9a877 | 299 | ((TIM_REMAP) == TIM_TIM5_LSI)||\ |
ganlikun | 0:13413ea9a877 | 300 | ((TIM_REMAP) == TIM_TIM5_LSE)||\ |
ganlikun | 0:13413ea9a877 | 301 | ((TIM_REMAP) == TIM_TIM5_RTC)||\ |
ganlikun | 0:13413ea9a877 | 302 | ((TIM_REMAP) == TIM_TIM11_GPIO)||\ |
ganlikun | 0:13413ea9a877 | 303 | ((TIM_REMAP) == TIM_TIM11_SPDIFRX)||\ |
ganlikun | 0:13413ea9a877 | 304 | ((TIM_REMAP) == TIM_TIM11_HSE)) |
ganlikun | 0:13413ea9a877 | 305 | #elif defined(STM32F413xx) || defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 306 | #define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\ |
ganlikun | 0:13413ea9a877 | 307 | ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\ |
ganlikun | 0:13413ea9a877 | 308 | ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\ |
ganlikun | 0:13413ea9a877 | 309 | ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\ |
ganlikun | 0:13413ea9a877 | 310 | ((TIM_REMAP) == TIM_TIM5_GPIO)||\ |
ganlikun | 0:13413ea9a877 | 311 | ((TIM_REMAP) == TIM_TIM5_LSI)||\ |
ganlikun | 0:13413ea9a877 | 312 | ((TIM_REMAP) == TIM_TIM5_LSE)||\ |
ganlikun | 0:13413ea9a877 | 313 | ((TIM_REMAP) == TIM_TIM5_RTC)||\ |
ganlikun | 0:13413ea9a877 | 314 | ((TIM_REMAP) == TIM_TIM11_GPIO)||\ |
ganlikun | 0:13413ea9a877 | 315 | ((TIM_REMAP) == TIM_TIM11_HSE)||\ |
ganlikun | 0:13413ea9a877 | 316 | ((TIM_REMAP) == TIM_TIM9_TIM3_TRGO)||\ |
ganlikun | 0:13413ea9a877 | 317 | ((TIM_REMAP) == TIM_TIM9_LPTIM)||\ |
ganlikun | 0:13413ea9a877 | 318 | ((TIM_REMAP) == TIM_TIM5_TIM3_TRGO)||\ |
ganlikun | 0:13413ea9a877 | 319 | ((TIM_REMAP) == TIM_TIM5_LPTIM)||\ |
ganlikun | 0:13413ea9a877 | 320 | ((TIM_REMAP) == TIM_TIM1_TIM3_TRGO)||\ |
ganlikun | 0:13413ea9a877 | 321 | ((TIM_REMAP) == TIM_TIM1_LPTIM)) |
ganlikun | 0:13413ea9a877 | 322 | #else |
ganlikun | 0:13413ea9a877 | 323 | #define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\ |
ganlikun | 0:13413ea9a877 | 324 | ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\ |
ganlikun | 0:13413ea9a877 | 325 | ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\ |
ganlikun | 0:13413ea9a877 | 326 | ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\ |
ganlikun | 0:13413ea9a877 | 327 | ((TIM_REMAP) == TIM_TIM5_GPIO)||\ |
ganlikun | 0:13413ea9a877 | 328 | ((TIM_REMAP) == TIM_TIM5_LSI)||\ |
ganlikun | 0:13413ea9a877 | 329 | ((TIM_REMAP) == TIM_TIM5_LSE)||\ |
ganlikun | 0:13413ea9a877 | 330 | ((TIM_REMAP) == TIM_TIM5_RTC)||\ |
ganlikun | 0:13413ea9a877 | 331 | ((TIM_REMAP) == TIM_TIM11_GPIO)||\ |
ganlikun | 0:13413ea9a877 | 332 | ((TIM_REMAP) == TIM_TIM11_HSE)) |
ganlikun | 0:13413ea9a877 | 333 | #endif /* STM32F446xx */ |
ganlikun | 0:13413ea9a877 | 334 | |
ganlikun | 0:13413ea9a877 | 335 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F413xx) || defined(STM32F423xx) |
ganlikun | 0:13413ea9a877 | 336 | #define IS_TIM_SYSTEMBREAKINPUT(BREAKINPUT) (((BREAKINPUT) == TIM_SYSTEMBREAKINPUT_HARDFAULT)||\ |
ganlikun | 0:13413ea9a877 | 337 | ((BREAKINPUT) == TIM_SYSTEMBREAKINPUT_PVD)||\ |
ganlikun | 0:13413ea9a877 | 338 | ((BREAKINPUT) == TIM_SYSTEMBREAKINPUT_HARDFAULT_PVD)) |
ganlikun | 0:13413ea9a877 | 339 | |
ganlikun | 0:13413ea9a877 | 340 | #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx || STM32F413xx || STM32F423xx */ |
ganlikun | 0:13413ea9a877 | 341 | |
ganlikun | 0:13413ea9a877 | 342 | #define IS_TIM_DEADTIME(DEADTIME) ((DEADTIME) <= 0xFFU) |
ganlikun | 0:13413ea9a877 | 343 | /** |
ganlikun | 0:13413ea9a877 | 344 | * @} |
ganlikun | 0:13413ea9a877 | 345 | */ |
ganlikun | 0:13413ea9a877 | 346 | |
ganlikun | 0:13413ea9a877 | 347 | /* Private functions ---------------------------------------------------------*/ |
ganlikun | 0:13413ea9a877 | 348 | /** @defgroup TIMEx_Private_Functions TIM Private Functions |
ganlikun | 0:13413ea9a877 | 349 | * @{ |
ganlikun | 0:13413ea9a877 | 350 | */ |
ganlikun | 0:13413ea9a877 | 351 | |
ganlikun | 0:13413ea9a877 | 352 | /** |
ganlikun | 0:13413ea9a877 | 353 | * @} |
ganlikun | 0:13413ea9a877 | 354 | */ |
ganlikun | 0:13413ea9a877 | 355 | |
ganlikun | 0:13413ea9a877 | 356 | /** |
ganlikun | 0:13413ea9a877 | 357 | * @} |
ganlikun | 0:13413ea9a877 | 358 | */ |
ganlikun | 0:13413ea9a877 | 359 | |
ganlikun | 0:13413ea9a877 | 360 | /** |
ganlikun | 0:13413ea9a877 | 361 | * @} |
ganlikun | 0:13413ea9a877 | 362 | */ |
ganlikun | 0:13413ea9a877 | 363 | |
ganlikun | 0:13413ea9a877 | 364 | #ifdef __cplusplus |
ganlikun | 0:13413ea9a877 | 365 | } |
ganlikun | 0:13413ea9a877 | 366 | #endif |
ganlikun | 0:13413ea9a877 | 367 | |
ganlikun | 0:13413ea9a877 | 368 | #endif /* __STM32F4xx_HAL_TIM_EX_H */ |
ganlikun | 0:13413ea9a877 | 369 | |
ganlikun | 0:13413ea9a877 | 370 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
ganlikun | 0:13413ea9a877 | 371 |