|
HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
|
Workload estimation utilities. More...
#include <string.h>#include "sarmfsw.h"#include "TIM_ex.h"#include "tick_utils.h"#include "workload.h"
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. | |
| void | get_Workload_results (workload_res_t *const pResults) |
| Get full workload results. | |
| 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). | |
| uint32_t | get_Workload_window (void) |
| Get workload estimation time window (in ms). | |
| void | Workload_handler (void) |
| Workload handler. | |
Variables | |
| volatile uint32_t | it_ticks_accumulator = 0UL |
| volatile uint32_t | it_ticks_start |
| volatile bool | it_counts_ongoing = false |
| workload_res_t | workload = { {{ 0, 0, 10000UL }}, {{ 0, 0, (uint32_t) -1 }} } |
Workload estimation utilities.
IT_WORKLOAD symbol at project level to use workload estimation module functionalities 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
WORKLOAD_TIM_INST symbol has to be defined with proper TIM instance at project level. | 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 get_Workload_results | ( | workload_res_t *const | pResults | ) |
Get full workload results.
| [in,out] | pResults | - Pointer to results structure |
| uint32_t get_Workload_window | ( | void | ) |
Get workload estimation time window (in ms).
| 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.

| volatile bool it_counts_ongoing = false |
| volatile uint32_t it_ticks_accumulator = 0UL |
| volatile uint32_t it_ticks_start |
| workload_res_t workload = { {{ 0, 0, 10000UL }}, {{ 0, 0, (uint32_t) -1 }} } |