led_strip_encoder.h 906 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include "driver/rmt_encoder.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. /**
  13. * @brief Type of led strip encoder configuration
  14. */
  15. typedef struct {
  16. uint32_t resolution; /*!< Encoder resolution, in Hz */
  17. } led_strip_encoder_config_t;
  18. /**
  19. * @brief Create RMT encoder for encoding LED strip pixels into RMT symbols
  20. *
  21. * @param[in] config Encoder configuration
  22. * @param[out] ret_encoder Returned encoder handle
  23. * @return
  24. * - ESP_ERR_INVALID_ARG for any invalid arguments
  25. * - ESP_ERR_NO_MEM out of memory when creating led strip encoder
  26. * - ESP_OK if creating encoder successfully
  27. */
  28. esp_err_t rmt_new_led_strip_encoder(const led_strip_encoder_config_t *config, rmt_encoder_handle_t *ret_encoder);
  29. #ifdef __cplusplus
  30. }
  31. #endif