L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
utilities_conf.h
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
2/**
3 ******************************************************************************
4 * @file utilities_conf.h
5 * @author MCD Application Team
6 * @brief Header for configuration file to utilities
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 __UTILITIES_CONF_H__
23#define __UTILITIES_CONF_H__
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/* Includes ------------------------------------------------------------------*/
30#include "cmsis_compiler.h"
31
32/* definitions to be provided to "sequencer" utility */
33#include "stm32_mem.h"
34/* definition and callback for tiny_vsnprintf */
35#include "stm32_tiny_vsnprintf.h"
36
37/* enum number of task and priority*/
38#include "utilities_def.h"
39/* USER CODE BEGIN Includes */
40
41/* USER CODE END Includes */
42
43/* Exported types ------------------------------------------------------------*/
44/* USER CODE BEGIN ET */
45
46/* USER CODE END ET */
47
48/* Exported constants --------------------------------------------------------*/
49#define VLEVEL_OFF 0 /*!< used to set UTIL_ADV_TRACE_SetVerboseLevel() (not as message param) */
50#define VLEVEL_ALWAYS 0 /*!< used as message params, if this level is given
51 trace will be printed even when UTIL_ADV_TRACE_SetVerboseLevel(OFF) */
52#define VLEVEL_L 1 /*!< just essential traces */
53#define VLEVEL_M 2 /*!< functional traces */
54#define VLEVEL_H 3 /*!< all traces */
55
56#define TS_OFF 0 /*!< Log without TimeStamp */
57#define TS_ON 1 /*!< Log with TimeStamp */
58
59#define T_REG_OFF 0 /*!< Log without bitmask */
60
61/* USER CODE BEGIN EC */
62
63/* USER CODE END EC */
64/* External variables --------------------------------------------------------*/
65/* USER CODE BEGIN EV */
66
67/* USER CODE END EV */
68
69/* Exported macros -----------------------------------------------------------*/
70/******************************************************************************
71 * common
72 ******************************************************************************/
73/**
74 * @brief Memory placement macro
75 */
76#if defined(__CC_ARM)
77#define UTIL_PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__), zero_init))
78#elif defined(__ICCARM__)
79#define UTIL_PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
80#else /* __GNUC__ */
81#define UTIL_PLACE_IN_SECTION( __x__ ) __attribute__((section (__x__)))
82#endif /* __CC_ARM | __ICCARM__ | __GNUC__ */
83
84/**
85 * @brief Memory alignment macro
86 */
87#undef ALIGN
88#ifdef WIN32
89#define ALIGN(n)
90#else
91#define ALIGN(n) __attribute__((aligned(n)))
92#endif /* WIN32 */
93
94/**
95 * @brief macro used to initialize the critical section
96 */
97#define UTILS_INIT_CRITICAL_SECTION()
98
99/**
100 * @brief macro used to enter the critical section
101 */
102#define UTILS_ENTER_CRITICAL_SECTION() uint32_t primask_bit= __get_PRIMASK();\
103 __disable_irq()
104
105/**
106 * @brief macro used to exit the critical section
107 */
108#define UTILS_EXIT_CRITICAL_SECTION() __set_PRIMASK(primask_bit)
109/******************************************************************************
110 * sequencer
111 ******************************************************************************/
112
113/**
114 * @brief default number of tasks configured in sequencer
115 */
116#define UTIL_SEQ_CONF_TASK_NBR CFG_SEQ_Task_NBR
117
118/**
119 * @brief default value of priority task
120 */
121
122#define UTIL_SEQ_CONF_PRIO_NBR CFG_SEQ_Prio_NBR
123
124/**
125 * @brief macro used to initialize the critical section
126 */
127#define UTIL_SEQ_INIT_CRITICAL_SECTION( ) UTILS_INIT_CRITICAL_SECTION()
128
129/**
130 * @brief macro used to enter the critical section
131 */
132#define UTIL_SEQ_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION()
133
134/**
135 * @brief macro used to exit the critical section
136 */
137#define UTIL_SEQ_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION()
138
139/**
140 * @brief Memset utilities interface to application
141 */
142#define UTIL_SEQ_MEMSET8( dest, value, size ) UTIL_MEM_set_8( dest, value, size )
143
144/******************************************************************************
145 * trace\advanced
146 * the define option
147 * UTIL_ADV_TRACE_CONDITIONNAL shall be defined if you want use conditional function
148 * UTIL_ADV_TRACE_UNCHUNK_MODE shall be defined if you want use the unchunk mode
149 *
150 ******************************************************************************/
151
152#define UTIL_ADV_TRACE_CONDITIONNAL /*!< not used */
153#define UTIL_ADV_TRACE_UNCHUNK_MODE /*!< not used */
154#define UTIL_ADV_TRACE_DEBUG(...) /*!< not used */
155#define UTIL_ADV_TRACE_INIT_CRITICAL_SECTION( ) UTILS_INIT_CRITICAL_SECTION() /*!< init the critical section in trace feature */
156#define UTIL_ADV_TRACE_ENTER_CRITICAL_SECTION( ) UTILS_ENTER_CRITICAL_SECTION() /*!< enter the critical section in trace feature */
157#define UTIL_ADV_TRACE_EXIT_CRITICAL_SECTION( ) UTILS_EXIT_CRITICAL_SECTION() /*!< exit the critical section in trace feature */
158#define UTIL_ADV_TRACE_TMP_BUF_SIZE (512U) /*!< default trace buffer size */
159#define UTIL_ADV_TRACE_TMP_MAX_TIMESTMAP_SIZE (15U) /*!< default trace timestamp size */
160#define UTIL_ADV_TRACE_FIFO_SIZE (1024U) /*!< default trace fifo size */
161#define UTIL_ADV_TRACE_MEMSET8( dest, value, size) UTIL_MEM_set_8((dest),(value),(size)) /*!< memset utilities interface to trace feature */
162#define UTIL_ADV_TRACE_VSNPRINTF(...) tiny_vsnprintf_like(__VA_ARGS__) /*!< vsnprintf utilities interface to trace feature */
163
164/* USER CODE BEGIN EM */
165
166/* USER CODE END EM */
167
168/* Exported functions prototypes ---------------------------------------------*/
169/* USER CODE BEGIN EFP */
170
171/* USER CODE END EFP */
172
173#ifdef __cplusplus
174}
175#endif
176
177#endif /*__UTILITIES_CONF_H__ */
Definitions for modules requiring utilities.