Index: ctrl/firmware/Main/CubeMX/Core/Inc/adc.h
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Inc/adc.h	(revision 95)
+++ ctrl/firmware/Main/CubeMX/Core/Inc/adc.h	(revision 96)
@@ -47,8 +47,8 @@
 	struct
 	{
+		uint16_t UBat;
 		uint16_t Vbat;
+		uint16_t Temp;
 		uint16_t Vref;
-		uint16_t CPUTemp;
-		uint16_t UBat;
 	} Name;
 } __attribute__((packed, aligned(32))) ADC3_data_t;
@@ -60,5 +60,5 @@
 /* USER CODE BEGIN Prototypes */
 
-extern volatile uint16_t ADC3_values[2];
+extern volatile ADC3_data_t ADC3Data;
 
 /* USER CODE END Prototypes */
Index: ctrl/firmware/Main/CubeMX/Core/Inc/dts.h
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Inc/dts.h	(revision 96)
+++ ctrl/firmware/Main/CubeMX/Core/Inc/dts.h	(revision 96)
@@ -0,0 +1,52 @@
+/* USER CODE BEGIN Header */
+/**
+  ******************************************************************************
+  * @file    dts.h
+  * @brief   This file contains all the function prototypes for
+  *          the dts.c file
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2025 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+/* USER CODE END Header */
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __DTS_H__
+#define __DTS_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+extern DTS_HandleTypeDef hdts;
+
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+void MX_DTS_Init(void);
+
+/* USER CODE BEGIN Prototypes */
+
+/* USER CODE END Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __DTS_H__ */
+
Index: ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h	(revision 95)
+++ ctrl/firmware/Main/CubeMX/Core/Inc/stm32h7xx_hal_conf.h	(revision 96)
@@ -88,5 +88,5 @@
 /* #define HAL_MDIOS_MODULE_ENABLED   */
 /* #define HAL_PSSI_MODULE_ENABLED   */
-/* #define HAL_DTS_MODULE_ENABLED   */
+#define HAL_DTS_MODULE_ENABLED
 #define HAL_GPIO_MODULE_ENABLED
 #define HAL_DMA_MODULE_ENABLED
Index: ctrl/firmware/Main/CubeMX/Core/Src/adc.c
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Src/adc.c	(revision 95)
+++ ctrl/firmware/Main/CubeMX/Core/Src/adc.c	(revision 96)
@@ -23,5 +23,5 @@
 /* USER CODE BEGIN 0 */
 
-volatile uint16_t ADC3_values[2] __attribute__((section(".BKP_RAM_4_DMA")));
+volatile ADC3_data_t ADC3Data __attribute__((section(".BKP_RAM_4_DMA")));
 
 /* USER CODE END 0 */
@@ -54,5 +54,5 @@
   hadc3.Init.LowPowerAutoWait = DISABLE;
   hadc3.Init.ContinuousConvMode = ENABLE;
-  hadc3.Init.NbrOfConversion = 2;
+  hadc3.Init.NbrOfConversion = 4;
   hadc3.Init.DiscontinuousConvMode = DISABLE;
   hadc3.Init.ExternalTrigConv = ADC_SOFTWARE_START;
@@ -89,6 +89,24 @@
   /** Configure Regular Channel
   */
+  sConfig.Channel = ADC_CHANNEL_VBAT;
+  sConfig.Rank = ADC_REGULAR_RANK_2;
+  if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
+  {
+    Error_Handler();
+  }
+
+  /** Configure Regular Channel
+  */
   sConfig.Channel = ADC_CHANNEL_TEMPSENSOR;
