stm32l4xx_hal_tim_ex.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_hal_tim_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of TIM HAL Extended module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32L4xx_HAL_TIM_EX_H
  21. #define STM32L4xx_HAL_TIM_EX_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32l4xx_hal_def.h"
  27. /** @addtogroup STM32L4xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup TIMEx
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /** @defgroup TIMEx_Exported_Types TIM Extended Exported Types
  35. * @{
  36. */
  37. /**
  38. * @brief TIM Hall sensor Configuration Structure definition
  39. */
  40. typedef struct
  41. {
  42. uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal.
  43. This parameter can be a value of @ref TIM_Input_Capture_Polarity */
  44. uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler.
  45. This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
  46. uint32_t IC1Filter; /*!< Specifies the input capture filter.
  47. This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
  48. uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
  49. This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
  50. } TIM_HallSensor_InitTypeDef;
  51. /**
  52. * @brief TIM Break/Break2 input configuration
  53. */
  54. typedef struct
  55. {
  56. uint32_t Source; /*!< Specifies the source of the timer break input.
  57. This parameter can be a value of @ref TIMEx_Break_Input_Source */
  58. uint32_t Enable; /*!< Specifies whether or not the break input source is enabled.
  59. This parameter can be a value of @ref TIMEx_Break_Input_Source_Enable */
  60. uint32_t Polarity; /*!< Specifies the break input source polarity.
  61. This parameter can be a value of @ref TIMEx_Break_Input_Source_Polarity
  62. Not relevant when analog watchdog output of the DFSDM1 used as break input source */
  63. }
  64. TIMEx_BreakInputConfigTypeDef;
  65. /**
  66. * @}
  67. */
  68. /* End of exported types -----------------------------------------------------*/
  69. /* Exported constants --------------------------------------------------------*/
  70. /** @defgroup TIMEx_Exported_Constants TIM Extended Exported Constants
  71. * @{
  72. */
  73. /** @defgroup TIMEx_Remap TIM Extended Remapping
  74. * @{
  75. */
  76. #define TIM_TIM1_ETR_ADC1_NONE 0x00000000U /* !< TIM1_ETR is not connected to any AWD (analog watchdog)*/
  77. #define TIM_TIM1_ETR_ADC1_AWD1 TIM1_OR1_ETR_ADC1_RMP_0 /* !< TIM1_ETR is connected to ADC1 AWD1 */
  78. #define TIM_TIM1_ETR_ADC1_AWD2 TIM1_OR1_ETR_ADC1_RMP_1 /* !< TIM1_ETR is connected to ADC1 AWD2 */
  79. #define TIM_TIM1_ETR_ADC1_AWD3 (TIM1_OR1_ETR_ADC1_RMP_1 | TIM1_OR1_ETR_ADC1_RMP_0) /* !< TIM1_ETR is connected to ADC1 AWD3 */
  80. #if defined (ADC3)
  81. #define TIM_TIM1_ETR_ADC3_NONE 0x00000000U /* !< TIM1_ETR is not connected to any AWD (analog watchdog)*/
  82. #define TIM_TIM1_ETR_ADC3_AWD1 TIM1_OR1_ETR_ADC3_RMP_0 /* !< TIM1_ETR is connected to ADC3 AWD1 */
  83. #define TIM_TIM1_ETR_ADC3_AWD2 TIM1_OR1_ETR_ADC3_RMP_1 /* !< TIM1_ETR is connected to ADC3 AWD2 */
  84. #define TIM_TIM1_ETR_ADC3_AWD3 (TIM1_OR1_ETR_ADC3_RMP_1 | TIM1_OR1_ETR_ADC3_RMP_0) /* !< TIM1_ETR is connected to ADC3 AWD3 */
  85. #endif /* ADC3 */
  86. #define TIM_TIM1_TI1_GPIO 0x00000000U /* !< TIM1 TI1 is connected to GPIO */
  87. #define TIM_TIM1_TI1_COMP1 TIM1_OR1_TI1_RMP /* !< TIM1 TI1 is connected to COMP1 */
  88. #define TIM_TIM1_ETR_GPIO 0x00000000U /* !< TIM1_ETR is connected to GPIO */
  89. #define TIM_TIM1_ETR_COMP1 TIM1_OR2_ETRSEL_0 /* !< TIM1_ETR is connected to COMP1 output */
  90. #if defined(COMP2)
  91. #define TIM_TIM1_ETR_COMP2 TIM1_OR2_ETRSEL_1 /* !< TIM1_ETR is connected to COMP2 output */
  92. #endif /* COMP2 */
  93. #if defined (USB_OTG_FS)
  94. #define TIM_TIM2_ITR1_TIM8_TRGO 0x00000000U /* !< TIM2_ITR1 is connected to TIM8_TRGO */
  95. #define TIM_TIM2_ITR1_OTG_FS_SOF TIM2_OR1_ITR1_RMP /* !< TIM2_ITR1 is connected to OTG_FS SOF */
  96. #else
  97. #if defined(STM32L471xx)
  98. #define TIM_TIM2_ITR1_TIM8_TRGO 0x00000000U /* !< TIM2_ITR1 is connected to TIM8_TRGO */
  99. #define TIM_TIM2_ITR1_NONE TIM2_OR1_ITR1_RMP /* !< No internal trigger on TIM2_ITR1 */
  100. #else
  101. #define TIM_TIM2_ITR1_NONE 0x00000000U /* !< No internal trigger on TIM2_ITR1 */
  102. #define TIM_TIM2_ITR1_USB_SOF TIM2_OR1_ITR1_RMP /* !< TIM2_ITR1 is connected to USB SOF */
  103. #endif /* STM32L471xx */
  104. #endif /* USB_OTG_FS */
  105. #define TIM_TIM2_ETR_GPIO 0x00000000U /* !< TIM2_ETR is connected to GPIO */
  106. #define TIM_TIM2_ETR_LSE TIM2_OR1_ETR1_RMP /* !< TIM2_ETR is connected to LSE */
  107. #define TIM_TIM2_ETR_COMP1 TIM2_OR2_ETRSEL_0 /* !< TIM2_ETR is connected to COMP1 output */
  108. #if defined(COMP2)
  109. #define TIM_TIM2_ETR_COMP2 TIM2_OR2_ETRSEL_1 /* !< TIM2_ETR is connected to COMP2 output */
  110. #endif /* COMP2 */
  111. #define TIM_TIM2_TI4_GPIO 0x00000000U /* !< TIM2 TI4 is connected to GPIO */
  112. #define TIM_TIM2_TI4_COMP1 TIM2_OR1_TI4_RMP_0 /* !< TIM2 TI4 is connected to COMP1 output */
  113. #if defined(COMP2)
  114. #define TIM_TIM2_TI4_COMP2 TIM2_OR1_TI4_RMP_1 /* !< TIM2 TI4 is connected to COMP2 output */
  115. #define TIM_TIM2_TI4_COMP1_COMP2 (TIM2_OR1_TI4_RMP_1| TIM2_OR1_TI4_RMP_0) /* !< TIM2 TI4 is connected to logical OR between COMP1 and COMP2 output2 */
  116. #endif /* COMP2 */
  117. #if defined (TIM3)
  118. #define TIM_TIM3_TI1_GPIO 0x00000000U /* !< TIM3 TI1 is connected to GPIO */
  119. #define TIM_TIM3_TI1_COMP1 TIM3_OR1_TI1_RMP_0 /* !< TIM3 TI1 is connected to COMP1 output */
  120. #define TIM_TIM3_TI1_COMP2 TIM3_OR1_TI1_RMP_1 /* !< TIM3 TI1 is connected to COMP2 output */
  121. #define TIM_TIM3_TI1_COMP1_COMP2 (TIM3_OR1_TI1_RMP_1 | TIM3_OR1_TI1_RMP_0) /* !< TIM3 TI1 is connected to logical OR between COMP1 and COMP2 output2 */
  122. #define TIM_TIM3_ETR_GPIO 0x00000000U /* !< TIM3_ETR is connected to GPIO */
  123. #define TIM_TIM3_ETR_COMP1 TIM3_OR2_ETRSEL_0 /* !< TIM3_ETR is connected to COMP1 output */
  124. #endif /* TIM3 */
  125. #if defined (TIM8)
  126. #if defined(ADC2) && defined(ADC3)
  127. #define TIM_TIM8_ETR_ADC2_NONE 0x00000000U /* !< TIM8_ETR is not connected to any AWD (analog watchdog)*/
  128. #define TIM_TIM8_ETR_ADC2_AWD1 TIM8_OR1_ETR_ADC2_RMP_0 /* !< TIM8_ETR is connected to ADC2 AWD1 */
  129. #define TIM_TIM8_ETR_ADC2_AWD2 TIM8_OR1_ETR_ADC2_RMP_1 /* !< TIM8_ETR is connected to ADC2 AWD2 */
  130. #define TIM_TIM8_ETR_ADC2_AWD3 (TIM8_OR1_ETR_ADC2_RMP_1 | TIM8_OR1_ETR_ADC2_RMP_0) /* !< TIM8_ETR is connected to ADC2 AWD3 */
  131. #define TIM_TIM8_ETR_ADC3_NONE 0x00000000U /* !< TIM8_ETR is not connected to any AWD (analog watchdog)*/
  132. #define TIM_TIM8_ETR_ADC3_AWD1 TIM8_OR1_ETR_ADC3_RMP_0 /* !< TIM8_ETR is connected to ADC3 AWD1 */
  133. #define TIM_TIM8_ETR_ADC3_AWD2 TIM8_OR1_ETR_ADC3_RMP_1 /* !< TIM8_ETR is connected to ADC3 AWD2 */
  134. #define TIM_TIM8_ETR_ADC3_AWD3 (TIM8_OR1_ETR_ADC3_RMP_1 | TIM8_OR1_ETR_ADC3_RMP_0) /* !< TIM8_ETR is connected to ADC3 AWD3 */
  135. #endif /* ADC2 && ADC3 */
  136. #define TIM_TIM8_TI1_GPIO 0x00000000U /* !< TIM8 TI1 is connected to GPIO */
  137. #define TIM_TIM8_TI1_COMP2 TIM8_OR1_TI1_RMP /* !< TIM8 TI1 is connected to COMP1 */
  138. #define TIM_TIM8_ETR_GPIO 0x00000000U /* !< TIM8_ETR is connected to GPIO */
  139. #define TIM_TIM8_ETR_COMP1 TIM8_OR2_ETRSEL_0 /* !< TIM8_ETR is connected to COMP1 output */
  140. #define TIM_TIM8_ETR_COMP2 TIM8_OR2_ETRSEL_1 /* !< TIM8_ETR is connected to COMP2 output */
  141. #endif /* TIM8 */
  142. #define TIM_TIM15_TI1_GPIO 0x00000000U /* !< TIM15 TI1 is connected to GPIO */
  143. #define TIM_TIM15_TI1_LSE TIM15_OR1_TI1_RMP /* !< TIM15 TI1 is connected to LSE */
  144. #define TIM_TIM15_ENCODERMODE_NONE 0x00000000U /* !< No redirection */
  145. #define TIM_TIM15_ENCODERMODE_TIM2 TIM15_OR1_ENCODER_MODE_0 /* !< TIM2 IC1 and TIM2 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively */
  146. #if defined (TIM3)
  147. #define TIM_TIM15_ENCODERMODE_TIM3 TIM15_OR1_ENCODER_MODE_1 /* !< TIM3 IC1 and TIM3 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively */
  148. #endif /* TIM3 */
  149. #if defined (TIM4)
  150. #define TIM_TIM15_ENCODERMODE_TIM4 (TIM15_OR1_ENCODER_MODE_1 | TIM15_OR1_ENCODER_MODE_0) /* !< TIM4 IC1 and TIM4 IC2 are connected to TIM15 IC1 and TIM15 IC2 respectively */
  151. #endif /* TIM4 */
  152. #define TIM_TIM16_TI1_GPIO 0x00000000U /* !< TIM16 TI1 is connected to GPIO */
  153. #define TIM_TIM16_TI1_LSI TIM16_OR1_TI1_RMP_0 /* !< TIM16 TI1 is connected to LSI */
  154. #define TIM_TIM16_TI1_LSE TIM16_OR1_TI1_RMP_1 /* !< TIM16 TI1 is connected to LSE */
  155. #define TIM_TIM16_TI1_RTC (TIM16_OR1_TI1_RMP_1 | TIM16_OR1_TI1_RMP_0) /* !< TIM16 TI1 is connected to RTC wakeup interrupt */
  156. #if defined (TIM16_OR1_TI1_RMP_2)
  157. #define TIM_TIM16_TI1_MSI TIM16_OR1_TI1_RMP_2 /* !< TIM16 TI1 is connected to MSI */
  158. #define TIM_TIM16_TI1_HSE_32 (TIM16_OR1_TI1_RMP_2 | TIM16_OR1_TI1_RMP_0) /* !< TIM16 TI1 is connected to HSE div 32 */
  159. #define TIM_TIM16_TI1_MCO (TIM16_OR1_TI1_RMP_2 | TIM16_OR1_TI1_RMP_1) /* !< TIM16 TI1 is connected to MCO */
  160. #endif /* TIM16_OR1_TI1_RMP_2 */
  161. #if defined (TIM17)
  162. #define TIM_TIM17_TI1_GPIO 0x00000000U /* !< TIM17 TI1 is connected to GPIO */
  163. #define TIM_TIM17_TI1_MSI TIM17_OR1_TI1_RMP_0 /* !< TIM17 TI1 is connected to MSI */
  164. #define TIM_TIM17_TI1_HSE_32 TIM17_OR1_TI1_RMP_1 /* !< TIM17 TI1 is connected to HSE div 32 */
  165. #define TIM_TIM17_TI1_MCO (TIM17_OR1_TI1_RMP_1 | TIM17_OR1_TI1_RMP_0) /* !< TIM17 TI1 is connected to MCO */
  166. #endif /* TIM17 */
  167. /**
  168. * @}
  169. */
  170. /** @defgroup TIMEx_Break_Input TIM Extended Break input
  171. * @{
  172. */
  173. #define TIM_BREAKINPUT_BRK 0x00000001U /* !< Timer break input */
  174. #define TIM_BREAKINPUT_BRK2 0x00000002U /* !< Timer break2 input */
  175. /**
  176. * @}
  177. */
  178. /** @defgroup TIMEx_Break_Input_Source TIM Extended Break input source
  179. * @{
  180. */
  181. #define TIM_BREAKINPUTSOURCE_BKIN 0x00000001U /* !< An external source (GPIO) is connected to the BKIN pin */
  182. #define TIM_BREAKINPUTSOURCE_COMP1 0x00000002U /* !< The COMP1 output is connected to the break input */
  183. #define TIM_BREAKINPUTSOURCE_COMP2 0x00000004U /* !< The COMP2 output is connected to the break input */
  184. #if defined (DFSDM1_Channel0)
  185. #define TIM_BREAKINPUTSOURCE_DFSDM1 0x00000008U /* !< The analog watchdog output of the DFSDM1 peripheral is connected to the break input */
  186. #endif /* DFSDM1_Channel0 */
  187. /**
  188. * @}
  189. */
  190. /** @defgroup TIMEx_Break_Input_Source_Enable TIM Extended Break input source enabling
  191. * @{
  192. */
  193. #define TIM_BREAKINPUTSOURCE_DISABLE 0x00000000U /* !< Break input source is disabled */
  194. #define TIM_BREAKINPUTSOURCE_ENABLE 0x00000001U /* !< Break input source is enabled */
  195. /**
  196. * @}
  197. */
  198. /** @defgroup TIMEx_Break_Input_Source_Polarity TIM Extended Break input polarity
  199. * @{
  200. */
  201. #define TIM_BREAKINPUTSOURCE_POLARITY_LOW 0x00000001U /* !< Break input source is active low */
  202. #define TIM_BREAKINPUTSOURCE_POLARITY_HIGH 0x00000000U /* !< Break input source is active_high */
  203. /**
  204. * @}
  205. */
  206. /**
  207. * @}
  208. */
  209. /* End of exported constants -------------------------------------------------*/
  210. /* Exported macro ------------------------------------------------------------*/
  211. /** @defgroup TIMEx_Exported_Macros TIM Extended Exported Macros
  212. * @{
  213. */
  214. /**
  215. * @}
  216. */
  217. /* End of exported macro -----------------------------------------------------*/
  218. /* Private macro -------------------------------------------------------------*/
  219. /** @defgroup TIMEx_Private_Macros TIM Extended Private Macros
  220. * @{
  221. */
  222. #define IS_TIM_REMAP(__REMAP__) (((__REMAP__) <= (uint32_t)0x0001C01F))
  223. #define IS_TIM_BREAKINPUT(__BREAKINPUT__) (((__BREAKINPUT__) == TIM_BREAKINPUT_BRK) || \
  224. ((__BREAKINPUT__) == TIM_BREAKINPUT_BRK2))
  225. #if defined (DFSDM1_Channel0)
  226. #define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) (((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN) || \
  227. ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP1) || \
  228. ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP2) || \
  229. ((__SOURCE__) == TIM_BREAKINPUTSOURCE_DFSDM1))
  230. #else
  231. #define IS_TIM_BREAKINPUTSOURCE(__SOURCE__) (((__SOURCE__) == TIM_BREAKINPUTSOURCE_BKIN) || \
  232. ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP1) || \
  233. ((__SOURCE__) == TIM_BREAKINPUTSOURCE_COMP2))
  234. #endif /* DFSDM1_Channel0 */
  235. #define IS_TIM_BREAKINPUTSOURCE_STATE(__STATE__) (((__STATE__) == TIM_BREAKINPUTSOURCE_DISABLE) || \
  236. ((__STATE__) == TIM_BREAKINPUTSOURCE_ENABLE))
  237. #define IS_TIM_BREAKINPUTSOURCE_POLARITY(__POLARITY__) (((__POLARITY__) == TIM_BREAKINPUTSOURCE_POLARITY_LOW) || \
  238. ((__POLARITY__) == TIM_BREAKINPUTSOURCE_POLARITY_HIGH))
  239. /**
  240. * @}
  241. */
  242. /* End of private macro ------------------------------------------------------*/
  243. /* Exported functions --------------------------------------------------------*/
  244. /** @addtogroup TIMEx_Exported_Functions TIM Extended Exported Functions
  245. * @{
  246. */
  247. /** @addtogroup TIMEx_Exported_Functions_Group1 Extended Timer Hall Sensor functions
  248. * @brief Timer Hall Sensor functions
  249. * @{
  250. */
  251. /* Timer Hall Sensor functions **********************************************/
  252. HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef *htim, TIM_HallSensor_InitTypeDef *sConfig);
  253. HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef *htim);
  254. void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef *htim);
  255. void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef *htim);
  256. /* Blocking mode: Polling */
  257. HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef *htim);
  258. HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef *htim);
  259. /* Non-Blocking mode: Interrupt */
  260. HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef *htim);
  261. HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef *htim);
  262. /* Non-Blocking mode: DMA */
  263. HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef *htim, uint32_t *pData, uint16_t Length);
  264. HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef *htim);
  265. /**
  266. * @}
  267. */
  268. /** @addtogroup TIMEx_Exported_Functions_Group2 Extended Timer Complementary Output Compare functions
  269. * @brief Timer Complementary Output Compare functions
  270. * @{
  271. */
  272. /* Timer Complementary Output Compare functions *****************************/
  273. /* Blocking mode: Polling */
  274. HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
  275. HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
  276. /* Non-Blocking mode: Interrupt */
  277. HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
  278. HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
  279. /* Non-Blocking mode: DMA */
  280. HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
  281. HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
  282. /**
  283. * @}
  284. */
  285. /** @addtogroup TIMEx_Exported_Functions_Group3 Extended Timer Complementary PWM functions
  286. * @brief Timer Complementary PWM functions
  287. * @{
  288. */
  289. /* Timer Complementary PWM functions ****************************************/
  290. /* Blocking mode: Polling */
  291. HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef *htim, uint32_t Channel);
  292. HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef *htim, uint32_t Channel);
  293. /* Non-Blocking mode: Interrupt */
  294. HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
  295. HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t Channel);
  296. /* Non-Blocking mode: DMA */
  297. HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef *htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
  298. HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef *htim, uint32_t Channel);
  299. /**
  300. * @}
  301. */
  302. /** @addtogroup TIMEx_Exported_Functions_Group4 Extended Timer Complementary One Pulse functions
  303. * @brief Timer Complementary One Pulse functions
  304. * @{
  305. */
  306. /* Timer Complementary One Pulse functions **********************************/
  307. /* Blocking mode: Polling */
  308. HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
  309. HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
  310. /* Non-Blocking mode: Interrupt */
  311. HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
  312. HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef *htim, uint32_t OutputChannel);
  313. /**
  314. * @}
  315. */
  316. /** @addtogroup TIMEx_Exported_Functions_Group5 Extended Peripheral Control functions
  317. * @brief Peripheral Control functions
  318. * @{
  319. */
  320. /* Extended Control functions ************************************************/
  321. HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent(TIM_HandleTypeDef *htim, uint32_t InputTrigger,
  322. uint32_t CommutationSource);
  323. HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_IT(TIM_HandleTypeDef *htim, uint32_t InputTrigger,
  324. uint32_t CommutationSource);
  325. HAL_StatusTypeDef HAL_TIMEx_ConfigCommutEvent_DMA(TIM_HandleTypeDef *htim, uint32_t InputTrigger,
  326. uint32_t CommutationSource);
  327. HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef *htim,
  328. TIM_MasterConfigTypeDef *sMasterConfig);
  329. HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef *htim,
  330. TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
  331. HAL_StatusTypeDef HAL_TIMEx_ConfigBreakInput(TIM_HandleTypeDef *htim, uint32_t BreakInput,
  332. TIMEx_BreakInputConfigTypeDef *sBreakInputConfig);
  333. HAL_StatusTypeDef HAL_TIMEx_GroupChannel5(TIM_HandleTypeDef *htim, uint32_t Channels);
  334. HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef *htim, uint32_t Remap);
  335. /**
  336. * @}
  337. */
  338. /** @addtogroup TIMEx_Exported_Functions_Group6 Extended Callbacks functions
  339. * @brief Extended Callbacks functions
  340. * @{
  341. */
  342. /* Extended Callback **********************************************************/
  343. void HAL_TIMEx_CommutCallback(TIM_HandleTypeDef *htim);
  344. void HAL_TIMEx_CommutHalfCpltCallback(TIM_HandleTypeDef *htim);
  345. void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef *htim);
  346. void HAL_TIMEx_Break2Callback(TIM_HandleTypeDef *htim);
  347. /**
  348. * @}
  349. */
  350. /** @addtogroup TIMEx_Exported_Functions_Group7 Extended Peripheral State functions
  351. * @brief Extended Peripheral State functions
  352. * @{
  353. */
  354. /* Extended Peripheral State functions ***************************************/
  355. HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef *htim);
  356. /**
  357. * @}
  358. */
  359. /**
  360. * @}
  361. */
  362. /* End of exported functions -------------------------------------------------*/
  363. /* Private functions----------------------------------------------------------*/
  364. /** @addtogroup TIMEx_Private_Functions TIMEx Private Functions
  365. * @{
  366. */
  367. void TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
  368. void TIMEx_DMACommutationHalfCplt(DMA_HandleTypeDef *hdma);
  369. /**
  370. * @}
  371. */
  372. /* End of private functions --------------------------------------------------*/
  373. /**
  374. * @}
  375. */
  376. /**
  377. * @}
  378. */
  379. #ifdef __cplusplus
  380. }
  381. #endif
  382. #endif /* STM32L4xx_HAL_TIM_EX_H */
  383. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/