static int bs_wr_which(bool which, uint32_t data) { static int datacounter=0; // display_port_t disp = BROADSHEET_DISPLAY_NUMBER; cmddata_t type = (BS_CMD == which) ? CMD : DAT; int result = EINKFB_FAILURE; if (type == BS_CMD) { datacounter = 0; dd_printk("[C] %04x\n", data); } else if (++datacounter <= 8) { dd_printk("[D] %04x\n", data); } else if (datacounter == 9) { dd_printk("[D] ...\n"); } if ( BS_READY() ) // result = ipu_adc_write_cmd(disp, type, data, 0, 0); result = ipu_adc_write_cmd(type, data); else result = EINKFB_FAILURE; return ( result ); }
bool bs_wr_one_ready(void) { bool ready = false; if ( BS_READY() ) ready = true; return ( ready ); }
static int bs_wr_which(bool which, uint32_t data) { display_port_t disp = BROADSHEET_DISPLAY_NUMBER; cmddata_t type = (BS_CMD == which) ? CMD : DAT; int result = EINKFB_FAILURE; if ( BS_READY() ) result = ipu_adc_write_cmd(disp, type, data, 0, 0); else result = EINKFB_FAILURE; return ( result ); }
int bs_wr_cmd(bs_cmd cmd, bool poll) { int result; einkfb_debug_full("command = 0x%04X, poll = %d\n", cmd, poll); result = bs_wr_which(BS_CMD, (uint32_t)cmd); if ( (EINKFB_SUCCESS == result) && poll ) { if ( !BS_READY() ) result = EINKFB_FAILURE; } return ( result ); }
static int bs_rd_one(u16 *data) { display_port_t disp = BROADSHEET_DISPLAY_NUMBER; int result = EINKFB_SUCCESS; if ( BS_READY() ) *data = (u16)(ipu_adc_read_data(disp) & 0x0000FFFF); else result = EINKFB_FAILURE; if ( EINKFB_SUCCESS == result ) einkfb_debug_full("data = 0x%04X\n", *data); return ( result ); }
int bs_rd_dat(u32 data_size, u16 *data) { int result = EINKFB_FAILURE; // For single-word reads, don't use the buffer call. // if ( !USE_RD_BUF(data_size) ) result = bs_rd_one(data); else { einkfb_debug_full("size = %d\n", data_size); if ( BS_READY() ) result = bs_io_buf(data_size, data, BS_RD); } return ( result ); }