TM STM32Fxxx HAL Libraries  v1.0.0
Libraries for STM32Fxxx (F0, F4 and F7 series) devices based on HAL drivers from ST from Tilen Majerle
tm_stm32_cpu_load.h
1 
37 #ifndef TM_CPU_LOAD_H
38 #define TM_CPU_LOAD_H 100
39 
40 /* C++ detection */
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
71 #include "stm32fxxx_hal.h"
72 #include "defines.h"
73 #include "tm_stm32_general.h"
74 
80 /* Macros here */
94 typedef struct {
95  float Load;
96  uint8_t Updated;
97  uint32_t WCNT;
98  uint32_t SCNT;
99 } TM_CPULOAD_t;
100 
118 uint8_t TM_CPULOAD_Init(TM_CPULOAD_t* CPU_Load);
119 
129 uint8_t TM_CPULOAD_GoToSleepMode(TM_CPULOAD_t* CPU_Load);
130 
143 /* C++ detection */
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif
uint32_t SCNT
Definition: tm_stm32_cpu_load.h:98
float Load
Definition: tm_stm32_cpu_load.h:95
CPU LOAD structure.
Definition: tm_stm32_cpu_load.h:94
uint8_t TM_CPULOAD_Init(TM_CPULOAD_t *CPU_Load)
Initializes DWT functionality for sleep counter and prepares everything for CPU LOAD measurement...
uint32_t WCNT
Definition: tm_stm32_cpu_load.h:97
uint8_t TM_CPULOAD_GoToSleepMode(TM_CPULOAD_t *CPU_Load)
Goes to low power mode and measures sleeping time and working time using DWT cycle counter...
uint8_t Updated
Definition: tm_stm32_cpu_load.h:96