lvgl_tft/epdiy_epaper.c
/* 
 * Called for each pixel. Designed with the idea to fill the buffer directly, not to set each pixel, see LVGL Forum (buf_area_to_framebuffer)
*/
Called for each pixel. Designed with the idea to fill the buffer directly, not to set each pixel, see LVGL Forum (buf_area_to_framebuffer)
Called for each pixel . Designed with the idea to fill the buffer directly not to set each pixel see LVGL Forum ( buf_area_to_framebuffer )
void epdiy_set_px_cb(lv_disp_drv_t * disp_drv, uint8_t* buf,
    lv_coord_t buf_w, lv_coord_t x, lv_coord_t y,
    lv_color_t color, lv_opa_t opa)
{
    int16_t epd_color = 255;
    if ((int16_t)color.full<250) {
        epd_color = (updateMode==MODE_DU) ? 0 : (int16_t)color.full/3;
    }
    uint16_t idx = (int16_t)y * buf_w / 2 + (int16_t)x / 2;
    if (x % 2) {
        buf[idx] = (buf[idx] & 0x0F) | (epd_color & 0xF0);
    } else {
        buf[idx] = (buf[idx] & 0xF0) | (epd_color >> 4);
    }
}
void epdiy_set_px_cb ( lv_disp_drv_t * disp_drv , uint8_t * buf , lv_coord_t buf_w , lv_coord_t x , lv_coord_t y , lv_color_t color , lv_opa_t opa ) { int16_t epd_color = 255 ; if ( ( int16_t ) color . full < 250 ) { epd_color = ( updateMode == MODE_DU ) ? 0 : ( int16_t ) color . full / 3 ; } uint16_t idx = ( int16_t ) y * buf_w / 2 + ( int16_t ) x / 2 ; if ( x % 2 ) { buf [ idx ] = ( buf [ idx ] & 0x0F ) | ( epd_color & 0xF0 ) ; } else { buf [ idx ] = ( buf [ idx ] & 0xF0 ) | ( epd_color >> 4 ) ; } }
Called for each pixel.
Called for each pixel .
// Test using RGB232 //Instead of using epd_draw_pixel: Set pixel directly in *buf that comes afterwards in flush as *color_map