You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

484 lines
22 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_hal_dts.h
  4. * @author MCD Application Team
  5. * @brief Header file of DTS HAL 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 __STM32H7xx_HAL_DTS_H
  21. #define __STM32H7xx_HAL_DTS_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. #if defined(DTS)
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32h7xx_hal_def.h"
  28. /** @addtogroup STM32H7xx_HAL_Driver
  29. * @{
  30. */
  31. /** @addtogroup DTS
  32. * @{
  33. */
  34. /* Exported types ------------------------------------------------------------*/
  35. /** @defgroup DTS_Exported_Types DTS Exported Types
  36. * @{
  37. */
  38. /**
  39. * @brief DTS Init structure definition
  40. */
  41. typedef struct
  42. {
  43. uint32_t QuickMeasure; /*!< Specifies the quick measure option selection of the DTS sensor.
  44. This parameter can be a value of @ref DTS_Quick_Measurement */
  45. uint32_t RefClock; /*!< Specifies the reference clock selection of the DTS sensor.
  46. This parameter can be a value of @ref DTS_Reference_Clock_Selection */
  47. uint32_t TriggerInput; /*!< Specifies the trigger input of the DTS sensor.
  48. This parameter can be a value of @ref DTS_TriggerConfig */
  49. uint32_t SamplingTime; /*!< Specifies the sampling time configuration.
  50. This parameter can be a value of @ref DTS_Sampling_Time */
  51. uint32_t Divider; /*!< Specifies the high speed clock divider ratio.
  52. This parameter can be a value from 0 to 127 */
  53. uint32_t HighThreshold; /*!< Specifies the high threshold of the DTS sensor */
  54. uint32_t LowThreshold; /*!< Specifies the low threshold of the DTS sensor */
  55. } DTS_InitTypeDef;
  56. /**
  57. * @brief HAL State structures definition
  58. */
  59. typedef enum
  60. {
  61. HAL_DTS_STATE_RESET = 0x00UL, /*!< DTS not yet initialized or disabled */
  62. HAL_DTS_STATE_READY = 0x01UL, /*!< DTS initialized and ready for use */
  63. HAL_DTS_STATE_BUSY = 0x02UL, /*!< DTS is running */
  64. HAL_DTS_STATE_TIMEOUT = 0x03UL, /*!< Timeout state */
  65. HAL_DTS_STATE_ERROR = 0x04UL /*!< Internal Process error */
  66. } HAL_DTS_StateTypeDef;
  67. /**
  68. * @brief DTS Handle Structure definition
  69. */
  70. #if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
  71. typedef struct __DTS_HandleTypeDef
  72. #else
  73. typedef struct
  74. #endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
  75. {
  76. DTS_TypeDef *Instance; /*!< Register base address */
  77. DTS_InitTypeDef Init; /*!< DTS required parameters */
  78. HAL_LockTypeDef Lock; /*!< DTS Locking object */
  79. __IO HAL_DTS_StateTypeDef State; /*!< DTS peripheral state */
  80. #if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
  81. void (* MspInitCallback)(struct __DTS_HandleTypeDef *hdts); /*!< DTS Base Msp Init Callback */
  82. void (* MspDeInitCallback)(struct __DTS_HandleTypeDef *hdts); /*!< DTS Base Msp DeInit Callback */
  83. void (* DTS_EndCallback)(struct __DTS_HandleTypeDef *hdts); /*!< End measure Callback */
  84. void (* DTS_LowCallback)(struct __DTS_HandleTypeDef *hdts); /*!< low threshold Callback */
  85. void (* DTS_HighCallback)(struct __DTS_HandleTypeDef *hdts); /*!< high threshold Callback */
  86. void (* DTS_AsyncEndCallback)(struct __DTS_HandleTypeDef *hdts); /*!< Asynchronous end of measure Callback */
  87. void (* DTS_AsyncLowCallback)(struct __DTS_HandleTypeDef *hdts); /*!< Asynchronous low threshold Callback */
  88. void (* DTS_AsyncHighCallback(struct __DTS_HandleTypeDef *hdts); /*!< Asynchronous high threshold Callback */
  89. #endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
  90. } DTS_HandleTypeDef;
  91. /**
  92. * @}
  93. */
  94. /* Exported constants --------------------------------------------------------*/
  95. /** @defgroup DTS_Exported_Constants DTS Exported Constants
  96. * @{
  97. */
  98. /** @defgroup DTS_TriggerConfig DTS Trigger Configuration
  99. * @{
  100. */
  101. /* @brief No Hardware trigger detection */
  102. #define DTS_TRIGGER_HW_NONE (0UL)
  103. /* @brief External Interrupt Mode with LPTIMER1 trigger detection */
  104. #define DTS_TRIGGER_LPTIMER1 DTS_CFGR1_TS1_INTRIG_SEL_0
  105. /* @brief External Interrupt Mode with LPTIMER2 trigger detection */
  106. #define DTS_TRIGGER_LPTIMER2 DTS_CFGR1_TS1_INTRIG_SEL_1
  107. /* @brief External Interrupt Mode with LPTIMER3 trigger detection */
  108. #define DTS_TRIGGER_LPTIMER3 (DTS_CFGR1_TS1_INTRIG_SEL_0 | DTS_CFGR1_TS1_INTRIG_SEL_1)
  109. /* @brief External Interrupt Mode with EXTI13 trigger detection */
  110. #define DTS_TRIGGER_EXTI13 DTS_CFGR1_TS1_INTRIG_SEL_2
  111. /**
  112. * @}
  113. */
  114. /** @defgroup DTS_Quick_Measurement DTS Quick Measurement
  115. * @{
  116. */
  117. #define DTS_QUICKMEAS_ENABLE DTS_CFGR1_Q_MEAS_OPT /*!< Enable the Quick Measure (Measure without calibration) */
  118. #define DTS_QUICKMEAS_DISABLE (0x0UL) /*!< Disable the Quick Measure (Measure with calibration) */
  119. /**
  120. * @}
  121. */
  122. /** @defgroup DTS_Reference_Clock_Selection DTS Reference Clock Selection
  123. * @{
  124. */
  125. #define DTS_REFCLKSEL_LSE DTS_CFGR1_REFCLK_SEL /*!< Low speed REF clock (LSE) */
  126. #define DTS_REFCLKSEL_PCLK (0UL) /*!< High speed REF clock (PCLK) */
  127. /**
  128. * @}
  129. */
  130. /** @defgroup DTS_Sampling_Time DTS Sampling Time
  131. * @{
  132. */
  133. #define DTS_SMP_TIME_1_CYCLE DTS_CFGR1_TS1_SMP_TIME_0 /*!< 1 clock cycle for the sampling time */
  134. #define DTS_SMP_TIME_2_CYCLE DTS_CFGR1_TS1_SMP_TIME_1 /*!< 2 clock cycle for the sampling time */
  135. #define DTS_SMP_TIME_3_CYCLE (DTS_CFGR1_TS1_SMP_TIME_0 | DTS_CFGR1_TS1_SMP_TIME_1) /*!< 3 clock cycle for the sampling time */
  136. #define DTS_SMP_TIME_4_CYCLE (DTS_CFGR1_TS1_SMP_TIME_2) /*!< 4 clock cycle for the sampling time */
  137. #define DTS_SMP_TIME_5_CYCLE (DTS_CFGR1_TS1_SMP_TIME_0 | DTS_CFGR1_TS1_SMP_TIME_2) /*!< 5 clock cycle for the sampling time */
  138. #define DTS_SMP_TIME_6_CYCLE (DTS_CFGR1_TS1_SMP_TIME_1 | DTS_CFGR1_TS1_SMP_TIME_2) /*!< 6 clock cycle for the sampling time */
  139. #define DTS_SMP_TIME_7_CYCLE (DTS_CFGR1_TS1_SMP_TIME_0 | DTS_CFGR1_TS1_SMP_TIME_1 | DTS_CFGR1_TS1_SMP_TIME_2) /*!< 7 clock cycle for the sampling time */
  140. #define DTS_SMP_TIME_8_CYCLE (DTS_CFGR1_TS1_SMP_TIME_3) /*!< 8 clock cycle for the sampling time */
  141. #define DTS_SMP_TIME_9_CYCLE (DTS_CFGR1_TS1_SMP_TIME_0 | DTS_CFGR1_TS1_SMP_TIME_3) /*!< 9 clock cycle for the sampling time */
  142. #define DTS_SMP_TIME_10_CYCLE (DTS_CFGR1_TS1_SMP_TIME_1 | DTS_CFGR1_TS1_SMP_TIME_3) /*!< 10 clock cycle for the sampling time */
  143. #define DTS_SMP_TIME_11_CYCLE (DTS_CFGR1_TS1_SMP_TIME_0 | DTS_CFGR1_TS1_SMP_TIME_1 | DTS_CFGR1_TS1_SMP_TIME_3) /*!< 11 clock cycle for the sampling time */
  144. #define DTS_SMP_TIME_12_CYCLE (DTS_CFGR1_TS1_SMP_TIME_2 | DTS_CFGR1_TS1_SMP_TIME_3) /*!< 12 clock cycle for the sampling time */
  145. #define DTS_SMP_TIME_13_CYCLE (DTS_CFGR1_TS1_SMP_TIME_0 | DTS_CFGR1_TS1_SMP_TIME_2 | DTS_CFGR1_TS1_SMP_TIME_3) /*!< 13 clock cycle for the sampling time */
  146. #define DTS_SMP_TIME_14_CYCLE (DTS_CFGR1_TS1_SMP_TIME_1 | DTS_CFGR1_TS1_SMP_TIME_2 | DTS_CFGR1_TS1_SMP_TIME_3) /*!< 14 clock cycle for the sampling time */
  147. #define DTS_SMP_TIME_15_CYCLE (DTS_CFGR1_TS1_SMP_TIME_0 | DTS_CFGR1_TS1_SMP_TIME_1 | DTS_CFGR1_TS1_SMP_TIME_2 | DTS_CFGR1_TS1_SMP_TIME_3) /*!< 15 clock cycle for the sampling time */
  148. /**
  149. * @}
  150. */
  151. /** @defgroup DTS_Flag_Definitions DTS Flag Definitions
  152. * @{
  153. */
  154. #define DTS_FLAG_TS1_ITE DTS_SR_TS1_ITEF /*!< Interrupt flag for end of measure for DTS1 */
  155. #define DTS_FLAG_TS1_ITL DTS_SR_TS1_ITLF /*!< Interrupt flag for low threshold for DTS1 */
  156. #define DTS_FLAG_TS1_ITH DTS_SR_TS1_ITHF /*!< Interrupt flag for high threshold for DTS1 */
  157. #define DTS_FLAG_TS1_AITE DTS_SR_TS1_AITEF /*!< Asynchronous Interrupt flag for end of measure for DTS1 */
  158. #define DTS_FLAG_TS1_AITL DTS_SR_TS1_AITLF /*!< Asynchronous Interrupt flag for low threshold for DTS1 */
  159. #define DTS_FLAG_TS1_AITH DTS_SR_TS1_AITHF /*!< Asynchronous Interrupt flag for high threshold for DTS1 */
  160. #define DTS_FLAG_TS1_RDY DTS_SR_TS1_RDY /*!< Ready flag for DTS1 */
  161. /**
  162. * @}
  163. */
  164. /** @defgroup DTS_Interrupts_Definitions DTS Interrupts Definitions
  165. * @{
  166. */
  167. #define DTS_IT_TS1_ITE DTS_ITENR_TS1_ITEEN /*!< Enable interrupt flag for end of measure for DTS1 */
  168. #define DTS_IT_TS1_ITL DTS_ITENR_TS1_ITLEN /*!< Enable interrupt flag for low threshold for DTS1 */
  169. #define DTS_IT_TS1_ITH DTS_ITENR_TS1_ITHEN /*!< Enable interrupt flag for high threshold for DTS1 */
  170. #define DTS_IT_TS1_AITE DTS_ITENR_TS1_AITEEN /*!< Enable asynchronous interrupt flag for end of measure for DTS1 */
  171. #define DTS_IT_TS1_AITL DTS_ITENR_TS1_AITLEN /*!< Enable asynchronous interrupt flag for low threshold for DTS1 */
  172. #define DTS_IT_TS1_AITH DTS_ITENR_TS1_AITHEN /*!< Enable asynchronous interrupt flag for high threshold for DTS1 */
  173. /**
  174. * @}
  175. */
  176. /**
  177. * @}
  178. */
  179. /* Exported macros -----------------------------------------------------------*/
  180. /** @defgroup DTS_Exported_Macros DTS Exported Macros
  181. * @{
  182. */
  183. /** @brief Reset DTS handle state
  184. * @param __HANDLE__ DTS handle.
  185. * @retval None
  186. */
  187. #define __HAL_DTS_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DTS_STATE_RESET)
  188. /**
  189. * @brief Enable the specified DTS sensor
  190. * @param __HANDLE__ DTS handle.
  191. * @retval None
  192. */
  193. #define __HAL_DTS_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CFGR1, DTS_CFGR1_TS1_EN)
  194. /**
  195. * @brief Disable the specified DTS sensor
  196. * @param __HANDLE__ DTS handle.
  197. * @retval None
  198. */
  199. #define __HAL_DTS_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CFGR1, DTS_CFGR1_TS1_EN)
  200. /**
  201. * @brief Enable the DTS EXTI line in interrupt mode
  202. * @retval None
  203. */
  204. #define __HAL_DTS_EXTI_WAKEUP_ENABLE_IT() SET_BIT(EXTI->IMR3, DTS_EXTI_LINE_DTS1)
  205. /**
  206. * @brief Disable the DTS EXTI line in interrupt mode
  207. * @retval None
  208. */
  209. #define __HAL_DTS_EXTI_WAKEUP_DISABLE_IT() CLEAR_BIT(EXTI->IMR3, DTS_EXTI_LINE_DTS1)
  210. /**
  211. * @brief Enable the DTS EXTI Line in event mode
  212. * @retval None
  213. */
  214. #define __HAL_DTS_EXTI_WAKEUP_ENABLE_EVENT() SET_BIT(EXTI->EMR3, DTS_EXTI_LINE_DTS1)
  215. /**
  216. * @brief Disable the DTS EXTI Line in event mode
  217. * @retval None
  218. */
  219. #define __HAL_DTS_EXTI_WAKEUP_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR3, DTS_EXTI_LINE_DTS1)
  220. /** @brief Checks whether the specified DTS flag is set or not.
  221. * @param __HANDLE__ specifies the DTS Handle.
  222. * @param __FLAG__ specifies the flag to check.
  223. * This parameter can be one of the following values:
  224. * @arg DTS_FLAG_TS1_ITE : interrupt flag for end of measure for DTS1
  225. * @arg DTS_FLAG_TS1_ITL : interrupt flag for low threshold for DTS1
  226. * @arg DTS_FLAG_TS1_ITH : interrupt flag for high threshold for DTS1
  227. * @arg DTS_FLAG_TS1_AITE: asynchronous interrupt flag for end of measure for DTS1
  228. * @arg DTS_FLAG_TS1_AITL: asynchronous interrupt flag for low threshold for DTS1
  229. * @arg DTS_FLAG_TS1_AITH: asynchronous interrupt flag for high threshold for DTS1
  230. * @arg DTS_FLAG_TS1_RDY : Ready flag for DTS1
  231. * @retval The new state of __FLAG__ (SET or RESET).
  232. */
  233. #define __HAL_DTS_GET_FLAG(__HANDLE__, __FLAG__) \
  234. (((((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__)))? SET : RESET)
  235. /** @brief Clears the specified DTS pending flag.
  236. * @param __HANDLE__ specifies the DTS Handle.
  237. * @param __FLAG__ specifies the flag to check.
  238. * This parameter can be any combination of the following values:
  239. * @arg DTS_FLAG_TS1_ITE : interrupt flag for end of measure for DTS1
  240. * @arg DTS_FLAG_TS1_ITL : interrupt flag for low threshold for DTS1
  241. * @arg DTS_FLAG_TS1_ITH : interrupt flag for high threshold for DTS1
  242. * @arg DTS_FLAG_TS1_AITE: asynchronous interrupt flag for end of measure for DTS1
  243. * @arg DTS_FLAG_TS1_AITL: asynchronous interrupt flag for low threshold for DTS1
  244. * @arg DTS_FLAG_TS1_AITH: asynchronous interrupt flag for high threshold for DTS1
  245. * @retval None
  246. */
  247. #define __HAL_DTS_CLEAR_FLAG(__HANDLE__, __FLAG__) \
  248. ((__HANDLE__)->Instance->ICIFR = (__FLAG__))
  249. /** @brief Enable the specified DTS interrupt.
  250. * @param __HANDLE__ specifies the DTS Handle.
  251. * @param __INTERRUPT__ specifies the DTS interrupt source to enable.
  252. * This parameter can be one of the following values:
  253. * @arg DTS_IT_TS1_ITE : interrupt flag for end of measure for DTS1
  254. * @arg DTS_IT_TS1_ITL : interrupt flag for low of measure for DTS1
  255. * @arg DTS_IT_TS1_ITH : interrupt flag for high of measure for DTS1
  256. * @arg DTS_IT_TS1_AITE : asynchronous interrupt flag for end of measure for DTS1
  257. * @arg DTS_IT_TS1_AITL : asynchronous interrupt flag for low of measure for DTS1
  258. * @arg DTS_IT_TS1_AITH : asynchronous interrupt flag for high of measure for DTS1
  259. * @retval None
  260. */
  261. #define __HAL_DTS_ENABLE_IT(__HANDLE__, __INTERRUPT__) \
  262. SET_BIT((__HANDLE__)->Instance->ITENR, __INTERRUPT__)
  263. /** @brief Disable the specified DTS interrupt.
  264. * @param __HANDLE__ specifies the DTS Handle.
  265. * @param __INTERRUPT__ specifies the DTS interrupt source to enable.
  266. * This parameter can be one of the following values:
  267. * @arg DTS_IT_TS1_ITE : interrupt flag for end of measure for DTS1
  268. * @arg DTS_IT_TS1_ITL : interrupt flag for low of measure for DTS1
  269. * @arg DTS_IT_TS1_ITH : interrupt flag for high of measure for DTS1
  270. * @arg DTS_IT_TS1_AITE : asynchronous interrupt flag for end of measure for DTS1
  271. * @arg DTS_IT_TS1_AITL : asynchronous interrupt flag for low of measure for DTS1
  272. * @arg DTS_IT_TS1_AITH : asynchronous interrupt flag for high of measure for DTS1
  273. * @retval None
  274. */
  275. #define __HAL_DTS_DISABLE_IT(__HANDLE__,__INTERRUPT__) \
  276. CLEAR_BIT((__HANDLE__)->Instance->ITENR, __INTERRUPT__)
  277. /** @brief Check whether the specified DTS interrupt source is enabled or not.
  278. * @param __HANDLE__ DTS handle.
  279. * @param __INTERRUPT__ DTS interrupt source to check
  280. * This parameter can be one of the following values:
  281. * @arg DTS_IT_TS1_ITE : interrupt flag for end of measure for DTS1
  282. * @arg DTS_IT_TS1_ITL : interrupt flag for low of measure for DTS1
  283. * @arg DTS_IT_TS1_ITH : interrupt flag for high of measure for DTS1
  284. * @arg DTS_IT_TS1_AITE : asynchronous interrupt flag for end of measure for DTS1
  285. * @arg DTS_IT_TS1_AITL : asynchronous interrupt flag for low of measure for DTS1
  286. * @arg DTS_IT_TS1_AITH : asynchronous interrupt flag for high of measure for DTS1
  287. * @retval State of interruption (SET or RESET)
  288. */
  289. #define __HAL_DTS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) \
  290. (( ((__HANDLE__)->Instance->ITENR & (__INTERRUPT__)) == (__INTERRUPT__) \
  291. )? SET : RESET)
  292. /** @brief Check whether the specified DTS REFCLK is selected
  293. * @param __HANDLE__ DTS handle.
  294. * @param __REFCLK__ DTS reference clock to check
  295. * This parameter can be one of the following values:
  296. * @arg DTS_REFCLKSEL_LSE: Low speed REF clock
  297. * @arg DTS_REFCLKSEL_PCLK: High speed REF clock
  298. * @retval State of the REF clock tested (SET or RESET)
  299. */
  300. #define __HAL_DTS_GET_REFCLK(__HANDLE__, __REFCLK__) ((((__HANDLE__)->Instance->CFGR1 & (__REFCLK__)) == (__REFCLK__))? SET : RESET)
  301. /** @brief Get Trigger
  302. * @param __HANDLE__ DTS handle.
  303. * @retval One of the following trigger
  304. * DTS_TRIGGER_HW_NONE : No HW trigger (SW trigger)
  305. * DTS_TRIGGER_LPTIMER1: LPTIMER1 trigger
  306. * DTS_TRIGGER_LPTIMER2: LPTIMER2 trigger
  307. * DTS_TRIGGER_LPTIMER3: LPTIMER3 trigger
  308. * DTS_TRIGGER_EXTI13 : EXTI13 trigger
  309. */
  310. #define __HAL_DTS_GET_TRIGGER(__HANDLE__) ((__HANDLE__)->Instance->CFGR1 & (DTS_CFGR1_TS1_INTRIG_SEL))
  311. /**
  312. * @}
  313. */
  314. /* Exported functions --------------------------------------------------------*/
  315. /** @addtogroup DTS_Exported_Functions
  316. * @{
  317. */
  318. /** @addtogroup DTS_Exported_Functions_Group1
  319. * @{
  320. */
  321. /* Initialization and de-initialization functions **********************************/
  322. HAL_StatusTypeDef HAL_DTS_Init(DTS_HandleTypeDef *hdts);
  323. HAL_StatusTypeDef HAL_DTS_DeInit(DTS_HandleTypeDef *hdts);
  324. void HAL_DTS_MspInit(DTS_HandleTypeDef *hdts);
  325. void HAL_DTS_MspDeInit(DTS_HandleTypeDef *hdts);
  326. /**
  327. * @}
  328. */
  329. /* IO operation functions *****************************************************/
  330. /** @addtogroup DTS_Exported_Functions_Group2
  331. * @{
  332. */
  333. HAL_StatusTypeDef HAL_DTS_Start(DTS_HandleTypeDef *hdts);
  334. HAL_StatusTypeDef HAL_DTS_Stop(DTS_HandleTypeDef *hdts);
  335. HAL_StatusTypeDef HAL_DTS_GetTemperature(DTS_HandleTypeDef *hdts, int32_t *Temperature);
  336. HAL_StatusTypeDef HAL_DTS_Start_IT(DTS_HandleTypeDef *hdts);
  337. HAL_StatusTypeDef HAL_DTS_Stop_IT(DTS_HandleTypeDef *hdts);
  338. void HAL_DTS_IRQHandler(DTS_HandleTypeDef *hdts);
  339. HAL_DTS_StateTypeDef HAL_DTS_GetState(DTS_HandleTypeDef *hdts);
  340. /* Callback in Interrupt mode */
  341. void HAL_DTS_EndCallback(DTS_HandleTypeDef *hdts);
  342. void HAL_DTS_LowCallback(DTS_HandleTypeDef *hdts);
  343. void HAL_DTS_HighCallback(DTS_HandleTypeDef *hdts);
  344. void HAL_DTS_AsyncEndCallback(DTS_HandleTypeDef *hdts);
  345. void HAL_DTS_AsyncLowCallback(DTS_HandleTypeDef *hdts);
  346. void HAL_DTS_AsyncHighCallback(DTS_HandleTypeDef *hdts);
  347. /**
  348. * @}
  349. */
  350. /* Private types -------------------------------------------------------------*/
  351. /* Private constants ---------------------------------------------------------*/
  352. /** @defgroup DTS_Private_Constants DTS Private Constants
  353. * @{
  354. */
  355. /** @defgroup DTS_ExtiLine DTS EXTI Lines
  356. * @{
  357. */
  358. #define DTS_EXTI_LINE_DTS1 (EXTI_IMR3_IM88) /*!< EXTI line 88 connected to DTS1 output */
  359. /**
  360. * @}
  361. */
  362. /**
  363. * @}
  364. */
  365. /* Private macros ------------------------------------------------------------*/
  366. /** @defgroup DTS_Private_Macros DTS Private Macros
  367. * @{
  368. */
  369. /** @defgroup DTS_IS_DTS_Definitions DTS Private macros to check input parameters
  370. * @{
  371. */
  372. #define IS_DTS_QUICKMEAS(__SEL__) (((__SEL__) == DTS_QUICKMEAS_DISABLE) || \
  373. ((__SEL__) == DTS_QUICKMEAS_ENABLE))
  374. #define IS_DTS_REFCLK(__SEL__) (((__SEL__) == DTS_REFCLKSEL_LSE) || \
  375. ((__SEL__) == DTS_REFCLKSEL_PCLK))
  376. #define IS_DTS_TRIGGERINPUT(__INPUT__) (((__INPUT__) == DTS_TRIGGER_HW_NONE) || \
  377. ((__INPUT__) == DTS_TRIGGER_LPTIMER1) || \
  378. ((__INPUT__) == DTS_TRIGGER_LPTIMER2) || \
  379. ((__INPUT__) == DTS_TRIGGER_LPTIMER3) || \
  380. ((__INPUT__) == DTS_TRIGGER_EXTI13))
  381. #define IS_DTS_THRESHOLD(__THRESHOLD__) ((__THRESHOLD__) <= 0xFFFFUL)
  382. #define IS_DTS_DIVIDER_RATIO_NUMBER(__NUMBER__) (((__NUMBER__) >= (2UL)) && ((__NUMBER__) <= (127UL)))
  383. #define IS_DTS_SAMPLINGTIME(__CYCLE__) (((__CYCLE__) == DTS_SMP_TIME_1_CYCLE) || \
  384. ((__CYCLE__) == DTS_SMP_TIME_2_CYCLE) || \
  385. ((__CYCLE__) == DTS_SMP_TIME_3_CYCLE) || \
  386. ((__CYCLE__) == DTS_SMP_TIME_4_CYCLE) || \
  387. ((__CYCLE__) == DTS_SMP_TIME_5_CYCLE) || \
  388. ((__CYCLE__) == DTS_SMP_TIME_6_CYCLE) || \
  389. ((__CYCLE__) == DTS_SMP_TIME_7_CYCLE) || \
  390. ((__CYCLE__) == DTS_SMP_TIME_8_CYCLE) || \
  391. ((__CYCLE__) == DTS_SMP_TIME_9_CYCLE) || \
  392. ((__CYCLE__) == DTS_SMP_TIME_10_CYCLE) || \
  393. ((__CYCLE__) == DTS_SMP_TIME_11_CYCLE) || \
  394. ((__CYCLE__) == DTS_SMP_TIME_12_CYCLE) || \
  395. ((__CYCLE__) == DTS_SMP_TIME_13_CYCLE) || \
  396. ((__CYCLE__) == DTS_SMP_TIME_14_CYCLE) || \
  397. ((__CYCLE__) == DTS_SMP_TIME_15_CYCLE))
  398. /**
  399. * @}
  400. */
  401. /**
  402. * @}
  403. */
  404. /* Private functions ---------------------------------------------------------*/
  405. /**
  406. * @}
  407. */
  408. /**
  409. * @}
  410. */
  411. #endif /* DTS */
  412. #ifdef __cplusplus
  413. }
  414. #endif
  415. #endif /* __STM32H7xx_HAL_DTS_H */
  416. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/