-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from hpsaturn/devel
Devel
Showing
22 changed files
with
361 additions
and
393 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 |
---|---|---|
|
@@ -44,4 +44,4 @@ deploy.sh | |
releases | ||
releases/binaries/ | ||
releases/installer/ | ||
examples/espcamlib | ||
examples/lib/espcamlib |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,11 @@ | ||
#define CONFIG_KEYS_LIST \ | ||
X(KLPAN, "lSpan", INT) \ | ||
X(KLOFST, "lOffset", INT) \ | ||
X(KLCENT, "lCenter", INT) \ | ||
X(KRPAN, "rSpan", INT) \ | ||
X(KROFST, "rOffset", INT) \ | ||
X(KRCENT, "rCenter", INT) \ | ||
X(KDBAND, "deathBand", INT) \ | ||
X(KPHERTZ, "periodHertz", INT) \ | ||
X(KDEBUG, "debug", BOOL) \ | ||
X(KCOUNT, "KCOUNT", UNKNOWN) |
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
59 changes: 59 additions & 0 deletions
59
examples/tft-il9485-basic-receiver/lgfx_custom_ili9341_conf.hpp
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,59 @@ | ||
#ifndef LGFX_CUSTOMBOARD_CONF_HPP | ||
#define LGFX_CUSTOMBOARD_CONF_HPP | ||
|
||
#define LGFX_USE_V1 | ||
|
||
#include "LovyanGFX.hpp" | ||
|
||
class LGFX : public lgfx::LGFX_Device | ||
{ | ||
lgfx::Panel_ILI9341 _panel_instance; | ||
lgfx::Bus_SPI _bus_instance; | ||
|
||
public: | ||
LGFX(void) | ||
{ | ||
{ | ||
auto cfg = _bus_instance.config(); | ||
cfg.spi_host = VSPI_HOST; | ||
cfg.spi_mode = 0; | ||
cfg.freq_write = 27000000; | ||
cfg.freq_read = 10000000; | ||
cfg.spi_3wire = true; | ||
cfg.use_lock = false; | ||
//cfg.dma_channel = SPI_DMA_CH_AUTO; | ||
cfg.pin_sclk = 18; | ||
cfg.pin_mosi = 23; | ||
cfg.pin_miso = 19; | ||
cfg.pin_dc = 27; | ||
_bus_instance.config(cfg); | ||
_panel_instance.setBus(&_bus_instance); | ||
} | ||
|
||
{ | ||
auto cfg = _panel_instance.config(); | ||
cfg.pin_cs = 14; | ||
cfg.pin_rst = 33; | ||
cfg.pin_busy = -1; | ||
cfg.panel_width = 320; | ||
cfg.panel_height = 240; | ||
cfg.memory_width = 320; | ||
cfg.memory_height = 240; | ||
cfg.offset_x = 0; | ||
cfg.offset_y = 0; | ||
cfg.offset_rotation = 3; | ||
cfg.dummy_read_pixel = 8; | ||
cfg.dummy_read_bits = 1; | ||
cfg.readable = true; | ||
cfg.invert = true; | ||
cfg.rgb_order = false; | ||
cfg.dlen_16bit = false; | ||
cfg.bus_shared = true; | ||
_panel_instance.config(cfg); | ||
} | ||
|
||
setPanel(&_panel_instance); | ||
} | ||
}; | ||
|
||
#endif |
55 changes: 55 additions & 0 deletions
55
examples/tft-il9485-basic-receiver/tft-il9485-basic-receiver.cpp
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,55 @@ | ||
/** | ||
* Sample shared by @turmandreams | ||
* Board: M5Stack Basic Core | ||
*/ | ||
|
||
#include <Arduino.h> | ||
#include <ESPNowCam.h> | ||
#include "lgfx_custom_ili9341_conf.hpp" | ||
#include <LGFX_TFT_eSPI.hpp> | ||
// #include <Utils.h> | ||
|
||
ESPNowCam radio; | ||
|
||
static TFT_eSPI lcd; // Instance of LGFX | ||
static TFT_eSprite sprite(&lcd); // Instance of LGFX_Sprite when using sprites | ||
|
||
// frame buffer | ||
uint8_t fb[60000]; | ||
// display globals | ||
int32_t dw = 320; | ||
int32_t dh = 240; | ||
|
||
void onDataReady(uint32_t lenght) { | ||
lcd.drawJpg(fb, lenght, 0, 0, dw, dh); | ||
// printFPS("MF:"); | ||
} | ||
|
||
void setup(void) { | ||
Serial.begin(115200); | ||
|
||
pinMode(32, OUTPUT); // Back Light | ||
digitalWrite(32, HIGH); | ||
|
||
lcd.init(); | ||
lcd.setRotation(1); | ||
lcd.setBrightness(128); | ||
lcd.setColorDepth(16); | ||
|
||
lcd.drawRect(0, 0, 320, 240, (uint16_t)0x1F); // green | ||
delay(1000); | ||
|
||
lcd.drawRect(0, 0, 320, 240, (uint16_t)0xF1); // green | ||
delay(1000); | ||
|
||
radio.setRecvBuffer(fb); | ||
radio.setRecvCallback(onDataReady); | ||
|
||
if (radio.init()) { | ||
lcd.drawString("ESPNow Init Success", dw / 2, dh / 2); | ||
Serial.println("ESPNow Init Success"); | ||
} | ||
delay(500); | ||
} | ||
|
||
void loop(void) {} |
110 changes: 110 additions & 0 deletions
110
examples/tft-rgb-hmi-basic-receiver/LGFX_ESP32S3_RGB_ESP32-8048S043.h
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,110 @@ | ||
|
||
#define LGFX_USE_V1 | ||
#include <LovyanGFX.hpp> | ||
|
||
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp> | ||
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp> | ||
|
||
#include <driver/i2c.h> | ||
|
||
class LGFX : public lgfx::LGFX_Device | ||
{ | ||
public: | ||
|
||
lgfx::Bus_RGB _bus_instance; | ||
lgfx::Panel_RGB _panel_instance; | ||
lgfx::Light_PWM _light_instance; | ||
lgfx::Touch_GT911 _touch_instance; | ||
|
||
LGFX(void) | ||
{ | ||
{ | ||
auto cfg = _panel_instance.config(); | ||
|
||
cfg.memory_width = 800; | ||
cfg.memory_height = 480; | ||
cfg.panel_width = 800; | ||
cfg.panel_height = 480; | ||
|
||
cfg.offset_x = 0; | ||
cfg.offset_y = 0; | ||
|
||
_panel_instance.config(cfg); | ||
} | ||
|
||
{ | ||
auto cfg = _panel_instance.config_detail(); | ||
|
||
cfg.use_psram = 1; | ||
|
||
_panel_instance.config_detail(cfg); | ||
} | ||
|
||
{ | ||
auto cfg = _bus_instance.config(); | ||
cfg.panel = &_panel_instance; | ||
cfg.pin_d0 = GPIO_NUM_8; // B0 | ||
cfg.pin_d1 = GPIO_NUM_3; // B1 | ||
cfg.pin_d2 = GPIO_NUM_46; // B2 | ||
cfg.pin_d3 = GPIO_NUM_9; // B3 | ||
cfg.pin_d4 = GPIO_NUM_1; // B4 | ||
cfg.pin_d5 = GPIO_NUM_5; // G0 | ||
cfg.pin_d6 = GPIO_NUM_6; // G1 | ||
cfg.pin_d7 = GPIO_NUM_7; // G2 | ||
cfg.pin_d8 = GPIO_NUM_15; // G3 | ||
cfg.pin_d9 = GPIO_NUM_16; // G4 | ||
cfg.pin_d10 = GPIO_NUM_4; // G5 | ||
cfg.pin_d11 = GPIO_NUM_45; // R0 | ||
cfg.pin_d12 = GPIO_NUM_48; // R1 | ||
cfg.pin_d13 = GPIO_NUM_47; // R2 | ||
cfg.pin_d14 = GPIO_NUM_21; // R3 | ||
cfg.pin_d15 = GPIO_NUM_14; // R4 | ||
|
||
cfg.pin_henable = GPIO_NUM_40; | ||
cfg.pin_vsync = GPIO_NUM_41; | ||
cfg.pin_hsync = GPIO_NUM_39; | ||
cfg.pin_pclk = GPIO_NUM_42; | ||
cfg.freq_write = 14000000; | ||
|
||
cfg.hsync_polarity = 0; | ||
cfg.hsync_front_porch = 8; | ||
cfg.hsync_pulse_width = 4; | ||
cfg.hsync_back_porch = 16; | ||
cfg.vsync_polarity = 0; | ||
cfg.vsync_front_porch = 4; | ||
cfg.vsync_pulse_width = 4; | ||
cfg.vsync_back_porch = 4; | ||
cfg.pclk_idle_high = 1; | ||
_bus_instance.config(cfg); | ||
} | ||
_panel_instance.setBus(&_bus_instance); | ||
|
||
{ | ||
auto cfg = _light_instance.config(); | ||
cfg.pin_bl = GPIO_NUM_2; | ||
_light_instance.config(cfg); | ||
} | ||
_panel_instance.light(&_light_instance); | ||
|
||
{ | ||
auto cfg = _touch_instance.config(); | ||
cfg.x_min = 0; | ||
cfg.x_max = 800; | ||
cfg.y_min = 0; | ||
cfg.y_max = 480; | ||
cfg.pin_int = GPIO_NUM_18; | ||
cfg.bus_shared = false; | ||
cfg.offset_rotation = 0; | ||
// I2C接続 | ||
cfg.i2c_port = I2C_NUM_1; | ||
cfg.pin_sda = GPIO_NUM_19; | ||
cfg.pin_scl = GPIO_NUM_20; | ||
cfg.freq = 400000; | ||
cfg.i2c_addr = 0x14; // 0x5D , 0x14 | ||
_touch_instance.config(cfg); | ||
_panel_instance.setTouch(&_touch_instance); | ||
} | ||
|
||
setPanel(&_panel_instance); | ||
} | ||
}; |
57 changes: 57 additions & 0 deletions
57
examples/tft-rgb-hmi-basic-receiver/tft-rgb-hmi-basic-receiver.cpp
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,57 @@ | ||
/** | ||
* Sample shared by @MeloCuentan | ||
* Board: | ||
* https://www.aliexpress.com/item/1005006625303218.html | ||
*/ | ||
|
||
#include <Arduino.h> | ||
#include <HardwareSerial.h> | ||
|
||
#include "LGFX_ESP32S3_RGB_ESP32-8048S043.h" | ||
#include <LGFX_TFT_eSPI.hpp> | ||
|
||
#include "ESPNowCam.h" | ||
|
||
static LGFX tft; | ||
|
||
ESPNowCam radio; | ||
|
||
// frame buffer | ||
uint8_t *fb; | ||
|
||
// display globals | ||
int32_t dw = 800; | ||
int32_t dh = 480; | ||
|
||
void onDataReady(uint32_t lenght) { tft.drawJpg(fb, lenght, 0, 0, dw, dh); } | ||
|
||
void setup(void) { | ||
tft.init(); | ||
tft.setRotation(0); | ||
|
||
pinMode(2, OUTPUT); // Display brightness enable | ||
analogWriteResolution(8); // PWM resolution | ||
analogWriteFrequency(1000); // PWM frequency | ||
analogWrite(2, 127); // Brightness set | ||
|
||
tft.setTextColor(TFT_WHITE); | ||
|
||
// BE CAREFUL WITH IT, IF JPG LEVEL CHANGES, INCREASE IT | ||
fb = (uint8_t *)malloc(30000 * sizeof(uint8_t)); | ||
|
||
radio.setRecvBuffer(fb); | ||
radio.setRecvCallback(onDataReady); | ||
|
||
if (radio.init()) { | ||
String text = "ESPNow Init Success"; | ||
uint8_t textLenght = text.length(); | ||
uint8_t textSize = 4; | ||
uint16_t posX = (800 - (textSize * 6 * textLenght)) / 2; | ||
uint16_t posY = ((480 - (textSize * 8)) / 3) * 2; | ||
tft.setTextSize(textSize); | ||
tft.drawString(text, posX, posY); | ||
} | ||
delay(500); | ||
} | ||
|
||
void loop(void) {} |
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
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
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
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