-  sConfig.Rank = ADC_REGULAR_RANK_2;
+  sConfig.Rank = ADC_REGULAR_RANK_3;
+  if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
+  {
+    Error_Handler();
+  }
+
+  /** Configure Regular Channel
+  */
+  sConfig.Channel = ADC_CHANNEL_VREFINT;
+  sConfig.Rank = ADC_REGULAR_RANK_4;
   if (HAL_ADC_ConfigChannel(&hadc3, &sConfig) != HAL_OK)
   {
@@ -103,5 +121,5 @@
 
   //if (HAL_OK != HAL_ADC_Start(&hadc3)) Error_Handler();
-  if (HAL_OK != HAL_ADC_Start_DMA(&hadc3, (uint32_t*)ADC3_values, 2/*ADC3_CHANNELS*/)) Error_Handler();
+  if (HAL_OK != HAL_ADC_Start_DMA(&hadc3, (uint32_t*)&ADC3Data, ADC3_CHANNELS)) Error_Handler();
   //__HAL_DMA_DISABLE_IT(&hdma_adc3, DMA_IT_HT);
 
Index: ctrl/firmware/Main/CubeMX/Core/Src/dts.c
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Src/dts.c	(revision 96)
+++ ctrl/firmware/Main/CubeMX/Core/Src/dts.c	(revision 96)
@@ -0,0 +1,95 @@
+/* USER CODE BEGIN Header */
+/**
+  ******************************************************************************
+  * @file    dts.c
+  * @brief   This file provides code for the configuration
+  *          of the DTS instances.
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2025 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+/* USER CODE END Header */
+/* Includes ------------------------------------------------------------------*/
+#include "dts.h"
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+DTS_HandleTypeDef hdts;
+
+/* DTS init function */
+void MX_DTS_Init(void)
+{
+
+  /* USER CODE BEGIN DTS_Init 0 */
+
+  /* USER CODE END DTS_Init 0 */
+
+  /* USER CODE BEGIN DTS_Init 1 */
+
+  /* USER CODE END DTS_Init 1 */
+  hdts.Instance = DTS;
+  hdts.Init.QuickMeasure = DTS_QUICKMEAS_DISABLE;
+  hdts.Init.RefClock = DTS_REFCLKSEL_LSE;
+  hdts.Init.TriggerInput = DTS_TRIGGER_HW_NONE;
+  hdts.Init.SamplingTime = DTS_SMP_TIME_15_CYCLE;
+  hdts.Init.Divider = 0;
+  hdts.Init.HighThreshold = 0x0;
+  hdts.Init.LowThreshold = 0x0;
+  if (HAL_DTS_Init(&hdts) != HAL_OK)
+  {
+    Error_Handler();
+  }
+  /* USER CODE BEGIN DTS_Init 2 */
+
+  HAL_StatusTypeDef r = HAL_DTS_Start(&hdts);
+  if (r != HAL_OK) Error_Handler();
+
+  /* USER CODE END DTS_Init 2 */
+
+}
+
+void HAL_DTS_MspInit(DTS_HandleTypeDef* dtsHandle)
+{
+
+  if(dtsHandle->Instance==DTS)
+  {
+  /* USER CODE BEGIN DTS_MspInit 0 */
+
+  /* USER CODE END DTS_MspInit 0 */
+    /* DTS clock enable */
+    __HAL_RCC_DTS_CLK_ENABLE();
+  /* USER CODE BEGIN DTS_MspInit 1 */
+
+  /* USER CODE END DTS_MspInit 1 */
+  }
+}
+
+void HAL_DTS_MspDeInit(DTS_HandleTypeDef* dtsHandle)
+{
+
+  if(dtsHandle->Instance==DTS)
+  {
+  /* USER CODE BEGIN DTS_MspDeInit 0 */
+
+  /* USER CODE END DTS_MspDeInit 0 */
+    /* Peripheral clock disable */
+    __HAL_RCC_DTS_CLK_DISABLE();
+  /* USER CODE BEGIN DTS_MspDeInit 1 */
+
+  /* USER CODE END DTS_MspDeInit 1 */
+  }
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
Index: ctrl/firmware/Main/CubeMX/Core/Src/main.c
===================================================================
--- ctrl/firmware/Main/CubeMX/Core/Src/main.c	(revision 95)
+++ ctrl/firmware/Main/CubeMX/Core/Src/main.c	(revision 96)
@@ -23,4 +23,5 @@
 #include "bdma.h"
 #include "dma.h"
+#include "dts.h"
 #include "fatfs.h"
 #include "i2c.h"
@@ -145,4 +146,5 @@
   MX_I2C1_Init();
   MX_USART3_UART_Init();
+  MX_DTS_Init();
   /* USER CODE BEGIN 2 */
 
Index: ctrl/firmware/Main/CubeMX/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dts.h
===================================================================
--- ctrl/firmware/Main/CubeMX/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dts.h	(revision 96)
+++ ctrl/firmware/Main/CubeMX/Drivers/STM32H7xx_HAL_Driver/Inc/stm32h7xx_hal_dts.h	(revision 96)
@@ -0,0 +1,522 @@
+/**
+  ******************************************************************************
+  * @file    stm32h7xx_hal_dts.h
+  * @author  MCD Application Team
+  * @brief   Header file of DTS HAL module.
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2017 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32H7xx_HAL_DTS_H
+#define __STM32H7xx_HAL_DTS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32h7xx_hal_def.h"
+
+
+/** @addtogroup STM32H7xx_HAL_Driver
+  * @{
+  */
+#if defined(DTS)
+/** @addtogroup DTS
+  * @{
+  */
+
+/* Exported types ------------------------------------------------------------*/
+/** @defgroup DTS_Exported_Types DTS Exported Types
+  * @{
+  */
+
+/**
+  * @brief  DTS Init structure definition
+  */
+typedef struct
+{
+  uint32_t QuickMeasure;  /*!< Specifies the quick measure option selection of the DTS sensor.
+                               This parameter can be a value of @ref DTS_Quick_Measurement */
+
+  uint32_t RefClock;      /*!< Specifies the reference clock selection of the DTS sensor.
+                               This parameter can be a value of @ref DTS_Reference_Clock_Selection */
+
+  uint32_t TriggerInput;  /*!< Specifies the trigger input of the DTS sensor.
+                               This parameter can be a value of @ref DTS_TriggerConfig */
+
+  uint32_t SamplingTime;  /*!< Specifies the sampling time configuration.
+                               This parameter can be a value of @ref DTS_Sampling_Time */
+
+  uint32_t Divider;       /*!< Specifies the high speed clock divider ratio.
+                               This parameter can be a value from 0 to 127 */
+
+  uint32_t HighThreshold;  /*!< Specifies the high threshold of the DTS sensor */
+
+  uint32_t LowThreshold;   /*!< Specifies the low threshold of the DTS sensor */
+
+} DTS_InitTypeDef;
+
+/**
+  * @brief  HAL State structures definition
+  */
+typedef enum
+{
+  HAL_DTS_STATE_RESET       = 0x00UL,     /*!< DTS not yet initialized or disabled */
+  HAL_DTS_STATE_READY       = 0x01UL,     /*!< DTS initialized and ready for use   */
+  HAL_DTS_STATE_BUSY        = 0x02UL,     /*!< DTS is running                      */
+  HAL_DTS_STATE_TIMEOUT     = 0x03UL,     /*!< Timeout state                       */
+  HAL_DTS_STATE_ERROR       = 0x04UL      /*!< Internal Process error              */
+} HAL_DTS_StateTypeDef;
+
+/**
+  * @brief  DTS Handle Structure definition
+  */
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+typedef struct __DTS_HandleTypeDef
+#else
+typedef struct
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+{
+  DTS_TypeDef         *Instance;    /*!< Register base address */
+  DTS_InitTypeDef     Init;         /*!< DTS required parameters */
+  HAL_LockTypeDef     Lock;         /*!< DTS Locking object */
+  __IO HAL_DTS_StateTypeDef  State; /*!< DTS peripheral state  */
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+  void (* MspInitCallback)(struct __DTS_HandleTypeDef *hdts);         /*!< DTS Base Msp Init Callback                   */
+  void (* MspDeInitCallback)(struct __DTS_HandleTypeDef *hdts);       /*!< DTS Base Msp DeInit Callback                 */
+  void (* EndCallback)(struct __DTS_HandleTypeDef *hdts);             /*!< End measure Callback                         */
+  void (* LowCallback)(struct __DTS_HandleTypeDef *hdts);             /*!< low threshold Callback                       */
+  void (* HighCallback)(struct __DTS_HandleTypeDef *hdts);            /*!< high threshold Callback                      */
+  void (* AsyncEndCallback)(struct __DTS_HandleTypeDef *hdts);        /*!< Asynchronous end of measure Callback         */
+  void (* AsyncLowCallback)(struct __DTS_HandleTypeDef *hdts);        /*!< Asynchronous low threshold Callback          */
+  void (* AsyncHighCallback)(struct __DTS_HandleTypeDef *hdts);       /*!< Asynchronous high threshold Callback         */
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+} DTS_HandleTypeDef;
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+/**
+  * @brief  DTS callback ID enumeration definition
+  */
+typedef enum
+{
+  HAL_DTS_MEAS_COMPLETE_CB_ID        = 0x00U, /*!< Measure complete callback ID */
+  HAL_DTS_ASYNC_MEAS_COMPLETE_CB_ID  = 0x01U, /*!< Asynchronous measure complete callback ID */
+  HAL_DTS_LOW_THRESHOLD_CB_ID        = 0x02U, /*!< Low threshold detection callback ID */
+  HAL_DTS_ASYNC_LOW_THRESHOLD_CB_ID  = 0x03U, /*!< Asynchronous low threshold detection callback ID */
+  HAL_DTS_HIGH_THRESHOLD_CB_ID       = 0x04U, /*!< High threshold detection callback ID */
+  HAL_DTS_ASYNC_HIGH_THRESHOLD_CB_ID = 0x05U, /*!< Asynchronous high threshold detection callback ID */
+  HAL_DTS_MSPINIT_CB_ID              = 0x06U, /*!< MSP init callback ID */
+  HAL_DTS_MSPDEINIT_CB_ID            = 0x07U  /*!< MSP de-init callback ID */
+} HAL_DTS_CallbackIDTypeDef;
+
+/**
+  * @brief  DTS callback pointers definition
+  */
+typedef void (*pDTS_CallbackTypeDef)(DTS_HandleTypeDef *hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+
+/**
+  * @}
+  */
+
+/* Exported constants --------------------------------------------------------*/
+/** @defgroup DTS_Exported_Constants DTS Exported Constants
+  * @{
+  */
+
+/** @defgroup DTS_TriggerConfig  DTS Trigger Configuration
+  * @{
+  */
+/* @brief No Hardware trigger detection */
+#define DTS_TRIGGER_HW_NONE   (0UL)
+
+/* @brief External Interrupt Mode with LPTIMER1 trigger detection */
+#define DTS_TRIGGER_LPTIMER1  DTS_CFGR1_TS1_INTRIG_SEL_0
+
+/* @brief External Interrupt Mode with LPTIMER2 trigger detection */
+#define DTS_TRIGGER_LPTIMER2  DTS_CFGR1_TS1_INTRIG_SEL_1
+
+/* @brief External Interrupt Mode with LPTIMER3 trigger detection */
+#define DTS_TRIGGER_LPTIMER3 (DTS_CFGR1_TS1_INTRIG_SEL_0 | DTS_CFGR1_TS1_INTRIG_SEL_1)
+
+/* @brief External Interrupt Mode with EXTI13 trigger detection */
+#define DTS_TRIGGER_EXTI13    DTS_CFGR1_TS1_INTRIG_SEL_2
+/**
+  * @}
+  */
+
+/** @defgroup DTS_Quick_Measurement  DTS Quick Measurement
+  * @{
+  */
+#define DTS_QUICKMEAS_ENABLE    DTS_CFGR1_Q_MEAS_OPT      /*!< Enable the Quick Measure (Measure without calibration) */
+#define DTS_QUICKMEAS_DISABLE   (0x0UL)                   /*!< Disable the Quick Measure (Measure with calibration) */
+/**
+  * @}
+  */
+
+/** @defgroup DTS_Reference_Clock_Selection   DTS Reference Clock Selection
+  * @{
+  */
+#define DTS_REFCLKSEL_LSE   DTS_CFGR1_REFCLK_SEL          /*!< Low speed REF clock (LSE) */
+#define DTS_REFCLKSEL_PCLK (0UL)                          /*!< High speed REF clock (PCLK) */
+/**
+  * @}
+  */
+
+/** @defgroup DTS_Sampling_Time   DTS Sampling Time
+  * @{
+  */
+#define DTS_SMP_TIME_1_CYCLE     DTS_CFGR1_TS1_SMP_TIME_0                                                                                   /*!< 1 clock cycle for the sampling time  */
+#define DTS_SMP_TIME_2_CYCLE     DTS_CFGR1_TS1_SMP_TIME_1                                                                                   /*!< 2 clock cycle for the sampling time  */
+#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  */
+#define DTS_SMP_TIME_4_CYCLE    (DTS_CFGR1_TS1_SMP_TIME_2)                                                                                 /*!< 4 clock cycle for the sampling time  */
+#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  */
+#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  */
+#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  */
+#define DTS_SMP_TIME_8_CYCLE    (DTS_CFGR1_TS1_SMP_TIME_3)                                                                                  /*!< 8 clock cycle for the sampling time  */
+#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  */
+#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 */
+#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 */
+#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 */
+#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 */
+#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 */
+#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 */
+/**
+  * @}
+  */
+/** @defgroup DTS_Flag_Definitions DTS Flag Definitions
+  * @{
+  */
+#define DTS_FLAG_TS1_ITE   DTS_SR_TS1_ITEF   /*!< Interrupt flag for end of measure for DTS1 */
+#define DTS_FLAG_TS1_ITL   DTS_SR_TS1_ITLF   /*!< Interrupt flag for low threshold for DTS1  */
+#define DTS_FLAG_TS1_ITH   DTS_SR_TS1_ITHF   /*!< Interrupt flag for high threshold for DTS1 */
+#define DTS_FLAG_TS1_AITE  DTS_SR_TS1_AITEF  /*!< Asynchronous Interrupt flag for end of measure for DTS1 */
+#define DTS_FLAG_TS1_AITL  DTS_SR_TS1_AITLF  /*!< Asynchronous Interrupt flag for low threshold for DTS1  */
+#define DTS_FLAG_TS1_AITH  DTS_SR_TS1_AITHF  /*!< Asynchronous Interrupt flag for high threshold for DTS1 */
+#define DTS_FLAG_TS1_RDY   DTS_SR_TS1_RDY    /*!< Ready flag for DTS1 */
+/**
+  * @}
+  */
+
+/** @defgroup DTS_Interrupts_Definitions DTS Interrupts Definitions
+  * @{
+  */
+#define DTS_IT_TS1_ITE  DTS_ITENR_TS1_ITEEN   /*!< Enable interrupt flag for end of measure for DTS1 */
+#define DTS_IT_TS1_ITL  DTS_ITENR_TS1_ITLEN   /*!< Enable interrupt flag for low threshold for DTS1  */
+#define DTS_IT_TS1_ITH  DTS_ITENR_TS1_ITHEN   /*!< Enable interrupt flag for high threshold for DTS1 */
+#define DTS_IT_TS1_AITE DTS_ITENR_TS1_AITEEN  /*!< Enable asynchronous interrupt flag for end of measure for DTS1 */
+#define DTS_IT_TS1_AITL DTS_ITENR_TS1_AITLEN  /*!< Enable asynchronous interrupt flag for low threshold for DTS1  */
+#define DTS_IT_TS1_AITH DTS_ITENR_TS1_AITHEN  /*!< Enable asynchronous interrupt flag for high threshold for DTS1 */
+/**
+  * @}
+  */
+
+/**
+  * @}
+  */
+/* Exported macros -----------------------------------------------------------*/
+/** @defgroup DTS_Exported_Macros DTS Exported Macros
+  * @{
+  */
+
+/** @brief  Reset DTS handle state
+  * @param  __HANDLE__ DTS handle.
+  * @retval None
+  */
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+#define __HAL_DTS_RESET_HANDLE_STATE(__HANDLE__) do{                                             \
+                                                      (__HANDLE__)->State = HAL_DTS_STATE_RESET; \
+                                                      (__HANDLE__)->MspInitCallback = NULL;      \
+                                                      (__HANDLE__)->MspDeInitCallback = NULL;    \
+                                                    } while(0)
+#else /* USE_HAL_DTS_REGISTER_CALLBACKS */
+#define __HAL_DTS_RESET_HANDLE_STATE(__HANDLE__)    ((__HANDLE__)->State = HAL_DTS_STATE_RESET)
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+
+/**
+  * @brief  Enable the specified DTS sensor
+  * @param  __HANDLE__ DTS handle.
+  * @retval None
+  */
+#define __HAL_DTS_ENABLE(__HANDLE__)  SET_BIT((__HANDLE__)->Instance->CFGR1, DTS_CFGR1_TS1_EN)
+
+/**
+  * @brief  Disable the specified DTS sensor
+  * @param  __HANDLE__ DTS handle.
+  * @retval None
+  */
+#define __HAL_DTS_DISABLE(__HANDLE__)    CLEAR_BIT((__HANDLE__)->Instance->CFGR1, DTS_CFGR1_TS1_EN)
+
+/**
+  * @brief  Enable the DTS EXTI line in interrupt mode
+  * @retval None
+  */
+#define __HAL_DTS_EXTI_WAKEUP_ENABLE_IT()  SET_BIT(EXTI->IMR3, DTS_EXTI_LINE_DTS1)
+
+/**
+  * @brief  Disable the DTS EXTI line in interrupt mode
+  * @retval None
+  */
+#define __HAL_DTS_EXTI_WAKEUP_DISABLE_IT()  CLEAR_BIT(EXTI->IMR3, DTS_EXTI_LINE_DTS1)
+
+/**
+  * @brief  Enable the DTS EXTI Line in event mode
+  * @retval None
+  */
+#define __HAL_DTS_EXTI_WAKEUP_ENABLE_EVENT() SET_BIT(EXTI->EMR3, DTS_EXTI_LINE_DTS1)
+
+/**
+  * @brief  Disable the DTS EXTI Line in event mode
+  * @retval None
+  */
+#define __HAL_DTS_EXTI_WAKEUP_DISABLE_EVENT()  CLEAR_BIT(EXTI->EMR3, DTS_EXTI_LINE_DTS1)
+
+/** @brief  Checks whether the specified DTS flag is set or not.
+  * @param  __HANDLE__ specifies the DTS Handle.
+  * @param  __FLAG__ specifies the flag to check.
+  *        This parameter can be one of the following values:
+  *            @arg DTS_FLAG_TS1_ITE : interrupt flag for end of measure for DTS1
+  *            @arg DTS_FLAG_TS1_ITL : interrupt flag for low threshold for DTS1
+  *            @arg DTS_FLAG_TS1_ITH : interrupt flag for high threshold for DTS1
+  *            @arg DTS_FLAG_TS1_AITE: asynchronous interrupt flag for end of measure for DTS1
+  *            @arg DTS_FLAG_TS1_AITL: asynchronous interrupt flag for low threshold for DTS1
+  *            @arg DTS_FLAG_TS1_AITH: asynchronous interrupt flag for high threshold for DTS1
+  *            @arg DTS_FLAG_TS1_RDY : Ready flag for DTS1
+  *            @retval The new state of __FLAG__ (SET or RESET).
+  */
+#define __HAL_DTS_GET_FLAG(__HANDLE__, __FLAG__)  \
+        (((((__HANDLE__)->Instance->SR &(__FLAG__)) == (__FLAG__)))? SET : RESET)
+
+
+/** @brief  Clears the specified DTS pending flag.
+  * @param  __HANDLE__ specifies the DTS Handle.
+  * @param  __FLAG__ specifies the flag to check.
+  *          This parameter can be any combination of the following values:
+  *            @arg DTS_FLAG_TS1_ITE : interrupt flag for end of measure for DTS1
+  *            @arg DTS_FLAG_TS1_ITL : interrupt flag for low threshold for DTS1
+  *            @arg DTS_FLAG_TS1_ITH : interrupt flag for high threshold for DTS1
+  *            @arg DTS_FLAG_TS1_AITE: asynchronous interrupt flag for end of measure for DTS1
+  *            @arg DTS_FLAG_TS1_AITL: asynchronous interrupt flag for low threshold for DTS1
+  *            @arg DTS_FLAG_TS1_AITH: asynchronous interrupt flag for high threshold for DTS1
+  * @retval None
+  */
+#define __HAL_DTS_CLEAR_FLAG(__HANDLE__, __FLAG__)  \
+        ((__HANDLE__)->Instance->ICIFR  = (__FLAG__))
+
+
+/** @brief  Enable the specified DTS interrupt.
+  * @param  __HANDLE__ specifies the DTS Handle.
+  * @param  __INTERRUPT__ specifies the DTS interrupt source to enable.
+  *          This parameter can be one of the following values:
+  *            @arg DTS_IT_TS1_ITE  : interrupt flag for end of measure for DTS1
+  *            @arg DTS_IT_TS1_ITL  : interrupt flag for low of measure for DTS1
+  *            @arg DTS_IT_TS1_ITH  : interrupt flag for high of measure for DTS1
+  *            @arg DTS_IT_TS1_AITE : asynchronous interrupt flag for end of measure for DTS1
+  *            @arg DTS_IT_TS1_AITL : asynchronous interrupt flag for low of measure for DTS1
+  *            @arg DTS_IT_TS1_AITH : asynchronous interrupt flag for high of measure for DTS1
+  * @retval None
+  */
+#define __HAL_DTS_ENABLE_IT(__HANDLE__, __INTERRUPT__)  \
+        SET_BIT((__HANDLE__)->Instance->ITENR, __INTERRUPT__)
+
+
+/** @brief  Disable the specified DTS interrupt.
+  * @param  __HANDLE__ specifies the DTS Handle.
+  * @param  __INTERRUPT__ specifies the DTS interrupt source to enable.
+  *          This parameter can be one of the following values:
+  *            @arg DTS_IT_TS1_ITE  : interrupt flag for end of measure for DTS1
+  *            @arg DTS_IT_TS1_ITL  : interrupt flag for low of measure for DTS1
+  *            @arg DTS_IT_TS1_ITH  : interrupt flag for high of measure for DTS1
+  *            @arg DTS_IT_TS1_AITE : asynchronous interrupt flag for end of measure for DTS1
+  *            @arg DTS_IT_TS1_AITL : asynchronous interrupt flag for low of measure for DTS1
+  *            @arg DTS_IT_TS1_AITH : asynchronous interrupt flag for high of measure for DTS1
+  * @retval None
+  */
+#define __HAL_DTS_DISABLE_IT(__HANDLE__,__INTERRUPT__)  \
+        CLEAR_BIT((__HANDLE__)->Instance->ITENR, __INTERRUPT__)
+
+
+/** @brief  Check whether the specified DTS interrupt source is enabled or not.
+  * @param __HANDLE__ DTS handle.
+  * @param __INTERRUPT__ DTS interrupt source to check
+  *          This parameter can be one of the following values:
+  *            @arg DTS_IT_TS1_ITE  : interrupt flag for end of measure for DTS1
+  *            @arg DTS_IT_TS1_ITL  : interrupt flag for low of measure for DTS1
+  *            @arg DTS_IT_TS1_ITH  : interrupt flag for high of measure for DTS1
+  *            @arg DTS_IT_TS1_AITE : asynchronous interrupt flag for end of measure for DTS1
+  *            @arg DTS_IT_TS1_AITL : asynchronous interrupt flag for low of measure for DTS1
+  *            @arg DTS_IT_TS1_AITH : asynchronous interrupt flag for high of measure for DTS1
+  * @retval State of interruption (SET or RESET)
+  */
+#define __HAL_DTS_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)  \
+        (( ((__HANDLE__)->Instance->ITENR & (__INTERRUPT__)) == (__INTERRUPT__) \
+        )? SET : RESET)
+
+
+/** @brief  Check whether the specified DTS REFCLK is selected
+  * @param __HANDLE__ DTS handle.
+  * @param __REFCLK__ DTS reference clock to check
+  *          This parameter can be one of the following values:
+  * @arg DTS_REFCLKSEL_LSE:   Low speed REF clock
+  * @arg DTS_REFCLKSEL_PCLK:  High speed REF clock
+  * @retval State of the REF clock tested (SET or RESET)
+  */
+#define __HAL_DTS_GET_REFCLK(__HANDLE__, __REFCLK__)  ((((__HANDLE__)->Instance->CFGR1 & (__REFCLK__)) == (__REFCLK__))? SET : RESET)
+
+/** @brief  Get Trigger
+  * @param __HANDLE__ DTS handle.
+  * @retval One of the following trigger
+  *     DTS_TRIGGER_HW_NONE : No HW trigger (SW trigger)
+  *     DTS_TRIGGER_LPTIMER1: LPTIMER1 trigger
+  *     DTS_TRIGGER_LPTIMER2: LPTIMER2 trigger
+  *     DTS_TRIGGER_LPTIMER3: LPTIMER3 trigger
+  *     DTS_TRIGGER_EXTI13  : EXTI13 trigger
+  */
+#define __HAL_DTS_GET_TRIGGER(__HANDLE__)  ((__HANDLE__)->Instance->CFGR1 & (DTS_CFGR1_TS1_INTRIG_SEL))
+/**
+  * @}
+  */
+
+/* Exported functions --------------------------------------------------------*/
+/** @addtogroup DTS_Exported_Functions
+  * @{
+  */
+
+/** @addtogroup DTS_Exported_Functions_Group1
+  * @{
+  */
+/* Initialization and de-initialization functions  **********************************/
+HAL_StatusTypeDef HAL_DTS_Init(DTS_HandleTypeDef *hdts);
+HAL_StatusTypeDef HAL_DTS_DeInit(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_MspInit(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_MspDeInit(DTS_HandleTypeDef *hdts);
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+HAL_StatusTypeDef HAL_DTS_RegisterCallback(DTS_HandleTypeDef        *hdts,
+                                           HAL_DTS_CallbackIDTypeDef CallbackID,
+                                           pDTS_CallbackTypeDef      pCallback);
+HAL_StatusTypeDef HAL_DTS_UnRegisterCallback(DTS_HandleTypeDef        *hdts,
+                                             HAL_DTS_CallbackIDTypeDef CallbackID);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+/**
+  * @}
+  */
+
+/* IO operation functions  *****************************************************/
+/** @addtogroup DTS_Exported_Functions_Group2
+  * @{
+  */
+HAL_StatusTypeDef HAL_DTS_Start(DTS_HandleTypeDef *hdts);
+HAL_StatusTypeDef HAL_DTS_Stop(DTS_HandleTypeDef *hdts);
+HAL_StatusTypeDef HAL_DTS_GetTemperature(DTS_HandleTypeDef *hdts, int32_t *Temperature);
+HAL_StatusTypeDef HAL_DTS_Start_IT(DTS_HandleTypeDef *hdts);
+HAL_StatusTypeDef HAL_DTS_Stop_IT(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_IRQHandler(DTS_HandleTypeDef *hdts);
+HAL_DTS_StateTypeDef HAL_DTS_GetState(const DTS_HandleTypeDef *hdts);
+/* Callback in Interrupt mode */
+void              HAL_DTS_EndCallback(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_LowCallback(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_HighCallback(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_AsyncEndCallback(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_AsyncLowCallback(DTS_HandleTypeDef *hdts);
+void              HAL_DTS_AsyncHighCallback(DTS_HandleTypeDef *hdts);
+/**
+  * @}
+  */
+/**
+  * @}
+  */
+
+/* Private types -------------------------------------------------------------*/
+/* Private constants ---------------------------------------------------------*/
+/** @defgroup DTS_Private_Constants DTS Private Constants
+  * @{
+  */
+/** @defgroup DTS_ExtiLine DTS EXTI Lines
+  * @{
+  */
+#define DTS_EXTI_LINE_DTS1           (EXTI_IMR3_IM88)  /*!< EXTI line 88 connected to DTS1 output */
+/**
+  * @}
+  */
+/**
+  * @}
+  */
+
+/* Private macros ------------------------------------------------------------*/
+/** @defgroup DTS_Private_Macros DTS Private Macros
+  * @{
+  */
+
+/** @defgroup DTS_IS_DTS_Definitions  DTS Private macros to check input parameters
+  * @{
+  */
+#define IS_DTS_QUICKMEAS(__SEL__)   (((__SEL__) == DTS_QUICKMEAS_DISABLE) || \
+                                     ((__SEL__) == DTS_QUICKMEAS_ENABLE))
+
+#define IS_DTS_REFCLK(__SEL__)      (((__SEL__) == DTS_REFCLKSEL_LSE) || \
+                                     ((__SEL__) == DTS_REFCLKSEL_PCLK))
+
+#define IS_DTS_TRIGGERINPUT(__INPUT__)  (((__INPUT__) == DTS_TRIGGER_HW_NONE)   || \
+                                         ((__INPUT__) == DTS_TRIGGER_LPTIMER1)  || \
+                                         ((__INPUT__) == DTS_TRIGGER_LPTIMER2)  || \
+                                         ((__INPUT__) == DTS_TRIGGER_LPTIMER3)  || \
+                                         ((__INPUT__) == DTS_TRIGGER_EXTI13))
+
+#define IS_DTS_THRESHOLD(__THRESHOLD__)  ((__THRESHOLD__) <= 0xFFFFUL)
+
+#define IS_DTS_DIVIDER_RATIO_NUMBER(__NUMBER__) ((__NUMBER__) <= 127UL)
+
+#define IS_DTS_SAMPLINGTIME(__CYCLE__)  (((__CYCLE__) == DTS_SMP_TIME_1_CYCLE)  || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_2_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_3_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_4_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_5_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_6_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_7_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_8_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_9_CYCLE)    || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_10_CYCLE)   || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_11_CYCLE)   || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_12_CYCLE)   || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_13_CYCLE)   || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_14_CYCLE)   || \
+                                             ((__CYCLE__) == DTS_SMP_TIME_15_CYCLE))
+
+/**
+  * @}
+  */
+
+/**
+  * @}
+  */
+
+/* Private functions ---------------------------------------------------------*/
+
+/**
+  * @}
+  */
+
+/**
+  * @}
+  */
+
+#endif /* DTS */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32H7xx_HAL_DTS_H */
+
Index: ctrl/firmware/Main/CubeMX/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dts.c
===================================================================
--- ctrl/firmware/Main/CubeMX/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dts.c	(revision 96)
+++ ctrl/firmware/Main/CubeMX/Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dts.c	(revision 96)
@@ -0,0 +1,981 @@
+/**
+  ******************************************************************************
+  * @file    stm32h7xx_hal_dts.c
+  * @author  MCD Application Team
+  * @brief   DTS HAL module driver.
+  *          This file provides firmware functions to manage the following
+  *          functionalities of the DTS peripheral:
+  *           + Initialization and de-initialization functions
+  *           + Start/Stop operation functions in polling mode.
+  *           + Start/Stop operation functions in interrupt mode.
+  *           + Peripheral Control functions
+  *           + Peripheral State functions
+  *
+  ******************************************************************************
+  * @attention
+  *
+  * Copyright (c) 2017 STMicroelectronics.
+  * All rights reserved.
+  *
+  * This software is licensed under terms that can be found in the LICENSE file
+  * in the root directory of this software component.
+  * If no LICENSE file comes with this software, it is provided AS-IS.
+  *
+  ******************************************************************************
+  @verbatim
+================================================================================
+          ##### DTS Peripheral features #####
+================================================================================
+
+  [..]
+      The STM32h7xx device family integrate one DTS sensor interface :
+
+
+            ##### How to use this driver #####
+================================================================================
+  [..]
+
+
+  @endverbatim
+  ******************************************************************************
+  */
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32h7xx_hal.h"
+
+/** @addtogroup STM32H7xx_HAL_Driver
+  * @{
+  */
+
+#ifdef HAL_DTS_MODULE_ENABLED
+
+#if defined(DTS)
+
+/** @defgroup DTS DTS
+  * @brief DTS HAL module driver
+  * @{
+  */
+
+/* Private typedef -----------------------------------------------------------*/
+/* Private define ------------------------------------------------------------*/
+/** @addtogroup DTS_Private_Constants
+  * @{
+  */
+
+/* @brief Delay for DTS startup time
+ * @note  Delay required to get ready for DTS Block.
+ * @note  Unit: ms
+ */
+#define DTS_DELAY_STARTUP (1UL)
+
+/* @brief DTS measure ready flag time out value.
+ * @note  Maximal measurement time is when LSE is selected as ref_clock and
+ *        maximal sampling time is used, taking calibration into account this
+ *        is equivalent to ~620 us. Use 5 ms as arbitrary timeout
+ * @note Unit: ms
+ */
+#define TS_TIMEOUT_MS     (5UL)
+
+/* @brief DTS factory temperatures
+ * @note  Unit: degree Celsius
+ */
+#define DTS_FACTORY_TEMPERATURE1 (30UL)
+#define DTS_FACTORY_TEMPERATURE2 (130UL)
+
+/**
+  * @}
+  */
+
+/* Private macro -------------------------------------------------------------*/
+/* Private variables ---------------------------------------------------------*/
+/* Private function prototypes -----------------------------------------------*/
+/* Exported functions --------------------------------------------------------*/
+
+/** @defgroup DTS_Exported_Functions DTS Exported Functions
+  * @{
+  */
+
+/** @defgroup DTS_Exported_Functions_Group1 Initialization/de-initialization functions
+ *  @brief    Initialization and de-initialization functions.
+ *
+@verbatim
+ ===============================================================================
+              ##### Initialization and de-initialization functions #####
+ ===============================================================================
+    [..]  This section provides functions to initialize and de-initialize comparators
+
+@endverbatim
+  * @{
+  */
+
+/**
+  * @brief  Initialize the DTS according to the specified
+  *         parameters in the DTS_InitTypeDef and initialize the associated handle.
+  * @param  hdts  DTS handle
+  * @retval HAL status
+  */
+HAL_StatusTypeDef HAL_DTS_Init(DTS_HandleTypeDef *hdts)
+{
+  /* Check the DTS handle allocation */
+  if (hdts == NULL)
+  {
+    return HAL_ERROR;
+  }
+
+  /* Check the parameters */
+  assert_param(IS_DTS_ALL_INSTANCE(hdts->Instance));
+  assert_param(IS_DTS_QUICKMEAS(hdts->Init.QuickMeasure));
+  assert_param(IS_DTS_REFCLK(hdts->Init.RefClock));
+  assert_param(IS_DTS_TRIGGERINPUT(hdts->Init.TriggerInput));
+  assert_param(IS_DTS_SAMPLINGTIME(hdts->Init.SamplingTime));
+  assert_param(IS_DTS_THRESHOLD(hdts->Init.HighThreshold));
+  assert_param(IS_DTS_THRESHOLD(hdts->Init.LowThreshold));
+
+  if (hdts->State == HAL_DTS_STATE_RESET)
+  {
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+    /* Reset the DTS callback to the legacy weak callbacks */
+    hdts->EndCallback       = HAL_DTS_EndCallback;        /* End measure Callback                 */
+    hdts->LowCallback       = HAL_DTS_LowCallback;        /* low threshold Callback               */
+    hdts->HighCallback      = HAL_DTS_HighCallback;       /* high threshold Callback              */
+    hdts->AsyncEndCallback  = HAL_DTS_AsyncEndCallback;   /* Asynchronous end of measure Callback */
+    hdts->AsyncLowCallback  = HAL_DTS_AsyncLowCallback;   /* Asynchronous low threshold Callback  */
+    hdts->AsyncHighCallback = HAL_DTS_AsyncHighCallback;  /* Asynchronous high threshold Callback */
+
+    if (hdts->MspInitCallback == NULL)
+    {
+      hdts->MspInitCallback = HAL_DTS_MspInit;
+    }
+
+    /* Init the low level hardware : GPIO, CLOCK, NVIC */
+    hdts->MspInitCallback(hdts);
+#else
+    /* Init the low level hardware : GPIO, CLOCK, NVIC */
+    HAL_DTS_MspInit(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+  }
+
+  /* Change the DTS state */
+  hdts->State = HAL_DTS_STATE_BUSY;
+
+  /* Check ramp coefficient */
+  if (hdts->Instance->RAMPVALR == 0UL)
+  {
+    return HAL_ERROR;
+  }
+
+  /* Check factory calibration temperature  */
+  if (hdts->Instance->T0VALR1 == 0UL)
+  {
+    return HAL_ERROR;
+  }
+
+  /* Check Quick Measure option is enabled or disabled */
+  if (hdts->Init.QuickMeasure == DTS_QUICKMEAS_DISABLE)
+  {
+    /* Check Reference clock selection */
+    if (hdts->Init.RefClock == DTS_REFCLKSEL_PCLK)
+    {
+      assert_param(IS_DTS_DIVIDER_RATIO_NUMBER(hdts->Init.Divider));
+    }
+    /* Quick measurement mode disabled */
+    CLEAR_BIT(hdts->Instance->CFGR1, DTS_CFGR1_Q_MEAS_OPT);
+  }
+  else
+  {
+    /* DTS_QUICKMEAS_ENABLE shall be used only when the LSE clock is
+       selected as reference clock */
+    if (hdts->Init.RefClock != DTS_REFCLKSEL_LSE)
+    {
+      return HAL_ERROR;
+    }
+
+    /* Quick measurement mode enabled - no calibration needed */
+    SET_BIT(hdts->Instance->CFGR1, DTS_CFGR1_Q_MEAS_OPT);
+  }
+
+  /* set the DTS clk source */
+  if (hdts->Init.RefClock == DTS_REFCLKSEL_LSE)
+  {
+    SET_BIT(hdts->Instance->CFGR1, DTS_CFGR1_REFCLK_SEL);
+  }
+  else
+  {
+    CLEAR_BIT(hdts->Instance->CFGR1, DTS_CFGR1_REFCLK_SEL);
+  }
+
+  MODIFY_REG(hdts->Instance->CFGR1, DTS_CFGR1_HSREF_CLK_DIV, (hdts->Init.Divider << DTS_CFGR1_HSREF_CLK_DIV_Pos));
+  MODIFY_REG(hdts->Instance->CFGR1, DTS_CFGR1_TS1_SMP_TIME, hdts->Init.SamplingTime);
+  MODIFY_REG(hdts->Instance->CFGR1, DTS_CFGR1_TS1_INTRIG_SEL, hdts->Init.TriggerInput);
+  MODIFY_REG(hdts->Instance->ITR1, DTS_ITR1_TS1_HITTHD, (hdts->Init.HighThreshold << DTS_ITR1_TS1_HITTHD_Pos));
+  MODIFY_REG(hdts->Instance->ITR1, DTS_ITR1_TS1_LITTHD, hdts->Init.LowThreshold);
+
+  /* Change the DTS state */
+  hdts->State = HAL_DTS_STATE_READY;
+
+  return HAL_OK;
+}
+
+/**
+  * @brief  DeInitialize the DTS peripheral.
+  * @note   Deinitialization cannot be performed if the DTS configuration is locked.
+  *         To unlock the configuration, perform a system reset.
+  * @param  hdts  DTS handle
+  * @retval HAL status
+  */
+HAL_StatusTypeDef HAL_DTS_DeInit(DTS_HandleTypeDef *hdts)
+{
+  /* Check the DTS handle allocation */
+  if (hdts == NULL)
+  {
+    return HAL_ERROR;
+  }
+
+  /* Check the parameter */
+  assert_param(IS_DTS_ALL_INSTANCE(hdts->Instance));
+
+  /* Set DTS_CFGR register to reset value */
+  CLEAR_REG(hdts->Instance->CFGR1);
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+  if (hdts->MspDeInitCallback == NULL)
+  {
+    hdts->MspDeInitCallback = HAL_DTS_MspDeInit;
+  }
+
+  /* DeInit the low level hardware: CLOCK, NVIC.*/
+  hdts->MspDeInitCallback(hdts);
+#else
+  /* DeInit the low level hardware: CLOCK, NVIC.*/
+  HAL_DTS_MspDeInit(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+
+  hdts->State = HAL_DTS_STATE_RESET;
+
+  return HAL_OK;
+}
+
+/**
+  * @brief  Initialize the DTS MSP.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_MspInit(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_MspInit could be implemented in the user file
+  */
+}
+
+/**
+  * @brief  DeInitialize the DTS MSP.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_MspDeInit(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_MspDeInit could be implemented in the user file
+  */
+}
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+/**
+  * @brief  Register a user DTS callback to be used instead of the weak predefined callback.
+  * @param  hdts DTS handle.
+  * @param  CallbackID ID of the callback to be registered.
+  *         This parameter can be one of the following values:
+  *           @arg @ref HAL_DTS_MEAS_COMPLETE_CB_ID measure complete callback ID.
+  *           @arg @ref HAL_DTS_ASYNC_MEAS_COMPLETE_CB_ID asynchronous measure complete callback ID.
+  *           @arg @ref HAL_DTS_LOW_THRESHOLD_CB_ID low threshold detection callback ID.
+  *           @arg @ref HAL_DTS_ASYNC_LOW_THRESHOLD_CB_ID asynchronous low threshold detection callback ID.
+  *           @arg @ref HAL_DTS_HIGH_THRESHOLD_CB_ID high threshold detection callback ID.
+  *           @arg @ref HAL_DTS_ASYNC_HIGH_THRESHOLD_CB_ID asynchronous high threshold detection callback ID.
+  *           @arg @ref HAL_DTS_MSPINIT_CB_ID MSP init callback ID.
+  *           @arg @ref HAL_DTS_MSPDEINIT_CB_ID MSP de-init callback ID.
+  * @param  pCallback pointer to the callback function.
+  * @retval HAL status.
+  */
+HAL_StatusTypeDef HAL_DTS_RegisterCallback(DTS_HandleTypeDef        *hdts,
+                                           HAL_DTS_CallbackIDTypeDef CallbackID,
+                                           pDTS_CallbackTypeDef      pCallback)
+{
+  HAL_StatusTypeDef status = HAL_OK;
+
+  /* Check parameters */
+  if (pCallback == NULL)
+  {
+    /* Update status */
+    status = HAL_ERROR;
+  }
+  else
+  {
+    if (hdts->State == HAL_DTS_STATE_READY)
+    {
+      switch (CallbackID)
+      {
+        case HAL_DTS_MEAS_COMPLETE_CB_ID :
+          hdts->EndCallback = pCallback;
+          break;
+        case HAL_DTS_ASYNC_MEAS_COMPLETE_CB_ID :
+          hdts->AsyncEndCallback = pCallback;
+          break;
+        case HAL_DTS_LOW_THRESHOLD_CB_ID :
+          hdts->LowCallback = pCallback;
+          break;
+        case HAL_DTS_ASYNC_LOW_THRESHOLD_CB_ID :
+          hdts->AsyncLowCallback = pCallback;
+          break;
+        case HAL_DTS_HIGH_THRESHOLD_CB_ID :
+          hdts->HighCallback = pCallback;
+          break;
+        case HAL_DTS_ASYNC_HIGH_THRESHOLD_CB_ID :
+          hdts->AsyncHighCallback = pCallback;
+          break;
+        case HAL_DTS_MSPINIT_CB_ID :
+          hdts->MspInitCallback = pCallback;
+          break;
+        case HAL_DTS_MSPDEINIT_CB_ID :
+          hdts->MspDeInitCallback = pCallback;
+          break;
+        default :
+          /* Update status */
+          status = HAL_ERROR;
+          break;
+      }
+    }
+    else if (hdts->State == HAL_DTS_STATE_RESET)
+    {
+      switch (CallbackID)
+      {
+        case HAL_DTS_MSPINIT_CB_ID :
+          hdts->MspInitCallback = pCallback;
+          break;
+        case HAL_DTS_MSPDEINIT_CB_ID :
+          hdts->MspDeInitCallback = pCallback;
+          break;
+        default :
+          /* Update status */
+          status = HAL_ERROR;
+          break;
+      }
+    }
+    else
+    {
+      /* Update status */
+      status = HAL_ERROR;
+    }
+  }
+
+  /* Return function status */
+  return status;
+}
+
+/**
+  * @brief  Unregister a user DTS callback.
+  *         DTS callback is redirected to the weak predefined callback.
+  * @param  hdts DTS handle.
+  * @param  CallbackID ID of the callback to be unregistered.
+  *         This parameter can be one of the following values:
+  *           @arg @ref HAL_DTS_MEAS_COMPLETE_CB_ID measure complete callback ID.
+  *           @arg @ref HAL_DTS_ASYNC_MEAS_COMPLETE_CB_ID asynchronous measure complete callback ID.
+  *           @arg @ref HAL_DTS_LOW_THRESHOLD_CB_ID low threshold detection callback ID.
+  *           @arg @ref HAL_DTS_ASYNC_LOW_THRESHOLD_CB_ID asynchronous low threshold detection callback ID.
+  *           @arg @ref HAL_DTS_HIGH_THRESHOLD_CB_ID high threshold detection callback ID.
+  *           @arg @ref HAL_DTS_ASYNC_HIGH_THRESHOLD_CB_ID asynchronous high threshold detection callback ID.
+  *           @arg @ref HAL_DTS_MSPINIT_CB_ID MSP init callback ID.
+  *           @arg @ref HAL_DTS_MSPDEINIT_CB_ID MSP de-init callback ID.
+  * @retval HAL status.
+  */
+HAL_StatusTypeDef HAL_DTS_UnRegisterCallback(DTS_HandleTypeDef        *hdts,
+                                             HAL_DTS_CallbackIDTypeDef CallbackID)
+{
+  HAL_StatusTypeDef status = HAL_OK;
+
+  if (hdts->State == HAL_DTS_STATE_READY)
+  {
+    switch (CallbackID)
+    {
+      case HAL_DTS_MEAS_COMPLETE_CB_ID :
+        hdts->EndCallback = HAL_DTS_EndCallback;
+        break;
+      case HAL_DTS_ASYNC_MEAS_COMPLETE_CB_ID :
+        hdts->AsyncEndCallback = HAL_DTS_AsyncEndCallback;
+        break;
+      case HAL_DTS_LOW_THRESHOLD_CB_ID :
+        hdts->LowCallback = HAL_DTS_LowCallback;
+        break;
+      case HAL_DTS_ASYNC_LOW_THRESHOLD_CB_ID :
+        hdts->AsyncLowCallback = HAL_DTS_AsyncLowCallback;
+        break;
+      case HAL_DTS_HIGH_THRESHOLD_CB_ID :
+        hdts->HighCallback = HAL_DTS_HighCallback;
+        break;
+      case HAL_DTS_ASYNC_HIGH_THRESHOLD_CB_ID :
+        hdts->AsyncHighCallback = HAL_DTS_AsyncHighCallback;
+        break;
+      case HAL_DTS_MSPINIT_CB_ID :
+        hdts->MspInitCallback = HAL_DTS_MspInit;
+        break;
+      case HAL_DTS_MSPDEINIT_CB_ID :
+        hdts->MspDeInitCallback = HAL_DTS_MspDeInit;
+        break;
+      default :
+        /* Update status */
+        status = HAL_ERROR;
+        break;
+    }
+  }
+  else if (hdts->State == HAL_DTS_STATE_RESET)
+  {
+    switch (CallbackID)
+    {
+      case HAL_DTS_MSPINIT_CB_ID :
+        hdts->MspInitCallback = HAL_DTS_MspInit;
+        break;
+      case HAL_DTS_MSPDEINIT_CB_ID :
+        hdts->MspDeInitCallback = HAL_DTS_MspDeInit;
+        break;
+      default :
+        /* Update status */
+        status = HAL_ERROR;
+        break;
+    }
+  }
+  else
+  {
+    /* Update status */
+    status = HAL_ERROR;
+  }
+
+  /* Return function status */
+  return status;
+}
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+
+/**
+  * @}
+  */
+
+/** @defgroup DTS_Exported_Functions_Group2 Start-Stop operation functions
+ *  @brief   Start-Stop operation functions.
+ *
+@verbatim
+ ===============================================================================
+                      ##### DTS Start Stop operation functions #####
+ ===============================================================================
+    [..]  This section provides functions allowing to:
+      (+) Start a DTS Sensor without interrupt.
+      (+) Stop a DTS Sensor without interrupt.
+      (+) Start a DTS Sensor with interrupt generation.
+      (+) Stop a DTS Sensor with interrupt generation.
+
+@endverbatim
+  * @{
+  */
+
+/**
+  * @brief  Start the DTS sensor.
+  * @param  hdts  DTS handle
+  * @retval HAL status
+  */
+HAL_StatusTypeDef HAL_DTS_Start(DTS_HandleTypeDef *hdts)
+{
+  uint32_t Ref_Time;
+
+  /* Check the DTS handle allocation */
+  if (hdts == NULL)
+  {
+    return HAL_ERROR;
+  }
+
+  if (hdts->State == HAL_DTS_STATE_READY)
+  {
+    hdts->State = HAL_DTS_STATE_BUSY;
+
+    /* Enable DTS sensor */
+    __HAL_DTS_ENABLE(hdts);
+
+    /* Get Start Tick*/
+    Ref_Time = HAL_GetTick();
+
+    /* Wait till TS1_RDY flag is set */
+    while (__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_RDY) == RESET)
+    {
+      if ((HAL_GetTick() - Ref_Time) > DTS_DELAY_STARTUP)
+      {
+        return HAL_TIMEOUT;
+      }
+    }
+
+    if (__HAL_DTS_GET_TRIGGER(hdts) == DTS_TRIGGER_HW_NONE)
+    {
+      /* Start continuous measures */
+      SET_BIT(hdts->Instance->CFGR1, DTS_CFGR1_TS1_START);
+
+      /* Ensure start is taken into account */
+      HAL_Delay(TS_TIMEOUT_MS);
+    }
+
+    hdts->State = HAL_DTS_STATE_READY;
+  }
+  else
+  {
+    return HAL_BUSY;
+  }
+
+  return HAL_OK;
+}
+
+/**
+  * @brief  Stop the DTS Sensor.
+  * @param  hdts  DTS handle
+  * @retval HAL status
+  */
+HAL_StatusTypeDef HAL_DTS_Stop(DTS_HandleTypeDef *hdts)
+{
+  /* Check the DTS handle allocation */
+  if (hdts == NULL)
+  {
+    return HAL_ERROR;
+  }
+
+  if (hdts->State == HAL_DTS_STATE_READY)
+  {
+    hdts->State = HAL_DTS_STATE_BUSY;
+
+    if (__HAL_DTS_GET_TRIGGER(hdts) == DTS_TRIGGER_HW_NONE)
+    {
+      CLEAR_BIT(hdts->Instance->CFGR1, DTS_CFGR1_TS1_START);
+    }
+
+    /* Disable the selected DTS sensor */
+    __HAL_DTS_DISABLE(hdts);
+
+    hdts->State = HAL_DTS_STATE_READY;
+  }
+  else
+  {
+    return HAL_BUSY;
+  }
+
+  return HAL_OK;
+}
+
+/**
+  * @brief  Enable the interrupt(s) and start the DTS sensor
+  * @param  hdts  DTS handle
+  * @retval HAL status
+  */
+HAL_StatusTypeDef HAL_DTS_Start_IT(DTS_HandleTypeDef *hdts)
+{
+  uint32_t Ref_Time;
+
+  /* Check the DTS handle allocation */
+  if (hdts == NULL)
+  {
+    return HAL_ERROR;
+  }
+
+  if (hdts->State == HAL_DTS_STATE_READY)
+  {
+    hdts->State = HAL_DTS_STATE_BUSY;
+
+    /* On Asynchronous mode enable the asynchronous IT */
+    if (hdts->Init.RefClock == DTS_REFCLKSEL_LSE)
+    {
+      __HAL_DTS_ENABLE_IT(hdts, DTS_IT_TS1_AITE | DTS_IT_TS1_AITL | DTS_IT_TS1_AITH);
+    }
+    else
+    {
+      /* Enable the IT(s) */
+      __HAL_DTS_ENABLE_IT(hdts, DTS_IT_TS1_ITE | DTS_IT_TS1_ITL | DTS_IT_TS1_ITH);
+    }
+
+    /* Enable the selected DTS sensor */
+    __HAL_DTS_ENABLE(hdts);
+
+    /* Get Start Tick*/
+    Ref_Time = HAL_GetTick();
+
+    /* Wait till TS1_RDY flag is set */
+    while (__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_RDY) == RESET)
+    {
+      if ((HAL_GetTick() - Ref_Time) > DTS_DELAY_STARTUP)
+      {
+        return HAL_TIMEOUT;
+      }
+    }
+
+    if (__HAL_DTS_GET_TRIGGER(hdts) == DTS_TRIGGER_HW_NONE)
+    {
+      /* Start continuous measures */
+      SET_BIT(hdts->Instance->CFGR1, DTS_CFGR1_TS1_START);
+
+      /* Ensure start is taken into account */
+      HAL_Delay(TS_TIMEOUT_MS);
+    }
+
+    hdts->State = HAL_DTS_STATE_READY;
+  }
+  else
+  {
+    return HAL_BUSY;
+  }
+
+  return HAL_OK;
+}
+
+/**
+  * @brief  Disable the interrupt(s) and stop the DTS sensor.
+  * @param  hdts  DTS handle
+  * @retval HAL status
+  */
+HAL_StatusTypeDef HAL_DTS_Stop_IT(DTS_HandleTypeDef *hdts)
+{
+  /* Check the DTS handle allocation */
+  if (hdts == NULL)
+  {
+    return HAL_ERROR;
+  }
+
+  if (hdts->State == HAL_DTS_STATE_READY)
+  {
+    hdts->State = HAL_DTS_STATE_BUSY;
+
+    /* On Asynchronous mode disable the asynchronous IT */
+    if (hdts->Init.RefClock == DTS_REFCLKSEL_LSE)
+    {
+      __HAL_DTS_DISABLE_IT(hdts, DTS_IT_TS1_AITE | DTS_IT_TS1_AITL | DTS_IT_TS1_AITH);
+    }
+    else
+    {
+      /* Disable the IT(s) */
+      __HAL_DTS_DISABLE_IT(hdts, DTS_IT_TS1_ITE | DTS_IT_TS1_ITL | DTS_IT_TS1_ITH);
+    }
+
+    if (__HAL_DTS_GET_TRIGGER(hdts) == DTS_TRIGGER_HW_NONE)
+    {
+      CLEAR_BIT(hdts->Instance->CFGR1, DTS_CFGR1_TS1_START);
+    }
+
+    /* Disable the selected DTS sensor */
+    __HAL_DTS_DISABLE(hdts);
+
+    hdts->State = HAL_DTS_STATE_READY;
+  }
+  else
+  {
+    return HAL_BUSY;
+  }
+
+  return HAL_OK;
+}
+
+/**
+  * @brief  Get temperature from DTS
+  * @param  hdts         DTS handle
+  * @param  Temperature  Temperature in deg C
+  * @note This function retrieves latest available measure
+  * @retval HAL status
+  */
+HAL_StatusTypeDef HAL_DTS_GetTemperature(DTS_HandleTypeDef *hdts, int32_t *Temperature)
+{
+  uint32_t freq_meas;
+  uint32_t samples;
+  uint32_t t0_temp;
+  uint32_t t0_freq;
+  uint32_t ramp_coeff;
+
+  if (hdts->State == HAL_DTS_STATE_READY)
+  {
+    hdts->State = HAL_DTS_STATE_BUSY;
+
+    /* Get the total number of samples */
+    samples = (hdts->Instance->DR & DTS_DR_TS1_MFREQ);
+
+    if ((hdts->Init.SamplingTime == 0UL) || (samples == 0UL))
+    {
+      hdts->State = HAL_DTS_STATE_READY;
+      return HAL_ERROR;
+    }
+
+    if ((hdts->Init.RefClock) == DTS_REFCLKSEL_LSE)
+    {
+      freq_meas = (LSE_VALUE * samples) / (hdts->Init.SamplingTime >> DTS_CFGR1_TS1_SMP_TIME_Pos); /* On Hz */
+    }
+    else
+    {
+      freq_meas = (HAL_RCCEx_GetD3PCLK1Freq() * (hdts->Init.SamplingTime >> DTS_CFGR1_TS1_SMP_TIME_Pos)) / samples; /* On Hz */
+    }
+
+    /* Read factory settings */
+    t0_temp = hdts->Instance->T0VALR1 >> DTS_T0VALR1_TS1_T0_Pos;
+
+    if (t0_temp == 0UL)
+    {
+      t0_temp = DTS_FACTORY_TEMPERATURE1; /* 30 deg C */
+    }
+    else if (t0_temp == 1UL)
+    {
+      t0_temp = DTS_FACTORY_TEMPERATURE2; /* 130 deg C */
+    }
+    else
+    {
+      hdts->State = HAL_DTS_STATE_READY;
+      return HAL_ERROR;
+    }
+
+    t0_freq = (hdts->Instance->T0VALR1 & DTS_T0VALR1_TS1_FMT0) * 100UL; /* Hz */
+
+    ramp_coeff = hdts->Instance->RAMPVALR & DTS_RAMPVALR_TS1_RAMP_COEFF; /* deg C/Hz */
+
+    if (ramp_coeff == 0UL)
+    {
+      hdts->State = HAL_DTS_STATE_READY;
+      return HAL_ERROR;
+    }
+
+    /* Figure out the temperature deg C */
+    *Temperature = (int32_t)t0_temp + (((int32_t)freq_meas - (int32_t)t0_freq) / (int32_t)ramp_coeff);
+
+    hdts->State = HAL_DTS_STATE_READY;
+  }
+  else
+  {
+    return HAL_BUSY;
+  }
+
+  return HAL_OK;
+}
+
+/**
+  * @brief  DTS sensor IRQ Handler.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+void HAL_DTS_IRQHandler(DTS_HandleTypeDef *hdts)
+{
+  /* Check end of measure Asynchronous IT */
+  if ((__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_AITE)) != RESET)
+  {
+      __HAL_DTS_CLEAR_FLAG(hdts, DTS_FLAG_TS1_AITE);
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+      hdts->AsyncEndCallback(hdts);
+#else
+      HAL_DTS_AsyncEndCallback(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+  }
+
+  /* Check low threshold Asynchronous IT */
+  if ((__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_AITL)) != RESET)
+  {
+      __HAL_DTS_CLEAR_FLAG(hdts, DTS_FLAG_TS1_AITL);
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+      hdts->AsyncLowCallback(hdts);
+#else
+      HAL_DTS_AsyncLowCallback(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+  }
+
+  /* Check high threshold Asynchronous IT */
+  if ((__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_AITH)) != RESET)
+  {
+      __HAL_DTS_CLEAR_FLAG(hdts, DTS_FLAG_TS1_AITH);
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+      hdts->AsyncHighCallback(hdts);
+#else
+      HAL_DTS_AsyncHighCallback(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+  }
+
+  /* Check end of measure IT */
+  if ((__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_ITE)) != RESET)
+  {
+      __HAL_DTS_CLEAR_FLAG(hdts, DTS_FLAG_TS1_ITE);
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+      hdts->EndCallback(hdts);
+#else
+      HAL_DTS_EndCallback(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+  }
+
+  /* Check low threshold IT */
+  if ((__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_ITL)) != RESET)
+  {
+      __HAL_DTS_CLEAR_FLAG(hdts, DTS_FLAG_TS1_ITL);
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+      hdts->LowCallback(hdts);
+#else
+      HAL_DTS_LowCallback(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+  }
+
+  /* Check high threshold IT */
+  if ((__HAL_DTS_GET_FLAG(hdts, DTS_FLAG_TS1_ITH)) != RESET)
+  {
+      __HAL_DTS_CLEAR_FLAG(hdts, DTS_FLAG_TS1_ITH);
+
+#if (USE_HAL_DTS_REGISTER_CALLBACKS == 1)
+      hdts->HighCallback(hdts);
+#else
+      HAL_DTS_HighCallback(hdts);
+#endif /* USE_HAL_DTS_REGISTER_CALLBACKS */
+  }
+}
+
+/**
+  * @brief  DTS Sensor End measure callback.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_EndCallback(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_EndCallback should be implemented in the user file
+  */
+}
+
+/**
+  * @brief  DTS Sensor low threshold measure callback.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_LowCallback(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_LowCallback should be implemented in the user file
+  */
+}
+
+/**
+  * @brief  DTS Sensor high threshold measure callback.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_HighCallback(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_HighCallback should be implemented in the user file
+  */
+}
+
+/**
+  * @brief  DTS Sensor asynchronous end measure callback.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_AsyncEndCallback(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_AsyncEndCallback should be implemented in the user file
+  */
+}
+
+/**
+  * @brief  DTS Sensor asynchronous low threshold measure callback.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_AsyncLowCallback(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_AsyncLowCallback should be implemented in the user file
+  */
+}
+
+/**
+  * @brief  DTS Sensor asynchronous high threshold measure callback.
+  * @param  hdts  DTS handle
+  * @retval None
+  */
+__weak void HAL_DTS_AsyncHighCallback(DTS_HandleTypeDef *hdts)
+{
+  /* Prevent unused argument(s) compilation warning */
+  UNUSED(hdts);
+
+  /* NOTE : This function should not be modified, when the callback is needed,
+  the HAL_DTS_AsyncHighCallback should be implemented in the user file
+  */
+}
+
+/**
+  * @}
+  */
+
+/** @defgroup DTS_Exported_Functions_Group3 Peripheral State functions
+ *  @brief   Peripheral State functions.
+ *
+@verbatim
+ ===============================================================================
+                      ##### Peripheral State functions #####
+ ===============================================================================
+    [..]
+    This subsection permits to get in run-time the status of the peripheral.
+
+@endverbatim
+  * @{
+  */
+
+/**
+  * @brief  Return the DTS handle state.
+  * @param  hdts  DTS handle
+  * @retval HAL state
+  */
+HAL_DTS_StateTypeDef HAL_DTS_GetState(const DTS_HandleTypeDef *hdts)
+{
+  /* Check the DTS handle allocation */
+  if (hdts == NULL)
+  {
+    return HAL_DTS_STATE_RESET;
+  }
+
+  /* Return DTS handle state */
+  return hdts->State;
+}
+/**
+  * @}
+  */
+
+/**
+  * @}
+  */
+
+/**
+  * @}
+  */
+
+#endif /* DTS */
+
+#endif /* HAL_DTS_MODULE_ENABLED */
+
+/**
+  * @}
+  */
+
Index: ctrl/firmware/Main/CubeMX/charger.ioc
===================================================================
--- ctrl/firmware/Main/CubeMX/charger.ioc	(revision 95)
+++ ctrl/firmware/Main/CubeMX/charger.ioc	(revision 96)
@@ -1,5 +1,7 @@
 #MicroXplorer Configuration settings - do not modify
 ADC3.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_10
