1 /*
2  * SPDX-FileCopyrightText: 2015-2022 Espressif Systems (Shanghai) CO LTD
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /*******************************************************************************
8  * NOTICE
9  * The hal is not public api, don't use in application code.
10  * See readme.md in hal/include/hal/readme.md
11  ******************************************************************************/
12 
13 #pragma once
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 typedef struct pcnt_dev_t *pcnt_soc_handle_t; // PCNT SOC layer handle
20 
21 /**
22  * Context that should be maintained by both the driver and the HAL
23  */
24 typedef struct {
25     pcnt_soc_handle_t dev; // PCNT SOC layer handle
26 } pcnt_hal_context_t;
27 
28 /**
29  * @brief Init the PCNT hal and set the PCNT to the default configuration.
30  * @note This function should be called first before other hal layer function is called.
31  *
32  * @param hal Context of the HAL layer
33  * @param group_id PCNT group ID
34  */
35 void pcnt_hal_init(pcnt_hal_context_t *hal, int group_id);
36 
37 #ifdef __cplusplus
38 }
39 #endif
40