esp_lcd_panel_io_interface.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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] lcd_cmd_bits Length of LCD command, in bits (e.g. 8 bits or 16 bits)
  25. * @param[in] param Buffer that holds the command specific parameters, set to NULL if no parameter is needed for the command
  26. * @param[in] param_size Size of `param` in memory, in bytes, set to zero if no parameter is needed for the command
  27. * @return
  28. * - ESP_ERR_INVALID_ARG if parameter is invalid
  29. * - ESP_OK on success
  30. */
  31. esp_err_t (*tx_param)(esp_lcd_panel_io_t *io, int lcd_cmd, int lcd_cmd_bits, const void *param, size_t param_size);
  32. /**
  33. * @brief Transmit LCD RGB data
  34. *
  35. * @note This is the panel-specific interface called by function `esp_lcd_panel_io_tx_color()`.
  36. *
  37. * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()`
  38. * @param[in] lcd_cmd The specific LCD command
  39. * @param[in] lcd_cmd_bits Length of LCD command, in bits (e.g. 8 bits or 16 bits)
  40. * @param[in] color Buffer that holds the RGB color data
  41. * @param[in] color_size Size of `color` in memory, in bytes
  42. * @return
  43. * - ESP_ERR_INVALID_ARG if parameter is invalid
  44. * - ESP_OK on success
  45. */
  46. esp_err_t (*tx_color)(esp_lcd_panel_io_t *io, int lcd_cmd, int lcd_cmd_bits, const void *color, size_t color_size);
  47. /**
  48. * @brief Destory LCD panel IO handle (deinitialize all and free resource)
  49. *
  50. * @param[in] io LCD panel IO handle, which is created by other factory API like `esp_lcd_new_panel_io_spi()`
  51. * @return
  52. * - ESP_ERR_INVALID_ARG if parameter is invalid
  53. * - ESP_OK on success
  54. */
  55. esp_err_t (*del)(esp_lcd_panel_io_t *io);
  56. };
  57. #ifdef __cplusplus
  58. }
  59. #endif