Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
Architecture timing APIs

Functions

void arch_busy_wait (uint32_t usec_to_wait)
 
static uint32_t arch_k_cycle_get_32 (void)
 
void arch_timing_init (void)
 Initialize the timing subsystem. More...
 
void arch_timing_start (void)
 Signal the start of the timing information gathering. More...
 
void arch_timing_stop (void)
 Signal the end of the timing information gathering. More...
 
timing_t arch_timing_counter_get (void)
 Return timing counter. More...
 
uint64_t arch_timing_cycles_get (volatile timing_t *const start, volatile timing_t *const end)
 Get number of cycles between start and end. More...
 
uint64_t arch_timing_freq_get (void)
 Get frequency of counter used (in Hz). More...
 
uint64_t arch_timing_cycles_to_ns (uint64_t cycles)
 Convert number of cycles into nanoseconds. More...
 
uint64_t arch_timing_cycles_to_ns_avg (uint64_t cycles, uint32_t count)
 Convert number of cycles into nanoseconds with averaging. More...
 
uint32_t arch_timing_freq_get_mhz (void)
 Get frequency of counter used (in MHz). More...
 

Detailed Description

Function Documentation

◆ arch_busy_wait()

void arch_busy_wait ( uint32_t  usec_to_wait)

#include <kernel/include/kernel_arch_interface.h>

Architecture-specific implementation of busy-waiting

Parameters
usec_to_waitWait period, in microseconds

◆ arch_k_cycle_get_32()

static uint32_t arch_k_cycle_get_32 ( void  )
inlinestatic

#include <include/sys/arch_interface.h>

Obtain the current cycle count, in units that are hardware-specific

See also
k_cycle_get_32()

◆ arch_timing_counter_get()

timing_t arch_timing_counter_get ( void  )

#include <include/sys/arch_interface.h>

Return timing counter.

Returns
Timing counter.
See also
timing_counter_get()

◆ arch_timing_cycles_get()

uint64_t arch_timing_cycles_get ( volatile timing_t *const  start,
volatile timing_t *const  end 
)

#include <include/sys/arch_interface.h>

Get number of cycles between start and end.

For some architectures or SoCs, the raw numbers from counter need to be scaled to obtain actual number of cycles.

Parameters
startPointer to counter at start of a measured execution.
endPointer to counter at stop of a measured execution.
Returns
Number of cycles between start and end.
See also
timing_cycles_get()

◆ arch_timing_cycles_to_ns()

uint64_t arch_timing_cycles_to_ns ( uint64_t  cycles)

#include <include/sys/arch_interface.h>

Convert number of cycles into nanoseconds.

Parameters
cyclesNumber of cycles
Returns
Converted time value
See also
timing_cycles_to_ns()

◆ arch_timing_cycles_to_ns_avg()

uint64_t arch_timing_cycles_to_ns_avg ( uint64_t  cycles,
uint32_t  count 
)

#include <include/sys/arch_interface.h>

Convert number of cycles into nanoseconds with averaging.

Parameters
cyclesNumber of cycles
countTimes of accumulated cycles to average over
Returns
Converted time value
See also
timing_cycles_to_ns_avg()

◆ arch_timing_freq_get()

uint64_t arch_timing_freq_get ( void  )

#include <include/sys/arch_interface.h>

Get frequency of counter used (in Hz).

Returns
Frequency of counter used for timing in Hz.
See also
timing_freq_get()

◆ arch_timing_freq_get_mhz()

uint32_t arch_timing_freq_get_mhz ( void  )

#include <include/sys/arch_interface.h>

Get frequency of counter used (in MHz).

Returns
Frequency of counter used for timing in MHz.
See also
timing_freq_get_mhz()

◆ arch_timing_init()

void arch_timing_init ( void  )

#include <include/sys/arch_interface.h>

Initialize the timing subsystem.

Perform the necessary steps to initialize the timing subsystem.

See also
timing_init()

◆ arch_timing_start()

void arch_timing_start ( void  )

#include <include/sys/arch_interface.h>

Signal the start of the timing information gathering.

Signal to the timing subsystem that timing information will be gathered from this point forward.

See also
timing_start()

◆ arch_timing_stop()

void arch_timing_stop ( void  )

#include <include/sys/arch_interface.h>

Signal the end of the timing information gathering.

Signal to the timing subsystem that timing information is no longer being gathered from this point forward.

See also
timing_stop()