static void lcd_data_bus_test(void) { unsigned short temp1; unsigned short temp2; /* wirte */ lcd_SetCursor(0,0); rw_data_prepare(); write_data(0x5555); lcd_SetCursor(1,0); rw_data_prepare(); write_data(0xAAAA); /* read */ lcd_SetCursor(0,0); temp1 = lcd_read_gram(0,0); temp2 = lcd_read_gram(1,0); if( (temp1 == 0x5555) && (temp2 == 0xAAAA) ) { //printf(" data bus test pass!\r\n"); } else { //printf(" data bus test error: %04X %04X\r\n",temp1,temp2); } }
static void lcd_data_bus_test(void) { unsigned short temp1; unsigned short temp2; // /* [5:4]-ID~ID0 [3]-AM-1垂直-0水平 */ // write_reg(0x0003,(1<<12)|(1<<5)|(1<<4) | (0<<3) ); /* wirte */ lcd_SetCursor(0,0); rw_data_prepare(); write_data(0x5555); lcd_SetCursor(1,0); rw_data_prepare(); write_data(0xAAAA); /* read */ lcd_SetCursor(0,0); temp1 = lcd_read_gram(0,0); temp2 = lcd_read_gram(1,0); if( (temp1 == 0x5555) && (temp2 == 0xAAAA) ) { printf(" data bus test pass!\r\n"); } else { printf(" data bus test error: %04X %04X\r\n",temp1,temp2); } }
/* 获取像素点颜色 */ void ssd1289_lcd_get_pixel(char* pixel, int x, int y) { *(rt_uint16_t*)pixel = lcd_read_gram(x, y); }