stm32l4xx_hal_tim_ex.h 23 KB

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