-ADC3.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_TEMPSENSOR
+ADC3.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_VBAT
+ADC3.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_TEMPSENSOR
+ADC3.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_VREFINT
 ADC3.ClockPrescalerADC3=ADC_CLOCK_ASYNC_DIV256
 ADC3.ContinuousConvMode=ENABLE
@@ -7,19 +9,27 @@
 ADC3.DMAContinuousRequests=ENABLE
 ADC3.EOCSelection=ADC_EOC_SEQ_CONV
-ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,OffsetSign-0\#ChannelRegularConversion,NbrOfConversionFlag,ContinuousConvMode,DMAContinuousRequests,EOCSelection,Overrun,OversamplingMode,ClockPrescalerADC3,Ratio,NbrOfConversion,RightBitShift,ConversionDataManagement,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,OffsetSign-1\#ChannelRegularConversion
-ADC3.NbrOfConversion=2
+ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,OffsetSign-0\#ChannelRegularConversion,NbrOfConversionFlag,ContinuousConvMode,DMAContinuousRequests,EOCSelection,Overrun,OversamplingMode,ClockPrescalerADC3,Ratio,NbrOfConversion,RightBitShift,ConversionDataManagement,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,OffsetSign-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,OffsetSign-2\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,OffsetNumber-4\#ChannelRegularConversion,OffsetSign-4\#ChannelRegularConversion
+ADC3.NbrOfConversion=4
 ADC3.NbrOfConversionFlag=1
 ADC3.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
 ADC3.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE
