File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -338,6 +338,22 @@ static inline uint64_t z_impl_counter_ticks_to_us(const struct device *dev,
338338 return ((uint64_t )ticks * USEC_PER_SEC ) / z_impl_counter_get_frequency (dev );
339339}
340340
341+ /**
342+ * @brief Function to convert ticks to nanoseconds.
343+ *
344+ * @param[in] dev Pointer to the device structure for the driver instance.
345+ * @param[in] ticks Ticks.
346+ *
347+ * @return Converted nanoseconds.
348+ */
349+ __syscall uint64_t counter_ticks_to_ns (const struct device * dev , uint32_t ticks );
350+
351+ static inline uint64_t z_impl_counter_ticks_to_ns (const struct device * dev ,
352+ uint32_t ticks )
353+ {
354+ return ((uint64_t )ticks * NSEC_PER_SEC ) / z_impl_counter_get_frequency (dev );
355+ }
356+
341357/**
342358 * @brief Function to retrieve maximum top value that can be set.
343359 *
You can’t perform that action at this time.
0 commit comments