Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robin nano V2, TFT_LVGL_UI parameter adjustment #18500

Merged
merged 67 commits into from
Jul 25, 2020
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
aa595f5
Merge pull request #1 from MarlinFirmware/bugfix-2.0.x
makerbase-mks May 11, 2020
d5d325c
Merge pull request #2 from MarlinFirmware/bugfix-2.0.x
makerbase-mks May 13, 2020
d8d5c0f
Merge pull request #4 from MarlinFirmware/bugfix-2.0.x
makerbase-mks May 14, 2020
a1055dd
Merge pull request #6 from MarlinFirmware/bugfix-2.0.x
makerbase-mks May 18, 2020
8b349b1
Merge pull request #7 from MarlinFirmware/bugfix-2.0.x
makerbase-mks May 22, 2020
8c42e50
Merge pull request #14 from MarlinFirmware/bugfix-2.0.x
makerbase-mks Jun 27, 2020
626ed70
Merge pull request #15 from MarlinFirmware/bugfix-2.0.x
makerbase-mks Jul 1, 2020
80a2552
Merge pull request #16 from MarlinFirmware/bugfix-2.0.x
MKS-Sean Jul 2, 2020
caf0c25
Update mks_ui
MKS-Sean Jul 2, 2020
51af5bf
Fix include paths
thinkyhead Jul 3, 2020
084b192
Update draw_eeprom_settings.h
thinkyhead Jul 3, 2020
4fb24ca
Update platformio.ini
thinkyhead Jul 3, 2020
209a05d
Merge branch 'bugfix-2.0.x' into bugfix-2.0.x
thinkyhead Jul 3, 2020
d6eb29a
Clean up code
thinkyhead Jul 3, 2020
85f0dfa
Apply pins formatting
thinkyhead Jul 3, 2020
606d9e2
Use 'ZERO' macro
thinkyhead Jul 3, 2020
ad2c96d
mks_robin_nano35_V2 same as mks_robin_nano35
thinkyhead Jul 3, 2020
325baae
Revert "mks_robin_nano35_V2 same as mks_robin_nano35"
thinkyhead Jul 4, 2020
a504342
Tweak some spacing
thinkyhead Jul 4, 2020
7be8d20
Move, rename, spacing…
thinkyhead Jul 4, 2020
0570e61
More spacing
thinkyhead Jul 4, 2020
55ff5e2
More spacing changes
thinkyhead Jul 5, 2020
928d03e
Keep updated env
thinkyhead Jul 5, 2020
cf62493
Tweak conditions
thinkyhead Jul 5, 2020
50adea7
Reorder spi word read
thinkyhead Jul 5, 2020
454c008
Tweak homed flags
thinkyhead Jul 5, 2020
62c3479
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/18500
thinkyhead Jul 7, 2020
99970e5
Fix enqueue and PSTR
thinkyhead Jul 7, 2020
7f0889c
fix typo
rhapsodyv Jul 6, 2020
7d472b9
to avoid define redefinition warnings
rhapsodyv Jul 6, 2020
8d0a2be
to load font file even if it isnt with the LONG_FILENAME fat flag
rhapsodyv Jul 6, 2020
f9536e6
put mks test code in MKS_TEST define if
rhapsodyv Jul 6, 2020
80c32ae
to load the new icons
rhapsodyv Jul 6, 2020
ac56a14
to fix font load on mac, because the mac hidden file
rhapsodyv Jul 6, 2020
6ecb0a6
Load Icons and Fonts from the same folder: assets
rhapsodyv Jul 7, 2020
6aa1976
to load the logo too
rhapsodyv Jul 7, 2020
b1112ac
Merge pull request #18 from rhapsodyv/18500
makerbase-mks Jul 8, 2020
00429be
script to download mks assets and create the assets folder in the bui…
rhapsodyv Jul 9, 2020
1db0861
instructions
rhapsodyv Jul 9, 2020
c1eaec3
Merge pull request #19 from rhapsodyv/download-mks-assets
makerbase-mks Jul 10, 2020
45b38d1
remove the extra script
rhapsodyv Jul 10, 2020
a3d3264
Merge pull request #20 from rhapsodyv/extra_scripts_fix
makerbase-mks Jul 11, 2020
2ebcc2f
Keep the contents of the stepper.cpp file unchanged
MKS-Sean Jul 11, 2020
3e500de
Update Configuration.h
thinkyhead Jul 12, 2020
a3cfa26
Update stepper.cpp
thinkyhead Jul 12, 2020
eb86f3d
sp
thinkyhead Jul 15, 2020
21348e4
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/18500
thinkyhead Jul 15, 2020
58de3da
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into mks-bugfix-…
rhapsodyv Jul 23, 2020
0d3dee9
SPI_GRAPHICAL_TFT is a variant of TFT_LVGL_UI, not other lcd
rhapsodyv Jul 23, 2020
8ef749a
script path
rhapsodyv Jul 23, 2020
01ae3cf
restore env:mks_robin_nano35_v2, because nano 2 needs a file named Ro…
rhapsodyv Jul 23, 2020
79076e3
text
rhapsodyv Jul 23, 2020
728e39e
create the paths if not exist
rhapsodyv Jul 24, 2020
e180001
python 2.7 and python 3 compatibility...
rhapsodyv Jul 24, 2020
942a2f8
Merge pull request #21 from rhapsodyv/mks-bugfix-2.0.x
makerbase-mks Jul 24, 2020
e0fbad0
fixes some headers when compiling with TMC
rhapsodyv Jul 24, 2020
3047700
lib name must match the main header, to no get LDF confused
rhapsodyv Jul 25, 2020
4823e2b
Use better defines for TFT_LVGL_UI: SPI and FSMC version
rhapsodyv Jul 25, 2020
d9567bc
Merge pull request #22 from rhapsodyv/header-fixes
makerbase-mks Jul 25, 2020
4dc81cd
Merge pull request #23 from rhapsodyv/tft_lvgl_ui_defines
makerbase-mks Jul 25, 2020
88cdf98
Clean up, fix sanity checks
thinkyhead Jul 25, 2020
e2372a6
Merge remote-tracking branch 'upstream/bugfix-2.0.x' into pr/18500
thinkyhead Jul 25, 2020
547801f
Honest header ordering
thinkyhead Jul 25, 2020
bdf07c3
Update some hyperlinks
thinkyhead Jul 25, 2020
4fe1d46
More header reordering
thinkyhead Jul 25, 2020
dc00847
External header <lvgl.h>
thinkyhead Jul 25, 2020
1dc7b19
Tweak spacing
thinkyhead Jul 25, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include "lvgl.h"
#include "lcd/extui/lib/mks_ui/tft_lvgl_configuration.h"
#include "lcd/extui/lib/mks_ui/draw_ui.h"
#include "lcd/extui/lib/mks_ui/mks_hardware_test.h"
#endif