+ADC3.OffsetNumber-2\#ChannelRegularConversion=ADC_OFFSET_NONE
+ADC3.OffsetNumber-4\#ChannelRegularConversion=ADC_OFFSET_NONE
 ADC3.OffsetSign-0\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
 ADC3.OffsetSign-1\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
+ADC3.OffsetSign-2\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
+ADC3.OffsetSign-4\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
 ADC3.Overrun=ADC_OVR_DATA_OVERWRITTEN
 ADC3.OversamplingMode=ENABLE
 ADC3.Rank-0\#ChannelRegularConversion=1
 ADC3.Rank-1\#ChannelRegularConversion=2
+ADC3.Rank-2\#ChannelRegularConversion=3
+ADC3.Rank-4\#ChannelRegularConversion=4
 ADC3.Ratio=ADC3_OVERSAMPLING_RATIO_256
 ADC3.RightBitShift=ADC_RIGHTBITSHIFT_8
 ADC3.SamplingTime-0\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
 ADC3.SamplingTime-1\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
+ADC3.SamplingTime-2\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
+ADC3.SamplingTime-4\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
 Bdma.ADC3.0.Direction=DMA_PERIPH_TO_MEMORY
 Bdma.ADC3.0.EventEnable=DISABLE
@@ -344,22 +354,24 @@
 Mcu.Pin56=PB9
 Mcu.Pin57=VP_ADC3_TempSens_Input
