SimAVR
AVR Simulator
Time Functions

The followings functions permits to convert AVR CPU cycles to time or frequency and reciprocally. More...

Functions

static avr_cycle_count_t avr_usec_to_cycles (struct avr_t *avr, uint32_t usec)
 Converts a number of usec to a number of machine cycles, at current speed. More...
 
static uint32_t avr_cycles_to_usec (struct avr_t *avr, avr_cycle_count_t cycles)
 Converts back a number of cycles to usecs (for usleep) More...
 
static uint64_t avr_cycles_to_nsec (struct avr_t *avr, avr_cycle_count_t cycles)
 Converts back a number of cycles to nsecs. More...
 
static avr_cycle_count_t avr_hz_to_cycles (avr_t *avr, uint32_t hz)
 Converts a number of hz (to megahertz etc) to a number of cycle. More...
 

Detailed Description

The followings functions permits to convert AVR CPU cycles to time or frequency and reciprocally.

Function Documentation

static uint64_t avr_cycles_to_nsec ( struct avr_t avr,
avr_cycle_count_t  cycles 
)
inlinestatic

Converts back a number of cycles to nsecs.

Here is the caller graph for this function:

static uint32_t avr_cycles_to_usec ( struct avr_t avr,
avr_cycle_count_t  cycles 
)
inlinestatic

Converts back a number of cycles to usecs (for usleep)

Here is the caller graph for this function:

static avr_cycle_count_t avr_hz_to_cycles ( avr_t avr,
uint32_t  hz 
)
inlinestatic

Converts a number of hz (to megahertz etc) to a number of cycle.

Here is the caller graph for this function:

static avr_cycle_count_t avr_usec_to_cycles ( struct avr_t avr,
uint32_t  usec 
)
inlinestatic

Converts a number of usec to a number of machine cycles, at current speed.

Here is the caller graph for this function: