1 /*
2  * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include "esp_private/systimer.h"
8 
9 /**
10  * @brief When systimer's clock source is XTAL (32MHz), it has a fixed fractional divider (2).
11  *        So the resolution of the systimer is 32MHz/2 = 16MHz.
12  */
systimer_ticks_to_us(uint64_t ticks)13 uint64_t systimer_ticks_to_us(uint64_t ticks)
14 {
15     return ticks / 16;
16 }
17 
systimer_us_to_ticks(uint64_t us)18 uint64_t systimer_us_to_ticks(uint64_t us)
19 {
20     return us * 16;
21 }
22