void ili9320_vline(int ys, int ye, int x, int c) { switch(lcd_id) { case 0x9320: write_reg(0x03,(0<<5)|(0<<4)|(1<<3)|(1<<12)); write_reg(0x0020, x); write_reg(0x0021, ys); WMLCDCOM(0x0022); while(ys < ye) { WMLCDDATA(c); ys++; } // write_reg(0x03,(1<<5)|(1<<4)|(0<<3)|(1<<12)); break; case 0x8989: write_reg(0x11,(0<<5)|(0<<4)|(1<<3)); write_reg(0x004e, x); write_reg(0x004f, ys); WMLCDCOM(0x0022); while(ys < ye) { WMLCDDATA(c); ys++; } // write_reg(0x11,(1<<5)|(1<<4)|(0<<3)); break; default: break; } }
void ili9320_hline(int xs, int xe, int y, int c) { switch(lcd_id) { case 0x9320: write_reg(0x03,(1<<5)|(1<<4)|(0<<3)|(1<<12)); write_reg(0x0020, xs); write_reg(0x0021, y); WMLCDCOM(0x0022); while(xs < xe) { WMLCDDATA(c); xs++; } // write_reg(0x03,(1<<5)|(1<<4)|(0<<3)|(1<<12)); break; case 0x8989: write_reg(0x11,(1<<5)|(1<<4)|(0<<3)); write_reg(0x004e, xs); write_reg(0x004f, y); WMLCDCOM(0x0022); while(xs < xe) { WMLCDDATA(c); xs++; } write_reg(0x11,(1<<5)|(1<<4)|(0<<3)); break; default: break; } }
int ili9325_read_pixel(int x, int y) { int value; write_reg(0x0020, x); write_reg(0x0021, y); WMLCDCOM(0x0022); value = ILI9325_DATA_ADDRESS; WMLCDCOM(0x0022); value = ILI9325_DATA_ADDRESS; return value; }
int ili9320_read_pixel(int x, int y) { int value; write_reg(0x0020, x); write_reg(0x0021, y); WMLCDCOM(0x0022); value = ILI9320_DATA_ADDRESS; WMLCDCOM(0x0022); value = ILI9320_DATA_ADDRESS; return LCD_BGR2RGB(value); }
void ili9325_write_pixel(int x, int y, int c) { write_reg(0x0020, x); write_reg(0x0021, y); WMLCDCOM(0x0022); WMLCDDATA(c); }
void ili9320_write_gram(uint16_t *buf, int len) { WMLCDCOM(0x0022); while(len--) { WMLCDDATA(*buf++); } }
void ili9325_clear(int c) { int i; ili9325_set_window(0, 0, LCD_X_MAX, LCD_Y_MAX); WMLCDCOM(0x22); for(i = 0; i < (LCD_X_MAX * LCD_Y_MAX); i++) { WMLCDDATA(c); } }
void ili9320_write_pixel(int x, int y, int c) { switch(lcd_id) { case 0x9320: write_reg(0x0020, x); write_reg(0x0021, y); WMLCDCOM(0x0022); WMLCDDATA(c); break; case 0x8989: write_reg(0x004e,x); write_reg(0x004f,y); WMLCDCOM(0x0022); WMLCDDATA(c); break; default: break; } }
void GUI_DrawPixel(int color, int x, int y) { switch(lcd_id) { case 0x9320: write_reg(0x0020, x); write_reg(0x0021, y); WMLCDCOM(0x0022); WMLCDDATA(color); break; case 0x8989: write_reg(0x004e,x); write_reg(0x004f,y); WMLCDCOM(0x0022); WMLCDDATA(color); break; default: break; } }
void ili9320_hline(int xs, int xe, int y, int c) { write_reg(0x03,(1<<5)|(1<<4)|(0<<3)|(1<<12)); write_reg(0x0020, xs); write_reg(0x0021, y); WMLCDCOM(0x0022); while(xs < xe) { WMLCDDATA(c); xs++; } }
void ili9320_vline(int ys, int ye, int x, int c) { write_reg(0x03,(0<<5)|(0<<4)|(1<<3)|(1<<12)); write_reg(0x0020, x); write_reg(0x0021, ys); WMLCDCOM(0x0022); while(ys < ye) { WMLCDDATA(c); ys++; } write_reg(0x03,(1<<5)|(1<<4)|(0<<3)|(1<<12)); }
static uint16_t read_reg(uint16_t addr) { WMLCDCOM(addr); return ILI9325_DATA_ADDRESS; }
static void write_reg(uint16_t addr, uint16_t val) { WMLCDCOM(addr); WMLCDDATA(val); }