L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
adc_if.h File Reference

Header for ADC interface configuration. More...

#include "adc.h"
#include "platform.h"
Include dependency graph for adc_if.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define BAT_CR2032   ((uint32_t) 3000)
 Battery level in mV.
#define VDD_BAT   BAT_CR2032
 Maximum battery level in mV.
#define VDD_MIN   1800
 Minimum battery level in mV.

Functions

void SYS_InitMeasurement (void)
 Initializes the ADC input.
void SYS_DeInitMeasurement (void)
 DeInitializes the ADC.
int16_t SYS_GetTemperatureLevel (void)
 Get the current temperature.
uint16_t SYS_GetBatteryLevel (void)
 Get the current battery level.

Detailed Description

Header for ADC interface configuration.

Author
MCD Application Team
Attention

Copyright (c) 2026 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.

Definition in file adc_if.h.

Macro Definition Documentation

◆ BAT_CR2032

#define BAT_CR2032   ((uint32_t) 3000)

Battery level in mV.

Definition at line 45 of file adc_if.h.

◆ VDD_BAT

#define VDD_BAT   BAT_CR2032

Maximum battery level in mV.

Definition at line 49 of file adc_if.h.

Referenced by GetBatteryLevel().

◆ VDD_MIN

#define VDD_MIN   1800

Minimum battery level in mV.

Definition at line 53 of file adc_if.h.

Referenced by GetBatteryLevel().

Function Documentation

◆ SYS_DeInitMeasurement()

void SYS_DeInitMeasurement ( void )

DeInitializes the ADC.

Definition at line 90 of file adc_if.c.

◆ SYS_GetBatteryLevel()

uint16_t SYS_GetBatteryLevel ( void )

Get the current battery level.

Returns
value battery level in linear scale

Definition at line 139 of file adc_if.c.

References ADC_ReadChannels().

Referenced by GetBatteryLevel(), mems_WriteToSystemParams(), and SYS_GetTemperatureLevel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_GetTemperatureLevel()

int16_t SYS_GetTemperatureLevel ( void )

Get the current temperature.

Returns
value temperature in degree Celsius( q7.8 )

< Internal temperature sensor, parameter Avg_Slope (unit: uV/DegCelsius). Refer to device datasheet for min/typ/max values.

< Internal temperature sensor, parameter V30 (unit: mV). Refer to device datasheet for min/typ/max values.

Definition at line 97 of file adc_if.c.

References ADC_ReadChannels(), SYS_GetBatteryLevel(), TEMPSENSOR_TYP_AVGSLOPE, and TEMPSENSOR_TYP_CAL1_V.

Referenced by EnvSensors_Read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SYS_InitMeasurement()

void SYS_InitMeasurement ( void )

Initializes the ADC input.

Definition at line 79 of file adc_if.c.

References hadc.

Referenced by SystemApp_Init().

Here is the caller graph for this function: