1 /*
2  * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #pragma once
8 
9 #include "soc/clk_tree_defs.h"
10 
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14 
15 /**
16  * @brief GPTimer clock source
17  * @note User should select the clock source based on the power and resolution requirement
18  */
19 typedef soc_periph_gptimer_clk_src_t gptimer_clock_source_t;
20 
21 /**
22  * @brief GPTimer count direction
23  */
24 typedef enum {
25     GPTIMER_COUNT_DOWN, /*!< Decrease count value */
26     GPTIMER_COUNT_UP,   /*!< Increase count value */
27 } gptimer_count_direction_t;
28 
29 /**
30  * @brief GPTimer specific tasks that supported by the ETM module
31  */
32 typedef enum {
33     GPTIMER_ETM_TASK_START_COUNT, /*!< Start the counter */
34     GPTIMER_ETM_TASK_STOP_COUNT,  /*!< Stop the counter */
35     GPTIMER_ETM_TASK_EN_ALARM,    /*!< Enable the alarm */
36     GPTIMER_ETM_TASK_RELOAD,      /*!< Reload preset value into counter */
37     GPTIMER_ETM_TASK_CAPTURE,     /*!< Capture current count value into specific register */
38     GPTIMER_ETM_TASK_MAX,         /*!< Maximum number of tasks */
39 } gptimer_etm_task_type_t;
40 
41 /**
42  * @brief GPTimer specific events that supported by the ETM module
43  */
44 typedef enum {
45     GPTIMER_ETM_EVENT_ALARM_MATCH, /*!< Count value matches the alarm target value */
46     GPTIMER_ETM_EVENT_MAX,         /*!< Maximum number of events */
47 } gptimer_etm_event_type_t;
48 
49 #ifdef __cplusplus
50 }
51 #endif
52