mirror of https://github.com/arendst/Tasmota.git
Merge branch 'development' of github.com:arendst/Tasmota into pr_tm1638
This commit is contained in:
commit
fe27054e4e
|
@ -136,7 +136,7 @@ static const uint8_t PROGMEM ili9342_initcmd[] = {
|
|||
0x00 // End of list
|
||||
};
|
||||
|
||||
ILI9341_2::ILI9341_2(int8_t cs, int8_t mosi, int8_t miso, int8_t sclk, int8_t res, int8_t dc, int8_t bp, int8_t spibus) : Renderer(ILI9341_TFTWIDTH, ILI9341_TFTHEIGHT) {
|
||||
ILI9341_2::ILI9341_2(int8_t cs, int8_t mosi, int8_t miso, int8_t sclk, int8_t res, int8_t dc, int8_t bp, int8_t spibus, uint8_t dtype) : Renderer(ILI9341_TFTWIDTH, ILI9341_TFTHEIGHT) {
|
||||
_cs = cs;
|
||||
_mosi = mosi;
|
||||
_miso = miso;
|
||||
|
@ -144,7 +144,7 @@ ILI9341_2::ILI9341_2(int8_t cs, int8_t mosi, int8_t miso, int8_t sclk, int8_t re
|
|||
_res = res;
|
||||
_dc = dc;
|
||||
_bp = bp;
|
||||
_hwspi = 1; // sign ili9341
|
||||
_hwspi = dtype; // sign ili9341 or 2
|
||||
_spibus = spibus;
|
||||
}
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@ class ILI9341_2 : public Renderer {
|
|||
|
||||
public:
|
||||
|
||||
ILI9341_2(int8_t cs, int8_t mosi, int8_t miso, int8_t sclk, int8_t res, int8_t dc, int8_t bp, int8_t spibus);
|
||||
ILI9341_2(int8_t cs, int8_t mosi, int8_t miso, int8_t sclk, int8_t res, int8_t dc, int8_t bp, int8_t spibus, uint8_t dtype);
|
||||
ILI9341_2(int8_t cs, int8_t res, int8_t dc, int8_t bp);
|
||||
|
||||
void init(uint16_t width, uint16_t height);
|
||||
|
|
|
@ -28,17 +28,32 @@
|
|||
* Supported commands:
|
||||
* WcStream = Control streaming, 0 = stop, 1 = start
|
||||
* WcResolution = Set resolution
|
||||
* 0 = FRAMESIZE_96x96, (96x96)
|
||||
* 1 = FRAMESIZE_QQVGA2 (128x160)
|
||||
* 2 = FRAMESIZE_QCIF (176x144)
|
||||
* 3 = FRAMESIZE_HQVGA (240x176)
|
||||
* 4 = FRAMESIZE_QVGA (320x240)
|
||||
* 5 = FRAMESIZE_CIF (400x296)
|
||||
* 6 = FRAMESIZE_VGA (640x480)
|
||||
* 7 = FRAMESIZE_SVGA (800x600)
|
||||
* 8 = FRAMESIZE_XGA (1024x768)
|
||||
* 9 = FRAMESIZE_SXGA (1280x1024)
|
||||
* 10 = FRAMESIZE_UXGA (1600x1200)
|
||||
0 = FRAMESIZE_96X96, // 96x96
|
||||
1 = FRAMESIZE_QQVGA, // 160x120
|
||||
2 = FRAMESIZE_QCIF, // 176x144
|
||||
3 = FRAMESIZE_HQVGA, // 240x176
|
||||
4 = FRAMESIZE_240X240, // 240x240
|
||||
5 = FRAMESIZE_QVGA, // 320x240
|
||||
6 = FRAMESIZE_CIF, // 400x296
|
||||
7 = FRAMESIZE_HVGA, // 480x320
|
||||
8 = FRAMESIZE_VGA, // 640x480
|
||||
9 = FRAMESIZE_SVGA, // 800x600
|
||||
10 = FRAMESIZE_XGA, // 1024x768
|
||||
11 = FRAMESIZE_HD, // 1280x720
|
||||
12 = FRAMESIZE_SXGA, // 1280x1024
|
||||
13 = FRAMESIZE_UXGA, // 1600x1200
|
||||
// 3MP Sensors above this no yet supported with this driver
|
||||
14 = FRAMESIZE_FHD, // 1920x1080
|
||||
15 = FRAMESIZE_P_HD, // 720x1280
|
||||
16 = FRAMESIZE_P_3MP, // 864x1536
|
||||
17 = FRAMESIZE_QXGA, // 2048x1536
|
||||
// 5MP Sensors
|
||||
18 = FRAMESIZE_QHD, // 2560x1440
|
||||
19 = FRAMESIZE_WQXGA, // 2560x1600
|
||||
20 = FRAMESIZE_P_FHD, // 1080x1920
|
||||
21 = FRAMESIZE_QSXGA, // 2560x1920
|
||||
22 = FRAMESIZE_INVALID
|
||||
|
||||
* WcMirror = Mirror picture, 0 = no, 1 = yes
|
||||
* WcFlip = Flip picture, 0 = no, 1 = yes
|
||||
* WcSaturation = Set picture Saturation -2 ... +2
|
||||
|
@ -75,6 +90,7 @@ extern ESP8266WebServer *Webserver;
|
|||
#define BOUNDARY "e8b8c539-047d-4777-a985-fbba6edff11e"
|
||||
|
||||
|
||||
|
||||
// CAMERA_MODEL_AI_THINKER default template pins
|
||||
#define PWDN_GPIO_NUM 32
|
||||
#define RESET_GPIO_NUM -1
|
||||
|
@ -162,7 +178,7 @@ bool WcPinUsed(void) {
|
|||
}
|
||||
|
||||
uint32_t WcSetup(int32_t fsiz) {
|
||||
if (fsiz > 10) { fsiz = 10; }
|
||||
if (fsiz >= FRAMESIZE_FHD) { fsiz = FRAMESIZE_FHD - 1; }
|
||||
|
||||
Wc.stream_active = 0;
|
||||
|
||||
|
@ -927,7 +943,7 @@ void WcShowStream(void) {
|
|||
void WcInit(void) {
|
||||
if (!Settings.webcam_config.data) {
|
||||
Settings.webcam_config.stream = 1;
|
||||
Settings.webcam_config.resolution = 5;
|
||||
Settings.webcam_config.resolution = FRAMESIZE_QVGA;
|
||||
Settings.webcam_config.flip = 0;
|
||||
Settings.webcam_config.mirror = 0;
|
||||
Settings.webcam_config.saturation = 0; // -2
|
||||
|
@ -993,7 +1009,7 @@ void CmndWebcamStream(void) {
|
|||
}
|
||||
|
||||
void CmndWebcamResolution(void) {
|
||||
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 10)) {
|
||||
if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < FRAMESIZE_FHD)) {
|
||||
Settings.webcam_config.resolution = XdrvMailbox.payload;
|
||||
WcSetOptions(0, Settings.webcam_config.resolution);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ uint8_t ili9342_ctouch_counter = 0;
|
|||
|
||||
bool tft_init_done = false;
|
||||
|
||||
|
||||
/*********************************************************************************************/
|
||||
|
||||
void ILI9341_InitDriver()
|
||||
|
@ -61,6 +62,12 @@ void ILI9341_InitDriver()
|
|||
// disable screen buffer
|
||||
buffer = NULL;
|
||||
|
||||
#ifdef USE_DISPLAY_ILI9341
|
||||
uint8_t dtype = 1;
|
||||
#else
|
||||
uint8_t dtype = 2;
|
||||
#endif // USE_DISPLAY_ILI9341
|
||||
|
||||
// default colors
|
||||
fg_color = ILI9341_WHITE;
|
||||
bg_color = ILI9341_BLACK;
|
||||
|
@ -73,11 +80,11 @@ void ILI9341_InitDriver()
|
|||
if (TasmotaGlobal.soft_spi_enabled) {
|
||||
// Init renderer, may use hardware spi, however we use SSPI defintion because SD card uses SPI definition (2 spi busses)
|
||||
if (PinUsed(GPIO_SSPI_MOSI) && PinUsed(GPIO_SSPI_MISO) && PinUsed(GPIO_SSPI_SCLK)) {
|
||||
ili9341_2 = new ILI9341_2(Pin(GPIO_ILI9341_CS), Pin(GPIO_SSPI_MOSI), Pin(GPIO_SSPI_MISO), Pin(GPIO_SSPI_SCLK), Pin(GPIO_OLED_RESET), Pin(GPIO_ILI9341_DC), Pin(GPIO_BACKLIGHT), 2);
|
||||
ili9341_2 = new ILI9341_2(Pin(GPIO_ILI9341_CS), Pin(GPIO_SSPI_MOSI), Pin(GPIO_SSPI_MISO), Pin(GPIO_SSPI_SCLK), Pin(GPIO_OLED_RESET), Pin(GPIO_ILI9341_DC), Pin(GPIO_BACKLIGHT), 2, dtype);
|
||||
}
|
||||
} else if (TasmotaGlobal.spi_enabled) {
|
||||
if (PinUsed(GPIO_ILI9341_DC)) {
|
||||
ili9341_2 = new ILI9341_2(Pin(GPIO_ILI9341_CS), Pin(GPIO_SPI_MOSI), Pin(GPIO_SPI_MISO), Pin(GPIO_SPI_CLK), Pin(GPIO_OLED_RESET), Pin(GPIO_ILI9341_DC), Pin(GPIO_BACKLIGHT), 1);
|
||||
ili9341_2 = new ILI9341_2(Pin(GPIO_ILI9341_CS), Pin(GPIO_SPI_MOSI), Pin(GPIO_SPI_MISO), Pin(GPIO_SPI_CLK), Pin(GPIO_OLED_RESET), Pin(GPIO_ILI9341_DC), Pin(GPIO_BACKLIGHT), 1, dtype);
|
||||
}
|
||||
}
|
||||
#endif // USE_M5STACK_CORE2
|
||||
|
|
Loading…
Reference in New Issue