L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
adc_if.h
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
2/**
3 ******************************************************************************
4 * @file adc_if.h
5 * @author MCD Application Team
6 * @brief Header for ADC interface configuration
7 ******************************************************************************
8 * @attention
9 *
10 * Copyright (c) 2026 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
21/* Define to prevent recursive inclusion -------------------------------------*/
22#ifndef __ADC_IF_H__
23#define __ADC_IF_H__
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28/* Includes ------------------------------------------------------------------*/
29#include "adc.h"
30#include "platform.h"
31
32/* USER CODE BEGIN Includes */
33
34/* USER CODE END Includes */
35
36/* Exported types ------------------------------------------------------------*/
37/* USER CODE BEGIN ET */
38
39/* USER CODE END ET */
40
41/* Exported constants --------------------------------------------------------*/
42/**
43 * @brief Battery level in mV
44 */
45#define BAT_CR2032 ((uint32_t) 3000)
46/**
47 * @brief Maximum battery level in mV
48 */
49#define VDD_BAT BAT_CR2032
50/**
51 * @brief Minimum battery level in mV
52 */
53#define VDD_MIN 1800
54
55/* USER CODE BEGIN EC */
56
57/* USER CODE END EC */
58
59/* External variables --------------------------------------------------------*/
60/* USER CODE BEGIN EV */
61
62/* USER CODE END EV */
63
64/* Exported macro ------------------------------------------------------------*/
65/* USER CODE BEGIN EM */
66
67/* USER CODE END EM */
68
69/* Exported functions prototypes ---------------------------------------------*/
70
71/**
72 * @brief Initializes the ADC input
73 */
74void SYS_InitMeasurement(void);
75
76/**
77 * @brief DeInitializes the ADC
78 */
79void SYS_DeInitMeasurement(void);
80
81/**
82 * @brief Get the current temperature
83 * @return value temperature in degree Celsius( q7.8 )
84 */
85int16_t SYS_GetTemperatureLevel(void);
86
87/**
88 * @brief Get the current battery level
89 * @return value battery level in linear scale
90 */
91uint16_t SYS_GetBatteryLevel(void);
92
93/* USER CODE BEGIN EFP */
94
95/* USER CODE END EFP */
96
97#ifdef __cplusplus
98}
99#endif
100
101#endif /* __ADC_IF_H__ */
This file contains all the function prototypes for the adc.c file.
void SYS_DeInitMeasurement(void)
DeInitializes the ADC.
Definition adc_if.c:90
uint16_t SYS_GetBatteryLevel(void)
Get the current battery level.
Definition adc_if.c:139
void SYS_InitMeasurement(void)
Initializes the ADC input.
Definition adc_if.c:79
int16_t SYS_GetTemperatureLevel(void)
Get the current temperature.
Definition adc_if.c:97
Header for General HW instances configuration.