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_CPULOAD_Functions

Library Functions. More...

Functions

uint8_t TM_CPULOAD_Init (TM_CPULOAD_t *CPU_Load)
 Initializes DWT functionality for sleep counter and prepares everything for CPU LOAD measurement. More...
 
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. More...
 

Detailed Description

Library Functions.

Function Documentation

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.

Note
You need wake up source, otherwise you might stay forever inside low power mode. For wakeup source, you can use any interrupt, because __WFI() instruction is used.
Parameters
*CPU_LoadPointer to TM_CPULOAD_t structure
Return values
CPUload value updated status.
  • 0: CPU load value is not updated, still old results
  • > 0: CPU load value is updated
uint8_t TM_CPULOAD_Init ( TM_CPULOAD_t CPU_Load)

Initializes DWT functionality for sleep counter and prepares everything for CPU LOAD measurement.

Parameters
*CPU_LoadPointer to empty TM_CPULOAD_t structure
Return values
ReturnsDWT counter status:
  • 0: DWT counter has not started, measurement will fail
  • > 0: DWT counter has started, everything OK