mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-30 17:45:23 +00:00
This commit introduces a new Sensor Clock API, enabling the retrieval of cycle counts and conversion to nanoseconds based on the system or external clock. The API includes: - `sensor_clock_get_cycles()` to get the current cycle count from the sensor clock. - `sensor_clock_cycles_to_ns()` to convert cycles to nanoseconds using the clock's frequency. The implementation supports both system clocks and external clocks defined in the device tree, making the sensor clock integration more flexible for various sensor use cases. Signed-off-by: Mark Chen <mark.chen@cienet.com>
12 lines
131 B
Plaintext
12 lines
131 B
Plaintext
/*
|
|
* Copyright (c) 2024 Cienet
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
/ {
|
|
chosen {
|
|
zephyr,sensor-clock = &rtc0;
|
|
};
|
|
};
|