Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
busy_sim.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* busy_sim_cb_t) (void)
 

Functions

void busy_sim_start (uint32_t active_avg, uint32_t active_delta, uint32_t idle_avg, uint32_t idle_delta, busy_sim_cb_t cb)
 Start busy simulator.
 
void busy_sim_stop (void)
 Stop busy simulator.
 

Typedef Documentation

◆ busy_sim_cb_t

typedef void(* busy_sim_cb_t) (void)

Function Documentation

◆ busy_sim_start()

void busy_sim_start ( uint32_t  active_avg,
uint32_t  active_delta,
uint32_t  idle_avg,
uint32_t  idle_delta,
busy_sim_cb_t  cb 
)

Start busy simulator.

When started, it is using counter device to generate interrupts at random intervals and busy loop for random period of time in that interrupt. Interrupt source and priority is configured in the devicetree. Default entropy source is used for getting random numbers. System work queue is used to get random values and keep them in a ring buffer.

Parameters
active_avgAverage time of busy looping in the counter callback (in microseconds).
active_deltaSpecifies deviation from average time of busy looping (in microseconds).
idle_avgAverage time of counter alarm timeout (in microseconds).
idle_deltaSpecifies deviation from average time of counter alarm (in microseconds).
cbCallback called from the context of the busy simulator timeout. If ZLI interrupt is used for busy simulator counter then kernel API cannot be used from that callback. Callback is called before busy waiting.

◆ busy_sim_stop()

void busy_sim_stop ( void  )

Stop busy simulator.