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