1 /*
2  * SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include <stdbool.h>
10 #include <stddef.h>
11 #include <stdint.h>
12 #include "soc/soc.h"
13 #include "hal/lp_timer_types.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 /*
20  * @brief set alarm target value
21  *
22  * @param timer_id timer num of lp_timer, 0 or 1 for esp32c6 and esp32h2
23  *
24  * @param value when counter reaches alarm value, alarm event will be triggered
25  */
26 void lp_timer_hal_set_alarm_target(uint8_t timer_id, uint64_t value);
27 
28 /**
29  * @brief get current counter value
30  */
31 uint64_t lp_timer_hal_get_cycle_count(void);
32 
33 /**
34  * @brief clear alarm interrupt status
35  */
36 void lp_timer_hal_clear_alarm_intr_status(void);
37 
38 /**
39  * @brief clear overflow interrupt status
40  */
41 void lp_timer_hal_clear_overflow_intr_status(void);
42 
43 #ifdef __cplusplus
44 }
45 #endif
46