void NokiaN70_ReadMemory(uint16_t x0,uint16_t y0,uint16_t x1,uint16_t y1,uint8_t *data) { uint8_t i,j=(x1-x0+1)*(y1-y0+1); NokiaN70_SetReadWindow(x0,y0,x1,y1); // first read is dummy read *data=rd_dat(); switch(NokiaN70_color_mode) { case COLOR_12BIT: // always reading even count of pixels for(i=0;i<j;i+=2) { *data++=rd_dat(); *data++=rd_dat(); *data++=rd_dat(); } break; case COLOR_16BIT: for(i=0;i<j;i++) { *data++=rd_dat(); *data++=rd_dat(); } break; case COLOR_18BIT: for(i=0;i<j;i++) { *data++=rd_dat(); *data++=rd_dat(); *data++=rd_dat(); } break; } }
/******************************************************************************* * Read the Graphic LCD module ID code * * Parameter: * * Return: * *******************************************************************************/ static void ili9341_read_id (void) { unsigned short id0, id1, id2, id3; wr_cmd(0xd3); // Read id_code_command id0 = rd_dat(); // read dummy data id1 = rd_dat(); id2 = rd_dat(); id3 = rd_dat(); //printf ("id0 = %X, id1 = %X, id2 = %X, id3 = %X\n", id0, id1, id2, id3); }
static unsigned short rd_reg (unsigned short reg) { Clr_Cs; wr_cmd(reg); reg = rd_dat(); Set_Cs; return reg; }
static unsigned short rd_reg (unsigned short reg) { unsigned short val = 0; LCD_CS(0) wr_cmd(reg); val = rd_dat(); LCD_CS(1) return (val); }
void NokiaN70_ReadRegister(uint8_t reg,uint8_t length,uint8_t *val) { uint8_t i; // first read is dummy read val[0]=rd_reg(reg); for(i=0;i<length;i++) { val[i]=rd_dat(); } }
uint16_t TFT_ILI9325::rd_reg(uint8_t reg) { wr_cmd(reg); return rd_dat(); }
static unsigned short rd_reg (unsigned char reg) { wr_cmd(reg); return (rd_dat()); }