#if ENABLED(DWIN_CREALITY_LCD)
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/core/boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
#define BOARD_CHITU3D_V5 4030 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CHITU3D_V6 4031 // Chitu3D TronXY X5SA V5 Board
#define BOARD_CREALITY_V4 4032 // Creality v4.x (STM32F103RE)
#define BOARD_MKS_ROBIN_NANO_V2 4033 // MKS Robin Nano V2 (STM32F103VET6)

//
// ARM Cortex-M4F
Expand Down
82 changes: 76 additions & 6 deletions Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <SPI.h>
#include "../../../../inc/MarlinConfig.h"
#include "SPI_TFT.h"
#include "pic_manager.h"

TFT SPI_TFT;

Expand Down Expand Up @@ -145,18 +146,28 @@
LCD_WR_DATA(y >> 8);
LCD_WR_DATA(y);
}
void TFT::SetPoit(uint16_t x,uint16_t y,uint16_t point)
{
if ( (x>480)||(y>320) ) return;

SetCursor(x,y);

LCD_WriteRAM_Prepare();
LCD_WR_DATA((uint8_t)(point >> 8));
LCD_WR_DATA((uint8_t)point);
}
void TFT::SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height) {
LCD_WR_REG(0x2a);
LCD_WR_DATA(x >> 8);
LCD_WR_DATA(x);
LCD_WR_DATA((x + with) >> 8);
LCD_WR_DATA((x + with));
LCD_WR_DATA((x+with-1)>>8);
LCD_WR_DATA((x+with-1));

LCD_WR_REG(0x2b);
LCD_WR_DATA(y >> 8);
LCD_WR_DATA(y);
LCD_WR_DATA((y + height) >> 8);
LCD_WR_DATA(y + height);
LCD_WR_DATA((y+height-1)>>8);
LCD_WR_DATA(y+height-1);
}
void TFT::LCD_init() {
SPI_TFT_RST_H;
Expand Down Expand Up @@ -237,12 +248,13 @@
LCD_WR_REG(0x29); // Display ON

LCD_clear(0x0000); //
LCD_Draw_Logo();
SPI_TFT_BLK_H;
delay(2000);

}
void TFT::LCD_clear(uint16_t color) {
unsigned int i, m;
uint32_t count;
unsigned int i;
uint8_t tbuf[960];

SetCursor(0, 0);
Expand All @@ -267,5 +279,63 @@
}
SPI_TFT_CS_H;
}

