2021-09-07 02:15:24 -05:00
/**
2021-09-15 19:48:29 -05:00
* Marlin 3 D Printer Firmware
* Copyright ( c ) 2021 MarlinFirmware [ https : //github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl .
* Copyright ( c ) 2011 Camiel Gubbels / Erik van der Zalm
2021-09-07 02:15:24 -05:00
*
* This program is free software : you can redistribute it and / or modify
2021-09-15 19:48:29 -05:00
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
2021-09-07 02:15:24 -05:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
2021-09-15 19:48:29 -05:00
* You should have received a copy of the GNU General Public License
2021-09-07 02:15:24 -05:00
* along with this program . If not , see < https : //www.gnu.org/licenses/>.
*
*/
# pragma once
2021-09-15 19:48:29 -05:00
/**
* DWIN UI Enhanced implementation
* Author : Miguel A . Risco - Castillo
* Version : 3.6 .3
* Date : 2021 / 09 / 08
*/
2021-09-07 02:15:24 -05:00
2021-09-15 19:48:29 -05:00
# include "../common/dwin_api.h"
2021-09-07 02:15:24 -05:00
// Display QR code
// The size of the QR code is (46*QR_Pixel)*(46*QR_Pixel) dot matrix
// QR_Pixel: The pixel size occupied by each point of the QR code: 0x01-0x0F (1-16)
// (Nx, Ny): The coordinates of the upper left corner displayed by the QR code
// str: multi-bit data
void DWIN_Draw_QR ( uint8_t QR_Pixel , uint16_t x , uint16_t y , char * string ) ;
2021-09-25 02:27:07 -05:00
inline void DWIN_Draw_QR ( uint8_t QR_Pixel , uint16_t x , uint16_t y , FSTR_P title ) {
2021-09-07 02:15:24 -05:00
DWIN_Draw_QR ( QR_Pixel , x , y , ( char * ) title ) ;
}
2021-09-15 19:48:29 -05:00
// Copy area from virtual display area to current screen
// cacheID: virtual area number
// xStart/yStart: Upper-left of virtual area
// xEnd/yEnd: Lower-right of virtual area
// x/y: Screen paste point
void DWIN_Frame_AreaCopy ( uint8_t cacheID , uint16_t xStart , uint16_t yStart , uint16_t xEnd , uint16_t yEnd , uint16_t x , uint16_t y ) ;
2021-09-07 02:15:24 -05:00
2021-09-15 19:48:29 -05:00
// Copy area from virtual display area to current screen
// cacheID: virtual area number
// xStart/yStart: Upper-left of virtual area
// xEnd/yEnd: Lower-right of virtual area
// x/y: Screen paste point
void DWIN_Frame_AreaCopy ( uint8_t cacheID , uint16_t xStart , uint16_t yStart , uint16_t xEnd , uint16_t yEnd , uint16_t x , uint16_t y ) ;
2021-09-07 02:15:24 -05:00
// Copy area from current virtual display area to current screen
// xStart/yStart: Upper-left of virtual area
// xEnd/yEnd: Lower-right of virtual area
// x/y: Screen paste point
2021-09-15 19:48:29 -05:00
void DWIN_Frame_AreaCopy ( uint16_t xStart , uint16_t yStart , uint16_t xEnd , uint16_t yEnd , uint16_t x , uint16_t y ) ;
2021-09-07 02:15:24 -05:00
// Copy area from virtual display area to current screen
// IBD: background display: 0=Background filtering is not displayed, 1=Background display \\When setting the background filtering not to display, the background must be pure black
// BIR: Background image restoration: 0=Background image is not restored, 1=Automatically use virtual display area image for background restoration
// BFI: Background filtering strength: 0=normal, 1=enhanced, (only valid when the icon background display=0)
// cacheID: virtual area number
// xStart/yStart: Upper-left of virtual area
// xEnd/yEnd: Lower-right of virtual area
// x/y: Screen paste point
2021-09-15 19:48:29 -05:00
void DWIN_Frame_AreaCopy ( bool IBD , bool BIR , bool BFI , uint8_t cacheID , uint16_t xStart , uint16_t yStart , uint16_t xEnd , uint16_t yEnd , uint16_t x , uint16_t y ) ;
2021-09-07 02:15:24 -05:00
// Write buffer data to the SRAM or Flash
// mem: 0x5A=32KB SRAM, 0xA5=16KB Flash
// addr: start address
// length: Bytes to write
// data: address of the buffer with data
void DWIN_WriteToMem ( uint8_t mem , uint16_t addr , uint16_t length , uint8_t * data ) ;
// Write the contents of the 32KB SRAM data memory into the designated image memory space.
// picID: Picture memory space location, 0x00-0x0F, each space is 32Kbytes
void DWIN_SRAMToPic ( uint8_t picID ) ;