|
| 1 | +/* |
| 2 | + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + */ |
| 6 | +#pragma once |
| 7 | + |
| 8 | +#include "soc/soc_caps.h" |
| 9 | + |
| 10 | +#if SOC_MIPI_DSI_SUPPORTED |
| 11 | +#include "ESP_PanelLcd.h" |
| 12 | +#include "base/esp_lcd_vendor_types.h" |
| 13 | +#include "base/esp_lcd_jd9365.h" |
| 14 | + |
| 15 | +/** |
| 16 | + * @brief JD9365 LCD device object class |
| 17 | + * |
| 18 | + * @note This class is a derived class of `ESP_PanelLcd`, user can use it directly |
| 19 | + */ |
| 20 | +class ESP_PanelLcd_JD9365: public ESP_PanelLcd { |
| 21 | +public: |
| 22 | + /** |
| 23 | + * @brief Construct a new LCD device in a simple way, the `init()` function should be called after this function |
| 24 | + * |
| 25 | + * @note This function uses some default values to config the LCD device, please use `config*()` functions to |
| 26 | + * change them |
| 27 | + * @note Vendor specific initialization can be different between manufacturers, should consult the LCD supplier |
| 28 | + * for initialization sequence code, and use `configVendorCommands()` to configure |
| 29 | + * |
| 30 | + * @param bus Pointer of panel bus |
| 31 | + * @param color_bits Bits per pixel (16/18/24) |
| 32 | + * @param rst_io Reset pin, set to -1 if no use |
| 33 | + */ |
| 34 | + ESP_PanelLcd_JD9365(ESP_PanelBus *bus, uint8_t color_bits, int rst_io = -1); |
| 35 | + |
| 36 | + /** |
| 37 | + * @brief Construct a new LCD in a complex way, the `init()` function should be called after this function |
| 38 | + * |
| 39 | + * @param bus Pointer of panel bus |
| 40 | + * @param panel_config LCD device configuration |
| 41 | + */ |
| 42 | + ESP_PanelLcd_JD9365(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config); |
| 43 | + |
| 44 | + /** |
| 45 | + * @brief Destroy the LCD device |
| 46 | + * |
| 47 | + */ |
| 48 | + ~ESP_PanelLcd_JD9365() override; |
| 49 | + |
| 50 | + /** |
| 51 | + * @brief Initialize the LCD device, the `begin()` function should be called after this function |
| 52 | + * |
| 53 | + * @note This function typically calls `esp_lcd_new_panel_*()` to create the LCD panel handle |
| 54 | + * |
| 55 | + * @return true if success, otherwise false |
| 56 | + */ |
| 57 | + bool init(void) override; |
| 58 | +}; |
| 59 | +#endif |
0 commit comments