extern unsigned char bmp_public_buf[17 * 1024];
void TFT::LCD_Draw_Logo()
{
uint16_t i,y_off = 0;
uint16_t *p_index;
uint16_t Color;

#if 1
for(y_off = 0; y_off < 320; y_off ++)
{
Pic_Logo_Read((uint8_t *)"", (uint8_t *)bmp_public_buf, 960);

SPI_TFT.spi_init(SPI_FULL_SPEED);
SetWindows(0, y_off, 480, 1);
LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
for(i=0;i<960;)
{
p_index = (uint16_t *)(&bmp_public_buf[i]);

Color = (*p_index >> 8);
*p_index = Color | ((*p_index & 0xff) << 8);
i+=2;
}
SPI_TFT_CS_L;
SPI_TFT_DC_H;
SPI.dmaSend(bmp_public_buf,960,true);
SPI_TFT_CS_H;
}
SetWindows(0, 0, 479, 319);
#else
for(index = 0; index < 40; index ++)
{
Pic_Logo_Read((uint8_t *)"", bmp_public_buf, 480*8*2);

i = 0;
SetCursor(0,0);
SetWindows(0, y_off * 8, 480, 8);
LCD_WriteRAM_Prepare(); /* Prepare to write GRAM */
for(i=0;i<480*8*2;)
{
p_index = (uint16_t *)(&bmp_public_buf[i]);

Color = (*p_index >> 8);
*p_index = Color | ((*p_index & 0xff) << 8);
i+=2;
}
SPI_TFT_CS_L;
SPI_TFT_DC_H;
SPI.dmaSend(bmp_public_buf,480*8*2,true);
SPI_TFT_CS_H;

y_off++;

}
SetWindows(0, 0, 479, 319);
#endif
}

#endif // SPI_GRAPHICAL_TFT
2 changes: 2 additions & 0 deletions Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ class TFT {
void LCD_WR_REG(uint8_t cmd);
void LCD_WR_DATA(uint8_t data);
void SetCursor(uint16_t x, uint16_t y);
void SetPoit(uint16_t x,uint16_t y,uint16_t point);
void SetWindows(uint16_t x, uint16_t y, uint16_t with, uint16_t height);
void LCD_init();
void LCD_clear(uint16_t color);
void LCD_WriteRAM_Prepare();
void LCD_Draw_Logo();
};

