esp_lcd_panel_vendor.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 <stdbool.h>
  8. #include "esp_err.h"
  9. #include "esp_lcd_types.h"
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. /**
  14. * @brief Configuration structure for panel device
  15. */
  16. typedef struct {
  17. int reset_gpio_num; /*!< GPIO used to reset the LCD panel, set to -1 if it's not used */
  18. union {
  19. lcd_color_rgb_endian_t color_space; /*!< @deprecated Set RGB color space, please use rgb_endian instead */
  20. lcd_color_rgb_endian_t rgb_endian; /*!< Set RGB data endian: RGB or BGR */
  21. };
  22. unsigned int bits_per_pixel; /*!< Color depth, in bpp */
  23. struct {
  24. unsigned int reset_active_high: 1; /*!< Setting this if the panel reset is high level active */
  25. } flags; /*!< LCD panel config flags */
  26. void *vendor_config; /*!< vendor specific configuration, optional, left as NULL if not used */
  27. } esp_lcd_panel_dev_config_t;
  28. /**
  29. * @brief Create LCD panel for model ST7789
  30. *
  31. * @param[in] io LCD panel IO handle
  32. * @param[in] panel_dev_config general panel device configuration
  33. * @param[out] ret_panel Returned LCD panel handle
  34. * @return
  35. * - ESP_ERR_INVALID_ARG if parameter is invalid
  36. * - ESP_ERR_NO_MEM if out of memory
  37. * - ESP_OK on success
  38. */
  39. esp_err_t esp_lcd_new_panel_st7789(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *panel_dev_config, esp_lcd_panel_handle_t *ret_panel);
  40. /**
  41. * @brief Create LCD panel for model NT35510
  42. *
  43. * @param[in] io LCD panel IO handle
  44. * @param[in] panel_dev_config general panel device configuration
  45. * @param[out] ret_panel Returned LCD panel handle
  46. * @return
  47. * - ESP_ERR_INVALID_ARG if parameter is invalid
  48. * - ESP_ERR_NO_MEM if out of memory
  49. * - ESP_OK on success
  50. */
  51. esp_err_t esp_lcd_new_panel_nt35510(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *panel_dev_config, esp_lcd_panel_handle_t *ret_panel);
  52. /**
  53. * @brief Create LCD panel for model SSD1306
  54. *
  55. * @param[in] io LCD panel IO handle
  56. * @param[in] panel_dev_config general panel device configuration
  57. * @param[out] ret_panel Returned LCD panel handle
  58. * @return
  59. * - ESP_ERR_INVALID_ARG if parameter is invalid
  60. * - ESP_ERR_NO_MEM if out of memory
  61. * - ESP_OK on success
  62. */
  63. esp_err_t esp_lcd_new_panel_ssd1306(const esp_lcd_panel_io_handle_t io, const esp_lcd_panel_dev_config_t *panel_dev_config, esp_lcd_panel_handle_t *ret_panel);
  64. #ifdef __cplusplus
  65. }
  66. #endif