JDI_MIP on ThunderBoardSense2(Silicon-Labs)
JDI_MIP (LPM013M126A) Sample on ThunderBoard2(Silicon-Labs)
LPM013M126A
Links
https://os.mbed.com/teams/JapanDisplayInc/
https://os.mbed.com/teams/JapanDisplayInc/wiki/MIP-reflective-color-display
Diff: main.cpp
- Revision:
- 12:39e048e73819
- Parent:
- 10:525bcf8907fc
- Child:
- 13:9fb661dd4b2a
--- a/main.cpp Wed Jan 09 07:55:43 2019 +0000 +++ b/main.cpp Tue Jan 22 10:17:25 2019 +0000 @@ -66,40 +66,49 @@ int width =176; int height=176; /////////////////////////////////////// -int test_lcd(void) +int disp_logo(void) +{ + int RGB; + uint8_t R8,G8,B8; + uint8_t *cptr; + //for(int i=0; i< 54 ; i++) fscanf(fp,"%c",DUMMY); // Discard Header 54bytes + cptr = (uint8_t *)&Title_bmp[54]; + for(int y=height-1; y>=0; y--) { + for(int x=0; x< width; x++) { //24bit color B 8bit -> G 8bit -> R 8bit + B8 = *cptr++; + G8 = *cptr++; + R8 = *cptr++; + RGB = RGB8(R8,G8,B8); //6bit(8bit) MIP MASK 0000 1110 + WD.pixel(x,y,RGB); + } + //if( y!=0) // The last data column doesn't need padding + //for(int x=(width*3)%4; (x%4 !=0); x++) fscanf(fp, "%c",DUMMY); // 4byte boundery for every column + } +} + +int lcd_init(void) { int i; // Power On Sequece -// _lcd_reset = 0; -// _lcd_reset = 1; +// _lcd_reset = 0; +// _lcd_reset = 1; _lcd_extmod = 0; - _lcd_disp = 1; // WD.setWH(width,height); // Default X/Y-00 bool if16 = 1; - WD.set16col(if16); // 0= RGB, 1=RGBW + WD.set16col(if16); // 0= RGB, 1=RGBW WD.setmarge(1); WD.background(Cyan); WD.clsBUF(); + _lcd_disp = 1; // //WD.fillrect(i*(width/16), height/2+1, (i+1)*(width/16)-1, height , ccolor_table[15-i]); - //WD.writeDISP(); - - WD.set_font((unsigned char*) HGP23x29); - WD.locate( 0, 43);WD.foreground(Blue); WD.printf("Environmental"); - WD.locate( 0, 83);WD.foreground(Blue); WD.printf(" Monitor"); - WD.locate(120,140);WD.foreground(Red ); WD.printf("JDI"); - /* - WD.foreground(Red); - WD.set_font((unsigned char*) HGP15x19); - WD.locate(2,32); WD.printf("NOPQRSTUVWXYZ"); - WD.foreground(Blue); - WD.set_font((unsigned char*) HGP15x19); - WD.locate(10,80); WD.printf("abcdefghijklmnopqrstuvwxyz"); - WD.locate(10,115); WD.printf("0123456789"); - WD.locate(10,150); WD.printf("Hello world"); - */ + //WD.set_font((unsigned char*) HGP23x29); + //WD.locate( 0, 43);WD.foreground(Blue); WD.printf("Environmental"); + //WD.locate( 0, 83);WD.foreground(Blue); WD.printf(" Monitor"); + //WD.locate(120,140);WD.foreground(Red ); WD.printf("JDI"); + disp_logo(); WD.writeDISP(); _lcd_extmod = 1; // 1=Pin,0=Serial WD.background(White); @@ -124,13 +133,10 @@ bool imu_en = false; _pk1=1; - test_lcd(); - - - ccs_en = 0; - wait_ms(1000); + lcd_init(); + ccs_en = 0; wait_ms(100); ccs_en = 1; - wait_ms(1000); + wait_ms(2000); /* Initialize air quality sensor */ AMS_CCS811* gasSensor = new AMS_CCS811(&ccs_i2c, PF15);