2021-09-27 04:46:51 +00:00
|
|
|
/*
|
2023-07-28 04:06:14 +00:00
|
|
|
* SPDX-FileCopyrightText: 2021-2023 Espressif Systems (Shanghai) CO LTD
|
2021-09-27 04:46:51 +00:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
2019-07-15 06:21:36 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-07-28 04:06:14 +00:00
|
|
|
#include "soc/soc_caps.h"
|
2022-03-25 10:41:25 +00:00
|
|
|
#include "soc/clk_tree_defs.h"
|
2021-12-17 01:57:27 +00:00
|
|
|
|
2019-07-15 06:21:36 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-07-28 04:06:14 +00:00
|
|
|
#if SOC_GPTIMER_SUPPORTED
|
2019-07-15 06:21:36 +00:00
|
|
|
/**
|
2021-09-27 04:46:51 +00:00
|
|
|
* @brief GPTimer clock source
|
2022-04-13 05:12:30 +00:00
|
|
|
* @note User should select the clock source based on the power and resolution requirement
|
2019-07-15 06:21:36 +00:00
|
|
|
*/
|
2022-03-25 10:41:25 +00:00
|
|
|
typedef soc_periph_gptimer_clk_src_t gptimer_clock_source_t;
|
2023-07-28 04:06:14 +00:00
|
|
|
#else
|
|
|
|
/**
|
|
|
|
* @brief Default type
|
|
|
|
*/
|
|
|
|
typedef int gptimer_clock_source_t;
|
|
|
|
#endif
|
2019-07-15 06:21:36 +00:00
|
|
|
|
2019-07-15 06:21:36 +00:00
|
|
|
/**
|
2021-09-27 04:46:51 +00:00
|
|
|
* @brief GPTimer count direction
|
2019-07-15 06:21:36 +00:00
|
|
|
*/
|
|
|
|
typedef enum {
|
2021-09-27 04:46:51 +00:00
|
|
|
GPTIMER_COUNT_DOWN, /*!< Decrease count value */
|
|
|
|
GPTIMER_COUNT_UP, /*!< Increase count value */
|
|
|
|
} gptimer_count_direction_t;
|
2019-07-25 01:52:36 +00:00
|
|
|
|
2022-07-13 05:17:32 +00:00
|
|
|
/**
|
|
|
|
* @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;
|
|
|
|
|
2019-07-15 06:21:36 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|