-
Notifications
You must be signed in to change notification settings - Fork 7.1k
/
gptimer_types.h
42 lines (35 loc) · 1018 Bytes
/
gptimer_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
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <stdint.h>
#include <stdbool.h>
#include "hal/timer_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Type of General Purpose Timer handle
*/
typedef struct gptimer_t *gptimer_handle_t;
/**
* @brief GPTimer alarm event data
*/
typedef struct {
uint64_t count_value; /*!< Current count value */
uint64_t alarm_value; /*!< Current alarm value */
} gptimer_alarm_event_data_t;
/**
* @brief Timer alarm callback prototype
*
* @param[in] timer Timer handle created by `gptimer_new_timer`
* @param[in] edata Alarm event data, fed by driver
* @param[in] user_ctx User data, passed from `gptimer_register_event_callbacks`
* @return Whether a high priority task has been waken up by this function
*/
typedef bool (*gptimer_alarm_cb_t) (gptimer_handle_t timer, const gptimer_alarm_event_data_t *edata, void *user_ctx);
#ifdef __cplusplus
}
#endif