L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
sys_app.h
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
2/**
3 ******************************************************************************
4 * @file sys_app.h
5 * @author MCD Application Team
6 * @brief Function prototypes for sys_app.c file
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 __SYS_APP_H__
23#define __SYS_APP_H__
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30#include "stdint.h"
31#include "sys_conf.h"
32#include "stm32_adv_trace.h"
33/* USER CODE BEGIN Includes */
34
35/* USER CODE END Includes */
36
37/* Exported defines ----------------------------------------------------------*/
38/* USER CODE BEGIN ED */
39
40/* USER CODE END ED */
41
42/* Exported types ------------------------------------------------------------*/
43/* USER CODE BEGIN ET */
44
45/* USER CODE END ET */
46
47/* Exported constants --------------------------------------------------------*/
48/* USER CODE BEGIN EC */
49
50/* USER CODE END EC */
51
52/* External variables --------------------------------------------------------*/
53/* USER CODE BEGIN EV */
54
55/* USER CODE END EV */
56
57/* Exported macros -----------------------------------------------------------*/
58#define APP_PPRINTF(...) do{ } while( UTIL_ADV_TRACE_OK \
59 != UTIL_ADV_TRACE_COND_FSend(VLEVEL_ALWAYS, T_REG_OFF, TS_OFF, __VA_ARGS__) ) /* Polling Mode */
60#define APP_TPRINTF(...) do{ {UTIL_ADV_TRACE_COND_FSend(VLEVEL_ALWAYS, T_REG_OFF, TS_ON, __VA_ARGS__);} }while(0); /* with timestamp */
61#define APP_PRINTF(...) do{ {UTIL_ADV_TRACE_COND_FSend(VLEVEL_ALWAYS, T_REG_OFF, TS_OFF, __VA_ARGS__);} }while(0);
62
63#if defined (APP_LOG_ENABLED) && (APP_LOG_ENABLED == 1)
64#define APP_LOG(TS,VL,...) do{ {UTIL_ADV_TRACE_COND_FSend(VL, T_REG_OFF, TS, __VA_ARGS__);} }while(0);
65#elif defined (APP_LOG_ENABLED) && (APP_LOG_ENABLED == 0) /* APP_LOG disabled */
66#define APP_LOG(TS,VL,...)
67#else
68#error "APP_LOG_ENABLED not defined or out of range <0,1>"
69#endif /* APP_LOG_ENABLED */
70
71/* USER CODE BEGIN EM */
72#ifdef APP_LOG
73#undef APP_LOG
74#define APP_LOG(TS,VL,...) {writeLog( __VA_ARGS__);}
75#endif
76/* USER CODE END EM */
77
78/* Exported functions prototypes ---------------------------------------------*/
79/**
80 * @brief initialize the system (dbg pins, trace, mbmux, sys timer, LPM, ...)
81 */
82void SystemApp_Init(void);
83
84/**
85 * @brief callback to get the battery level in % of full charge (254 full charge, 0 no charge)
86 * @retval battery level
87 */
88uint8_t GetBatteryLevel(void);
89
90/**
91 * @brief callback to get the current temperature in the MCU
92 * @retval temperature level
93 */
94int16_t GetTemperatureLevel(void);
95
96/**
97 * @brief callback to get the board 64 bits unique ID
98 * @param id unique ID
99 */
100void GetUniqueId(uint8_t *id);
101
102/**
103 * @brief callback to get the board 32 bits unique ID (LSB)
104 * @param devAddr Device Address
105 */
106void GetDevAddr(uint32_t *devAddr);
107
108/* USER CODE BEGIN EFP */
109
110/* USER CODE END EFP */
111
112#ifdef __cplusplus
113}
114#endif
115
116#endif /* __SYS_APP_H__ */
void SystemApp_Init(void)
initialize the system (dbg pins, trace, mbmux, sys timer, LPM, ...)
Definition sys_app.c:90
void GetDevAddr(uint32_t *devAddr)
callback to get the board 32 bits unique ID (LSB)
Definition sys_app.c:239
int16_t GetTemperatureLevel(void)
callback to get the current temperature in the MCU
Definition sys_app.c:184
void GetUniqueId(uint8_t *id)
callback to get the board 64 bits unique ID
Definition sys_app.c:198
uint8_t GetBatteryLevel(void)
callback to get the battery level in % of full charge (254 full charge, 0 no charge)
Definition sys_app.c:152
Applicative configuration, e.g. : debug, trace, low power, sensors.