-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #22
- Loading branch information
Showing
12 changed files
with
400 additions
and
10 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -214,7 +214,7 @@ | |
* - CST816S | ||
* - FT5x06 | ||
* - GT911, GT1151 | ||
* - ST7123 | ||
* - ST1633, ST7123 | ||
* - TT21100 | ||
* - XPT2046 | ||
*/ | ||
|
This file contains 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 |
---|---|---|
|
@@ -214,7 +214,7 @@ | |
* - CST816S | ||
* - FT5x06 | ||
* - GT911, GT1151 | ||
* - ST7123 | ||
* - ST1633, ST7123 | ||
* - TT21100 | ||
* - XPT2046 | ||
*/ | ||
|
This file contains 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 |
---|---|---|
|
@@ -214,7 +214,7 @@ | |
* - CST816S | ||
* - FT5x06 | ||
* - GT911, GT1151 | ||
* - ST7123 | ||
* - ST1633, ST7123 | ||
* - TT21100 | ||
* - XPT2046 | ||
*/ | ||
|
This file contains 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 |
---|---|---|
|
@@ -214,7 +214,7 @@ | |
* - CST816S | ||
* - FT5x06 | ||
* - GT911, GT1151 | ||
* - ST7123 | ||
* - ST1633, ST7123 | ||
* - TT21100 | ||
* - XPT2046 | ||
*/ | ||
|
This file contains 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 |
---|---|---|
|
@@ -214,7 +214,7 @@ | |
* - CST816S | ||
* - FT5x06 | ||
* - GT911, GT1151 | ||
* - ST7123 | ||
* - ST1633, ST7123 | ||
* - TT21100 | ||
* - XPT2046 | ||
*/ | ||
|
This file contains 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 |
---|---|---|
|
@@ -214,7 +214,7 @@ | |
* - CST816S | ||
* - FT5x06 | ||
* - GT911, GT1151 | ||
* - ST7123 | ||
* - ST1633, ST7123 | ||
* - TT21100 | ||
* - XPT2046 | ||
*/ | ||
|
This file contains 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 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 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,46 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include "ESP_PanelLog.h" | ||
#include "ST1633.h" | ||
|
||
static const char *TAG = "ST1633_CPP"; | ||
|
||
ESP_PanelTouch_ST1633::ESP_PanelTouch_ST1633(ESP_PanelBus *bus, uint16_t width, uint16_t height, | ||
int rst_io, int int_io): | ||
ESP_PanelTouch(bus, width, height, rst_io, int_io) | ||
{ | ||
} | ||
|
||
ESP_PanelTouch_ST1633::ESP_PanelTouch_ST1633(ESP_PanelBus *bus, const esp_lcd_touch_config_t &config): | ||
ESP_PanelTouch(bus, config) | ||
{ | ||
} | ||
|
||
ESP_PanelTouch_ST1633::~ESP_PanelTouch_ST1633() | ||
{ | ||
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_PanelTouch_ST1633::begin(void) | ||
{ | ||
ESP_PANEL_CHECK_NULL_RET(bus, false, "Invalid bus"); | ||
|
||
ESP_PANEL_CHECK_ERR_RET(esp_lcd_touch_new_i2c_st1633(bus->getHandle(), &config, &handle), false, "New driver failed"); | ||
|
||
return true; | ||
} |
This file contains 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,50 @@ | ||
/* | ||
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
#include "base/esp_lcd_touch_st1633.h" | ||
#include "ESP_PanelTouch.h" | ||
|
||
/** | ||
* @brief ST1633 touch device object class | ||
* | ||
* @note This class is a derived class of `ESP_PanelTouch`, user can use it directly | ||
*/ | ||
class ESP_PanelTouch_ST1633 : public ESP_PanelTouch { | ||
public: | ||
/** | ||
* @brief Construct a new touch device in a simple way, the `init()` function should be called after this function | ||
* | ||
* @param bus Pointer to panel bus | ||
* @param width The width of the touch screen | ||
* @param height The height of the touch screen | ||
* @param rst_io The reset pin of the touch screen, set to `-1` if not used | ||
* @param int_io The interrupt pin of the touch screen, set to `-1` if not used | ||
*/ | ||
ESP_PanelTouch_ST1633(ESP_PanelBus *bus, uint16_t width, uint16_t height, int rst_io = -1, int int_io = -1); | ||
|
||
/** | ||
* @brief Construct a new touch device in a complex way, the `init()` function should be called after this function | ||
* | ||
* @param bus Pointer to panel bus | ||
* @param config Touch device configuration | ||
*/ | ||
ESP_PanelTouch_ST1633(ESP_PanelBus *bus, const esp_lcd_touch_config_t &config); | ||
|
||
/** | ||
* @brief Destroy the LCD device | ||
* | ||
*/ | ||
~ESP_PanelTouch_ST1633() override; | ||
|
||
/** | ||
* @brief Startup the touch device | ||
* | ||
* @return true if success, otherwise false | ||
*/ | ||
bool begin(void) override; | ||
}; |
Oops, something went wrong.