ucg_int_t ICACHE_FLASH_ATTR ucg_clip_l90tc(ucg_t *ucg) { if ( ucg_clip_l90fx(ucg) == 0 ) return 0; ucg->arg.pixel_skip = ucg->arg.offset & 0x07; ucg->arg.bitmap += (ucg->arg.offset >>3); return 1; }
ucg_int_t ICACHE_FLASH_ATTR ucg_clip_l90se(ucg_t *ucg) { uint8_t i; if ( ucg_clip_l90fx(ucg) == 0 ) return 0; for ( i = 0; i < 3; i++ ) { ucg_ccs_seek(ucg->arg.ccs_line+i, ucg->arg.offset); } return 1; }
ucg_int_t ICACHE_FLASH_ATTR ucg_handle_ili9163_l90fx(ucg_t *ucg) { uint8_t c[3]; ucg_int_t tmp; if ( ucg_clip_l90fx(ucg) != 0 ) { switch(ucg->arg.dir) { case 0: ucg->arg.pixel.pos.y += 32; ucg_com_SendCmdSeq(ucg, ucg_ili9163_set_pos_dir0_seq); ucg->arg.pixel.pos.y -= 32; break; case 1: ucg->arg.pixel.pos.y += 32; ucg_com_SendCmdSeq(ucg, ucg_ili9163_set_pos_dir1_seq); ucg->arg.pixel.pos.y -= 32; break; case 2: tmp = ucg->arg.pixel.pos.x; ucg->arg.pixel.pos.x = 127-tmp; ucg->arg.pixel.pos.y += 32; ucg_com_SendCmdSeq(ucg, ucg_ili9163_set_pos_dir2_seq); ucg->arg.pixel.pos.y -= 32; ucg->arg.pixel.pos.x = tmp; break; case 3: default: tmp = ucg->arg.pixel.pos.y; ucg->arg.pixel.pos.y = 127-tmp; //ucg->arg.pixel.pos.y += 32; ucg_com_SendCmdSeq(ucg, ucg_ili9163_set_pos_dir3_seq); ucg->arg.pixel.pos.y = tmp; break; } c[0] = ucg->arg.pixel.rgb.color[0]; c[1] = ucg->arg.pixel.rgb.color[1]; c[2] = ucg->arg.pixel.rgb.color[2]; ucg_com_SendRepeat3Bytes(ucg, ucg->arg.len, c); ucg_com_SetCSLineStatus(ucg, 1); /* disable chip */ return 1; } return 0; }
static ucg_int_t ucg_handle_ld50t6160_l90fx(ucg_t *ucg) { uint8_t c[3]; //ucg_int_t tmp; if ( ucg_clip_l90fx(ucg) != 0 ) { switch(ucg->arg.dir) { case 0: ucg_com_SendCmdSeq(ucg, ucg_ld50t6160_set_pos_dir0_seq); break; case 1: ucg_com_SendCmdSeq(ucg, ucg_ld50t6160_set_pos_dir1_seq); break; case 2: //tmp = ucg->arg.pixel.pos.x; //ucg->arg.pixel.pos.x = 127-tmp; ucg_com_SendCmdSeq(ucg, ucg_ld50t6160_set_pos_dir2_seq); //ucg->arg.pixel.pos.x = tmp; break; case 3: default: //tmp = ucg->arg.pixel.pos.y; //ucg->arg.pixel.pos.y = 159-tmp; ucg_com_SendCmdSeq(ucg, ucg_ld50t6160_set_pos_dir3_seq); //ucg->arg.pixel.pos.y = tmp; break; } c[0] = ucg->arg.pixel.rgb.color[0]>>2; c[1] = ucg->arg.pixel.rgb.color[1]>>2; c[2] = ucg->arg.pixel.rgb.color[2]>>2; ucg_com_SendRepeat3Bytes(ucg, ucg->arg.len, c); ucg_com_SetCSLineStatus(ucg, 1); /* disable chip */ return 1; } return 0; }
/* handle UCG_MSG_DRAW_L90FX message and make calls to "dev_cb" with UCG_MSG_DRAW_PIXEL return 1 if something has been drawn */ ucg_int_t ICACHE_FLASH_ATTR ucg_handle_l90fx(ucg_t *ucg, ucg_dev_fnptr dev_cb) { if ( ucg_clip_l90fx(ucg) != 0 ) { ucg_int_t dx, dy; ucg_int_t i; switch(ucg->arg.dir) { case 0: dx = 1; dy = 0; break; case 1: dx = 0; dy = 1; break; case 2: dx = -1; dy = 0; break; case 3: dx = 0; dy = -1; break; default: dx = 1; dy = 0; break; /* avoid compiler warning */ } for( i = 0; i < ucg->arg.len; i++ ) { dev_cb(ucg, UCG_MSG_DRAW_PIXEL, NULL); ucg->arg.pixel.pos.x+=dx; ucg->arg.pixel.pos.y+=dy; } return 1; } return 0; }