HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
|
Workload estimation utilities. More...
#include "sarmfsw.h"
Macros | |
#define | GET_COUNT() DWT->CYCCNT |
#define | WORKLOAD_IT_IN() |
#define | WORKLOAD_IT_OUT() |
Typedefs | |
typedef enum eWorkload_val | eWorkload_val |
Enumerations | |
enum | eWorkload_val { Workload_average = 0 , Workload_worst , Workload_best } |
Workload type value enum. More... | |
Functions | |
float | get_Workload_load_perc (const eWorkload_val type) |
Get interrupts load percentage. | |
uint32_t | get_Workload_loop_period (const eWorkload_val type) |
Get main loop period. | |
FctERR | Workload_init (void) |
Init Workload functionalities. | |
void | set_Workload_ticks_us (const float ticks) |
Set number of timer ticks in a µs. | |
void | set_Workload_window (const uint32_t per) |
Set workload estimation time window (in ms) | |
void | Workload_handler (void) |
Workload handler. | |
void | Workload_show_results (void) |
Print workload results. | |
Variables | |
volatile uint32_t | it_ticks_accumulator |
volatile uint32_t | it_ticks_start |
volatile bool | it_counts_ongoing |
Workload estimation utilities.
Handler has to be called in the main sequential loop (or in a periodic task). Init function has to be called prior to main loop. WORLOAD_IT_IN macro has to be put at the start of every interrupt, WORLOAD_IT_OUT macro before return of every interrupt
#define GET_COUNT | ( | ) | DWT->CYCCNT |
#define WORKLOAD_IT_IN | ( | ) |
#define WORKLOAD_IT_OUT | ( | ) |
typedef enum eWorkload_val eWorkload_val |
enum eWorkload_val |
float get_Workload_load_perc | ( | const eWorkload_val | type | ) |
Get interrupts load percentage.
[in] | type | - Type to get |
uint32_t get_Workload_loop_period | ( | const eWorkload_val | type | ) |
Get main loop period.
[in] | type | - Type to get |
void set_Workload_ticks_us | ( | const float | ticks | ) |
Set number of timer ticks in a µs.
[in] | ticks | - Ticks in a µs |
void set_Workload_window | ( | const uint32_t | per | ) |
Set workload estimation time window (in ms)
[in] | per | - Time window in ms |
void Workload_handler | ( | void | ) |
Workload handler.
FctERR Workload_init | ( | void | ) |
Init Workload functionalities.
void Workload_show_results | ( | void | ) |
Print workload results.
|
extern |
|
extern |
volatile uint32_t it_ticks_start |