-Mcu.Pin58=VP_DTS_VS-DTS
-Mcu.Pin59=VP_FATFS_VS_SDIO
+Mcu.Pin58=VP_ADC3_Vref_Input
+Mcu.Pin59=VP_ADC3_Vbat_Input
 Mcu.Pin6=PF1
-Mcu.Pin60=VP_FREERTOS_VS_CMSIS_V2
-Mcu.Pin61=VP_RTC_VS_RTC_Activate
-Mcu.Pin62=VP_RTC_VS_RTC_Calendar
-Mcu.Pin63=VP_SYS_VS_tim7
-Mcu.Pin64=VP_TIM3_VS_ClockSourceINT
-Mcu.Pin65=VP_TIM6_VS_ClockSourceINT
-Mcu.Pin66=VP_TIM8_VS_ControllerModeReset
-Mcu.Pin67=VP_TIM8_VS_ClockSourceINT
-Mcu.Pin68=VP_VREFBUF_V_VREFBUF
-Mcu.Pin69=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin60=VP_DTS_VS-DTS
+Mcu.Pin61=VP_FATFS_VS_SDIO
+Mcu.Pin62=VP_FREERTOS_VS_CMSIS_V2
+Mcu.Pin63=VP_RTC_VS_RTC_Activate
+Mcu.Pin64=VP_RTC_VS_RTC_Calendar
+Mcu.Pin65=VP_SYS_VS_tim7
+Mcu.Pin66=VP_TIM3_VS_ClockSourceINT
+Mcu.Pin67=VP_TIM6_VS_ClockSourceINT
+Mcu.Pin68=VP_TIM8_VS_ControllerModeReset
+Mcu.Pin69=VP_TIM8_VS_ClockSourceINT
 Mcu.Pin7=PH0-OSC_IN