extern TFT SPI_TFT;
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ void ext_FLASH::spi_flash_SendBlock(uint8_t token, const uint8_t* buf) {
uint16_t ext_FLASH::W25QXX_ReadID(void) {
uint16_t Temp = 0;
W25QXX_CS_L;
spi_flash_Send(0x90);//���Ͷ�ȡID����
spi_flash_Send(0x90);
spi_flash_Send(0x00);
spi_flash_Send(0x00);
spi_flash_Send(0x00);
Expand Down
22 changes: 11 additions & 11 deletions Marlin/src/lcd/extui/lib/mks_ui/W25Qxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,38 +56,38 @@

#define PIC_NAME_MAX_LEN 50

#define LOGO_MAX_SIZE (300*1024)//logo���ֵ
#define TITLELOGO_MAX_SIZE (150*1024)//logo���ֵ
#define LOGO_MAX_SIZE (300*1024)
#define TITLELOGO_MAX_SIZE (150*1024)
#define DEFAULT_VIEW_MAX_SIZE (200*200*2)
#define FLASH_VIEW_MAX_SIZE (200*200*2)

//ͼƬ
//Robin2�洢��ַ
#define PIC_NAME_ADDR 0x003000 //ͼƬ��Ϣ�洢��ַ��ͼƬ����
#define PIC_SIZE_ADDR 0x007000 //ͼƬ��Ϣ�洢��ַ��ͼƬ��Сֵ
#define PIC_COUNTER_ADDR 0x008000 //ͼƬ������ֵ�洢��ַ
#define PIC_LOGO_ADDR 0x009000 //ͼƬlogo�洢��ַ
//#define PIC_DATA_ADDR 0x02f000 //ͼƬ���ݴ洢��ַ
#define PIC_NAME_ADDR 0x003000
#define PIC_SIZE_ADDR 0x007000
#define PIC_COUNTER_ADDR 0x008000
#define PIC_LOGO_ADDR 0x009000
//#define PIC_DATA_ADDR 0x02f000

#define DEFAULT_VIEW_ADDR 0XC5800
#define BAK_VIEW_ADDR (DEFAULT_VIEW_ADDR+90*1024)
#define PIC_ICON_LOGO_ADDR (BAK_VIEW_ADDR+80*1024)

#define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024) //ͼƬ���ݴ洢��ַ//(800*240)
#define PIC_DATA_ADDR (PIC_ICON_LOGO_ADDR+350*1024)

// �ֿ�
#define FONTINFOADDR 0x600000 // 6M�Ժ��ַΪ�ֿ�
#define FONTINFOADDR 0x600000
#define UNIGBK_FLASH_ADDR (FONTINFOADDR+4096) // 4*1024
#define GBK_FLASH_ADDR (UNIGBK_FLASH_ADDR+180224) // 176*1024

#define PER_PIC_MAX_SPACE (32*1024) // Ϊ�˷�ֹ����Խ������⣬ÿ��СͼƬ�����仮��Ӧ��ȡ�ܹ�����4K��ֵ
#define PER_PIC_MAX_SPACE (32*1024)

//
union union32 {
uint8_t bytes[4];
uint32_t dwords;
};
// ͼƬ��Ϣ�ṹ��

struct pic_msg {
uint8_t name[PIC_NAME_MAX_LEN];
union union32 size;
Expand Down
8 changes: 6 additions & 2 deletions Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ void lv_draw_about(void) {
/*Create an Image button*/
buttonBack = lv_imgbtn_create(scr, NULL);

#if 1
lv_obj_set_event_cb_mks(buttonBack, event_handler, ID_A_RETURN, "bmp_Return.bin", 0);
#if 1


lv_obj_set_event_cb_mks(buttonBack, event_handler,ID_A_RETURN,"bmp_return.bin",0);
lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_REL, &bmp_pic);
lv_imgbtn_set_src(buttonBack, LV_BTN_STATE_PR, &bmp_pic);
lv_imgbtn_set_style(buttonBack, LV_BTN_STATE_PR, &tft_style_lable_pre);
Expand Down Expand Up @@ -109,6 +111,8 @@ void lv_draw_about(void) {
"Firmware: Robin_Pro35"
#elif MB(MKS_ROBIN_NANO)
"Firmware: Robin_Nano35"
#elif MB(MKS_ROBIN_NANO_V2)
"Firmware: Robin_Nano35"
#else
CUSTOM_MACHINE_NAME
#endif
Expand Down
Loading