-
Notifications
You must be signed in to change notification settings - Fork 36
Add support for Fitipower EK9716B LCD controller for CrowPanel 7.0" board #78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8803abe
Driver for the EK9716BD3
lboue 5cb4b76
Update ESP_Panel_Library.h to add EK9716B
lboue e456c1f
Rename EK9716BD3.cpp to EK9716B.cpp
lboue a3dbf87
Rename EK9716BD3.h to EK9716B.h
lboue 5f5964e
Update EK9716B.cpp
lboue 4c22442
Update EK9716B.h
lboue 023a1ef
Update LCD_Controllers.md
lboue 5e9a209
Update library.properties
lboue 0651fe8
Update ESP_PanelVersions.h
lboue a202ca1
Update README.md to add Fitipower EK9716B
lboue 763b4c0
Update README_CN.md
lboue 4b8ec3a
Update CROWPANEL_7_0.h board definition to work with EK9716B (#1)
lboue 161148e
Update Supported LCD Controllers for RGB example (#2)
lboue 8ae7ef4
CROWPANEL: Remove the extra line causing the error during build (#3)
lboue 4be9844
Update LCD_Controllers.md
lboue File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "soc/soc_caps.h" | ||
|
||
#if SOC_LCD_RGB_SUPPORTED | ||
#include "driver/gpio.h" | ||
#include "freertos/FreeRTOS.h" | ||
#include "freertos/task.h" | ||
#include "esp_check.h" | ||
#include "esp_lcd_panel_io.h" | ||
#include "esp_lcd_panel_rgb.h" | ||
#include "esp_lcd_panel_vendor.h" | ||
#include "esp_log.h" | ||
|
||
#include "ESP_PanelLog.h" | ||
#include "bus/RGB.h" | ||
#include "EK9716B.h" | ||
|
||
static const char *TAG = "EK9716B_CPP"; | ||
|
||
ESP_PanelLcd_EK9716B::ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, uint8_t color_bits, int rst_io): | ||
ESP_PanelLcd(bus, color_bits, rst_io) | ||
{ | ||
} | ||
|
||
ESP_PanelLcd_EK9716B::ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config): | ||
ESP_PanelLcd(bus, panel_config) | ||
{ | ||
} | ||
|
||
ESP_PanelLcd_EK9716B::~ESP_PanelLcd_EK9716B() | ||
{ | ||
ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); | ||
|
||
if (handle == NULL) { | ||
goto end; | ||
} | ||
|
||
if (!del()) { | ||
ESP_LOGE(TAG, "Delete device failed"); | ||
} | ||
|
||
end: | ||
ESP_LOGD(TAG, "Destroyed"); | ||
} | ||
|
||
bool ESP_PanelLcd_EK9716B::init(void) | ||
{ | ||
ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); | ||
|
||
if (panel_config.reset_gpio_num >= 0) { | ||
gpio_config_t gpio_conf = { | ||
.pin_bit_mask = BIT64(panel_config.reset_gpio_num), | ||
.mode = GPIO_MODE_OUTPUT, | ||
.pull_up_en = GPIO_PULLUP_DISABLE, | ||
.pull_down_en = GPIO_PULLDOWN_DISABLE, | ||
.intr_type = GPIO_INTR_DISABLE, | ||
}; | ||
ESP_PANEL_CHECK_ERR_RET(gpio_config(&gpio_conf), false, "`Config RST gpio failed"); | ||
} | ||
ESP_PANEL_CHECK_ERR_RET(esp_lcd_new_rgb_panel(vendor_config.rgb_config, &handle), false, "Create panel failed"); | ||
|
||
ESP_LOGD(TAG, "LCD panel @%p created", handle); | ||
|
||
return true; | ||
} | ||
|
||
bool ESP_PanelLcd_EK9716B::reset(void) | ||
{ | ||
ESP_PANEL_CHECK_NULL_RET(handle, false, "Invalid handle"); | ||
|
||
if (panel_config.reset_gpio_num >= 0) { | ||
gpio_set_level((gpio_num_t)panel_config.reset_gpio_num, panel_config.flags.reset_active_high); | ||
vTaskDelay(pdMS_TO_TICKS(10)); | ||
gpio_set_level((gpio_num_t)panel_config.reset_gpio_num, !panel_config.flags.reset_active_high); | ||
vTaskDelay(pdMS_TO_TICKS(120)); | ||
} | ||
ESP_PANEL_CHECK_ERR_RET(esp_lcd_panel_reset(handle), false, "Reset panel failed"); | ||
|
||
return true; | ||
} | ||
|
||
#endif /* SOC_LCD_RGB_SUPPORTED */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "soc/soc_caps.h" | ||
|
||
#if SOC_LCD_RGB_SUPPORTED | ||
#include "ESP_PanelLcd.h" | ||
|
||
/** | ||
* @brief EK9716B LCD device object class | ||
* | ||
* @note This class is a derived class of `ESP_PanelLcd`, user can use it directly | ||
*/ | ||
class ESP_PanelLcd_EK9716B: public ESP_PanelLcd { | ||
public: | ||
/** | ||
* @brief Construct a new LCD device in a simple way, the `init()` function should be called after this function | ||
* | ||
* @note This function uses some default values to config the LCD device, please use `config*()` functions to | ||
* change them | ||
* | ||
* @param bus Pointer of panel bus | ||
* @param color_bits Bits per pixel (24) | ||
* @param rst_io Reset pin, set to `-1` if no use | ||
*/ | ||
ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, uint8_t color_bits, int rst_io = -1); | ||
|
||
/** | ||
* @brief Construct a new LCD device in a complex way, the `init()` function should be called after this function | ||
* | ||
* @param bus Pointer of panel bus | ||
* @param panel_config LCD device configuration | ||
*/ | ||
ESP_PanelLcd_EK9716B(ESP_PanelBus *bus, const esp_lcd_panel_dev_config_t &panel_config); | ||
|
||
/** | ||
* @brief Destroy the LCD device | ||
* | ||
*/ | ||
~ESP_PanelLcd_EK9716B() override; | ||
|
||
/** | ||
* @brief Initialize the LCD device, the `begin()` function should be called after this function | ||
* | ||
* @note This function typically calls `esp_lcd_new_panel_*()` to create the LCD panel handle | ||
* | ||
* @return true if success, otherwise false | ||
*/ | ||
bool init(void) override; | ||
|
||
/** | ||
* @brief Reset the LCD. If the `rst_io` is not set, this function will do reset by software instead of hardware | ||
* | ||
* @note This function should be called after `init()` | ||
* | ||
* @return true if success, otherwise false | ||
*/ | ||
bool reset(void); | ||
}; | ||
|
||
#endif /* SOC_LCD_RGB_SUPPORTED */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.