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>
13 lines
140 B
Text
13 lines
140 B
Text
/*
|
|
* Copyright (c) 2024 Cienet
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
&rtc0 {
|
|
status = "okay";
|
|
};
|
|
|
|
&timer0 {
|
|
status = "okay";
|
|
};
|