pcnt_hal.h 1.0 KB

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