-Mcu.Pin70=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
+Mcu.Pin70=VP_VREFBUF_V_VREFBUF
+Mcu.Pin71=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin72=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
 Mcu.Pin8=PH1-OSC_OUT
 Mcu.Pin9=PC0
-Mcu.PinsNb=71
+Mcu.PinsNb=73
 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
 Mcu.ThirdParty1=STMicroelectronics.X-CUBE-EEPRMA1.5.1.0
@@ -653,5 +665,5 @@
 ProjectManager.UAScriptBeforePath=
 ProjectManager.UnderRoot=true
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-MX_BDMA_Init-BDMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,7-SystemClock_Config-RCC-false-HAL-false,8-MX_FATFS_Init-FATFS-false-HAL-false,9-MX_TIM8_Init-TIM8-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true,11-MX_USART2_UART_Init-USART2-false-HAL-true,12-MX_USART10_UART_Init-USART10-false-HAL-true,13-MX_TIM6_Init-TIM6-false-HAL-true,14-MX_I2C2_Init-I2C2-false-HAL-true,15-MX_ADC3_Init-ADC3-false-HAL-true,16-MX_TIM3_Init-TIM3-false-HAL-true,17-MX_I2C1_Init-I2C1-false-HAL-true,18-MX_USART3_UART_Init-USART3-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true,0-MX_VREFBUF_Init-VREFBUF-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-MX_BDMA_Init-BDMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,7-SystemClock_Config-RCC-false-HAL-false,8-MX_FATFS_Init-FATFS-false-HAL-false,9-MX_TIM8_Init-TIM8-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true,11-MX_USART2_UART_Init-USART2-false-HAL-true,12-MX_USART10_UART_Init-USART10-false-HAL-true,13-MX_TIM6_Init-TIM6-false-HAL-true,14-MX_I2C2_Init-I2C2-false-HAL-true,15-MX_ADC3_Init-ADC3-false-HAL-true,16-MX_TIM3_Init-TIM3-false-HAL-true,17-MX_I2C1_Init-I2C1-false-HAL-true,18-MX_USART3_UART_Init-USART3-false-HAL-true,19-MX_DTS_Init-DTS-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true,0-MX_VREFBUF_Init-VREFBUF-false-HAL-true
 RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_PLL3
 RCC.ADCFreq_Value=60000000
@@ -830,4 +842,8 @@
 VP_ADC3_TempSens_Input.Mode=IN-TempSens
 VP_ADC3_TempSens_Input.Signal=ADC3_TempSens_Input
+VP_ADC3_Vbat_Input.Mode=IN-Vbat
+VP_ADC3_Vbat_Input.Signal=ADC3_Vbat_Input
+VP_ADC3_Vref_Input.Mode=IN-Vrefint
+VP_ADC3_Vref_Input.Signal=ADC3_Vref_Input
 VP_DTS_VS-DTS.Mode=DTS
 VP_DTS_VS-DTS.Signal=DTS_VS-DTS
