TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
tm_stm32f4_cpu_load.h
1 
30 #ifndef TM_CPU_LOAD_H
31 #define TM_CPU_LOAD_H 100
32 
33 /* C++ detection */
34 #ifdef __cplusplus
35 extern C {
36 #endif
37 
67 #include "stm32f4xx.h"
68 #include "stm32f4xx_rcc.h"
69 #include "stm32f4xx_pwr.h"
70 #include "defines.h"
71 #include "tm_stm32f4_low_power.h"
72 #include "tm_stm32f4_general.h"
73 
79 /* Macros here */
93 typedef struct {
94  uint32_t WCNT;
95  uint32_t SCNT;
96  float Load;
97  uint8_t Updated;
98 } TM_CPULOAD_t;
99 
117 uint8_t TM_CPULOAD_Init(TM_CPULOAD_t* CPU_Load);
118 
130 uint8_t TM_CPULOAD_GoToSleepMode(TM_CPULOAD_t* CPU_Load, TM_LOWPOWERMODE_t PowerMode);
131 
144 /* C++ detection */
145 #ifdef __cplusplus
146 }
147 #endif
148 
149 #endif
uint32_t SCNT
Definition: tm_stm32f4_cpu_load.h:95
float Load
Definition: tm_stm32f4_cpu_load.h:96
CPU LOAD structure.
Definition: tm_stm32f4_cpu_load.h:93
uint8_t TM_CPULOAD_Init(TM_CPULOAD_t *CPU_Load)
Initializes DWT functionality for sleep counter and prepares everything for CPU LOAD measurement...
uint8_t TM_CPULOAD_GoToSleepMode(TM_CPULOAD_t *CPU_Load, TM_LOWPOWERMODE_t PowerMode)
Goes to low power mode and measures sleeping time and working time using DWT cycle counter...
uint32_t WCNT
Definition: tm_stm32f4_cpu_load.h:94
TM_LOWPOWERMODE_t
Definition: tm_stm32f4_low_power.h:136
uint8_t Updated
Definition: tm_stm32f4_cpu_load.h:97