source: ctrl/firmware/Main/CubeMX/Core/Src/dts.c

Last change on this file was 96, checked in by Zed, 3 months ago

ADC3 with DMA was implemented.
DTS was activated.

File size: 2.3 KB
Line 
1/* USER CODE BEGIN Header */
2/**
3  ******************************************************************************
4  * @file    dts.c
5  * @brief   This file provides code for the configuration
6  *          of the DTS instances.
7  ******************************************************************************
8  * @attention
9  *
10  * Copyright (c) 2025 STMicroelectronics.
11  * All rights reserved.
12  *
13  * This software is licensed under terms that can be found in the LICENSE file
14  * in the root directory of this software component.
15  * If no LICENSE file comes with this software, it is provided AS-IS.
16  *
17  ******************************************************************************
18  */
19/* USER CODE END Header */
20/* Includes ------------------------------------------------------------------*/
21#include "dts.h"
22
23/* USER CODE BEGIN 0 */
24
25/* USER CODE END 0 */
26
27DTS_HandleTypeDef hdts;
28
29/* DTS init function */
30void MX_DTS_Init(void)
31{
32
33  /* USER CODE BEGIN DTS_Init 0 */
34
35  /* USER CODE END DTS_Init 0 */
36
37  /* USER CODE BEGIN DTS_Init 1 */
38
39  /* USER CODE END DTS_Init 1 */
40  hdts.Instance = DTS;
41  hdts.Init.QuickMeasure = DTS_QUICKMEAS_DISABLE;
42  hdts.Init.RefClock = DTS_REFCLKSEL_LSE;
43  hdts.Init.TriggerInput = DTS_TRIGGER_HW_NONE;
44  hdts.Init.SamplingTime = DTS_SMP_TIME_15_CYCLE;
45  hdts.Init.Divider = 0;
46  hdts.Init.HighThreshold = 0x0;
47  hdts.Init.LowThreshold = 0x0;
48  if (HAL_DTS_Init(&hdts) != HAL_OK)
49  {
50    Error_Handler();
51  }
52  /* USER CODE BEGIN DTS_Init 2 */
53
54  HAL_StatusTypeDef r = HAL_DTS_Start(&hdts);
55  if (r != HAL_OK) Error_Handler();
56
57  /* USER CODE END DTS_Init 2 */
58
59}
60
61void HAL_DTS_MspInit(DTS_HandleTypeDef* dtsHandle)
62{
63
64  if(dtsHandle->Instance==DTS)
65  {
66  /* USER CODE BEGIN DTS_MspInit 0 */
67
68  /* USER CODE END DTS_MspInit 0 */
69    /* DTS clock enable */
70    __HAL_RCC_DTS_CLK_ENABLE();
71  /* USER CODE BEGIN DTS_MspInit 1 */
72
73  /* USER CODE END DTS_MspInit 1 */
74  }
75}
76
77void HAL_DTS_MspDeInit(DTS_HandleTypeDef* dtsHandle)
78{
79
80  if(dtsHandle->Instance==DTS)
81  {
82  /* USER CODE BEGIN DTS_MspDeInit 0 */
83
84  /* USER CODE END DTS_MspDeInit 0 */
85    /* Peripheral clock disable */
86    __HAL_RCC_DTS_CLK_DISABLE();
87  /* USER CODE BEGIN DTS_MspDeInit 1 */
88
89  /* USER CODE END DTS_MspDeInit 1 */
90  }
91}
92
93/* USER CODE BEGIN 1 */
94
95/* USER CODE END 1 */
Note: See TracBrowser for help on using the repository browser.