esp_lcd_panel_io_interface.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdbool.h>
  8. #include "esp_err.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef struct esp_lcd_panel_io_t esp_lcd_panel_io_t; /*!< Type of LCD panel IO */
  13. /**
  14. * @brief LCD panel IO interface
  15. */
  16. struct esp_lcd_panel_io_t {
  17. /**
  18. * @brief Transmit LCD command and corresponding parameters
  19. *
  20. * @note This is the panel-specific interface called by function `esp_lcd_panel_io_tx_param()`.
  21. *
  22. * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()`
  23. * @param[in] lcd_cmd The specific LCD command
  24. * @param[in] param Buffer that holds the command specific parameters, set to NULL if no parameter is needed for the command
  25. * @param[in] param_size Size of `param` in memory, in bytes, set to zero if no parameter is needed for the command
  26. * @return
  27. * - ESP_ERR_INVALID_ARG if parameter is invalid
  28. * - ESP_OK on success
  29. */
  30. esp_err_t (*tx_param)(esp_lcd_panel_io_t *io, int lcd_cmd, const void *param, size_t param_size);
  31. /**
  32. * @brief Transmit LCD RGB data
  33. *
  34. * @note This is the panel-specific interface called by function `esp_lcd_panel_io_tx_color()`.
  35. *
  36. * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()`
  37. * @param[in] lcd_cmd The specific LCD command
  38. * @param[in] color Buffer that holds the RGB color data
  39. * @param[in] color_size Size of `color` in memory, in bytes
  40. * @return
  41. * - ESP_ERR_INVALID_ARG if parameter is invalid
  42. * - ESP_OK on success
  43. */
  44. esp_err_t (*tx_color)(esp_lcd_panel_io_t *io, int lcd_cmd, const void *color, size_t color_size);
  45. /**
  46. * @brief Destory LCD panel IO handle (deinitialize all and free resource)
  47. *
  48. * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()`
  49. * @return
  50. * - ESP_ERR_INVALID_ARG if parameter is invalid
  51. * - ESP_OK on success
  52. */
  53. esp_err_t (*del)(esp_lcd_panel_io_t *io);
  54. };
  55. #ifdef __cplusplus
  56. }
  57. #endif