Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sensor_clock.h File Reference
#include <stdint.h>

Go to the source code of this file.

Functions

int sensor_clock_get_cycles (uint64_t *cycles)
 Retrieve the current sensor clock cycles.
 
uint64_t sensor_clock_cycles_to_ns (uint64_t cycles)
 Convert clock cycles to nanoseconds.
 

Function Documentation

◆ sensor_clock_cycles_to_ns()

uint64_t sensor_clock_cycles_to_ns ( uint64_t cycles)

Convert clock cycles to nanoseconds.

This function converts clock cycles into nanoseconds based on the clock frequency.

Parameters
cyclesClock cycles to convert.
Returns
Time in nanoseconds.

◆ sensor_clock_get_cycles()

int sensor_clock_get_cycles ( uint64_t * cycles)

Retrieve the current sensor clock cycles.

This function obtains the current cycle count from the selected sensor clock source. The clock source may be the system clock or an external clock, depending on the configuration.

Parameters
[out]cyclesPointer to a 64-bit unsigned integer where the current clock cycle count will be stored.
Returns
0 on success, or an error code on failure.