esp_lcd_panel_vendor.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #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. esp_lcd_color_space_t color_space; /*!< Set the color space used by the LCD panel */
  19. unsigned int bits_per_pixel; /*!< Color depth, in bpp */
  20. struct {
  21. unsigned int reset_active_high: 1; /*!< Setting this if the panel reset is high level active */
  22. } flags;
  23. void *vendor_config; /* vendor specific configuration, optional, left as NULL if not used */
  24. } esp_lcd_panel_dev_config_t;
  25. /**
  26. * @brief Create LCD panel for model ST7789
  27. *
  28. * @param[in] io LCD panel IO handle
  29. * @param[in] panel_dev_config general panel device configuration
  30. * @param[out] ret_panel Returned LCD panel handle
  31. * @return
  32. * - ESP_ERR_INVALID_ARG if parameter is invalid
  33. * - ESP_ERR_NO_MEM if out of memory
  34. * - ESP_OK on success
  35. */
  36. 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);
  37. /**
  38. * @brief Create LCD panel for model NT35510
  39. *
  40. * @param[in] io LCD panel IO handle
  41. * @param[in] panel_dev_config general panel device configuration
  42. * @param[out] ret_panel Returned LCD panel handle
  43. * @return
  44. * - ESP_ERR_INVALID_ARG if parameter is invalid
  45. * - ESP_ERR_NO_MEM if out of memory
  46. * - ESP_OK on success
  47. */
  48. 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);
  49. /**
  50. * @brief Create LCD panel for model SSD1306
  51. *
  52. * @param[in] io LCD panel IO handle
  53. * @param[in] panel_dev_config general panel device configuration
  54. * @param[out] ret_panel Returned LCD panel handle
  55. * @return
  56. * - ESP_ERR_INVALID_ARG if parameter is invalid
  57. * - ESP_ERR_NO_MEM if out of memory
  58. * - ESP_OK on success
  59. */
  60. 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);
  61. #ifdef __cplusplus
  62. }
  63. #endif