Robin nano V2, TFT LVGL UI parameters, and more (#18500)

This commit is contained in:
MKS-Sean
2020-07-25 13:52:07 +08:00
committed by Scott Lahteine
parent c5ec80d6c7
commit d20d459132
90 changed files with 11656 additions and 4119 deletions

View File

@@ -25,29 +25,33 @@
extern "C" { /* C-declarations for C++ */
#endif
#include <stdint.h>
#include <string.h>
#include "lvgl.h"
#include "../../inc/MarlinConfigPre.h"
#include <lvgl.h>
#include <stdint.h>
#include <string.h>
#ifndef HAS_SPI_FLASH_FONT
#define HAS_SPI_FLASH_FONT 0 //disabled until fix the font load code
#define HAS_SPI_FLASH_FONT 1 // Disabled until fix the font load code
#endif
#ifndef HAS_GCODE_PREVIEW
#define HAS_GCODE_PREVIEW 1
#endif
#ifndef HAS_LANG_SELECT_SCREEN
#define HAS_LANG_SELECT_SCREEN 0
#define HAS_LANG_SELECT_SCREEN 1
#endif
#ifndef HAS_BAK_VIEW_IN_FLASH
#define HAS_BAK_VIEW_IN_FLASH 1
#define HAS_BAK_VIEW_IN_FLASH 1
#endif
#ifndef HAS_GCODE_DEFAULT_VIEW_IN_FLASH
#define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 1
#define HAS_GCODE_DEFAULT_VIEW_IN_FLASH 1
#endif
#ifndef HAS_LOGO_IN_FLASH
#define HAS_LOGO_IN_FLASH 1
#endif
#ifndef SPI_FLASH_SIZE
#define SPI_FLASH_SIZE 0x1000000 // 16MB
#define SPI_FLASH_SIZE 0x1000000 // 16MB
#endif
#define PIC_MAX_CN 100 // Maximum number of pictures
@@ -66,48 +70,52 @@ extern "C" { /* C-declarations for C++ */
#if SPI_FLASH_SIZE == 0x200000
//pic
//Robin_pro pic addr
#define PIC_NAME_ADDR 0x001000 // Pic information addr
#define PIC_SIZE_ADDR 0x001800 // Pic size information addr
#define PIC_COUNTER_ADDR 0x002000 // Pic total number
#define PER_PIC_SAVE_ADDR 0x000000 // Storage address of each picture
#define PIC_LOGO_ADDR 0x000000 // Logo addr
#define PIC_DATA_ADDR 0x003000 //
#define PIC_NAME_ADDR 0x001000 // Pic information addr
#define PIC_SIZE_ADDR 0x001800 // Pic size information addr
#define PIC_COUNTER_ADDR 0x002000 // Pic total number
#define PER_PIC_SAVE_ADDR 0x000000 // Storage address of each picture
#define PIC_LOGO_ADDR 0x000000 // Logo addr
#define PIC_DATA_ADDR 0x003000 //
// TFT35
#define DEFAULT_VIEW_ADDR_TFT35 0x1ea070
#define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024)
#define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024)
#define PIC_DATA_ADDR_TFT35 0x003000 // (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800
#define DEFAULT_VIEW_ADDR_TFT35 0x1ea070
#define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024)
#define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024)
#define PIC_DATA_ADDR_TFT35 0x003000 // (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800
#define PIC_DATA_ADDR_TFT32 0x00F000
#define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000
#define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000
#define PIC_DATA_ADDR_TFT32 0x00F000
#define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000
#define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000
// font
#define FONTINFOADDR 0x183000 // 6M -- font addr
#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024
#else
//pic
//Robin_pro pic addr
#define PIC_NAME_ADDR 0x003000 // Pic information addr
#define PIC_SIZE_ADDR 0x007000 // Pic size information addr
#define PIC_COUNTER_ADDR 0x008000 // Pic total number
#define PER_PIC_SAVE_ADDR 0x009000 // Storage address of each picture
#define PIC_LOGO_ADDR 0x00A000 // Logo addr
//#define PIC_DATA_ADDR 0x02F000 //
#define PIC_NAME_ADDR 0x003000 // Pic information addr
#define PIC_SIZE_ADDR 0x007000 // Pic size information addr
#define PIC_COUNTER_ADDR 0x008000 // Pic total number
//#define PER_PIC_SAVE_ADDR 0x009000 // Storage address of each picture
#define PIC_LOGO_ADDR 0x009000 // Logo addr
//#define PIC_DATA_ADDR 0x02F000 //
// TFT35
#define DEFAULT_VIEW_ADDR_TFT35 0xC5800
#define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024)
#define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024)
#define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800
#define DEFAULT_VIEW_ADDR_TFT35 0xC5800
#define BAK_VIEW_ADDR_TFT35 (DEFAULT_VIEW_ADDR_TFT35+90*1024)
#define PIC_ICON_LOGO_ADDR_TFT35 (BAK_VIEW_ADDR_TFT35+80*1024)
#define PIC_DATA_ADDR_TFT35 (PIC_ICON_LOGO_ADDR_TFT35+350*1024) //0xC5800
// TFT32
#define PIC_DATA_ADDR_TFT32 0x02F000
#define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000
#define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000
#define PIC_DATA_ADDR_TFT32 0x02F000
#define PIC_ICON_LOGO_ADDR_TFT32 0x5D8000
#define PIC_OTHER_SIZE_ADDR_TFT32 0x5EE000
// font
#define FONTINFOADDR 0x600000 // 6M -- font addr
#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024
#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024
#define FONTINFOADDR 0x600000 // 6M -- font addr
#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024
#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024
#endif
@@ -137,6 +145,7 @@ typedef struct pic_msg PIC_MSG;
#define FONT_SIZE_xM 2
extern void Pic_Read(uint8_t *Pname, uint8_t *P_Rbuff);
extern void Pic_Logo_Read(uint8_t *LogoName,uint8_t *Logo_Rbuff,uint32_t LogoReadsize);
extern void lv_pic_test(uint8_t *P_Rbuff, uint32_t addr, uint32_t size);
extern uint32_t lv_get_pic_addr(uint8_t *Pname);
extern void get_spi_flash_data(const char *rec_buf, int offset, int size);