Blank screen using Sharp MIP display driver

Description

Blank screen using Sharp MIP display driver

What MCU/Processor/Board and compiler are you using?

STM32/STM32CubeIDE

What do you want to achieve?

Display the tutorial hello world to start with

What have you tried so far?

Built and configured to use the Sharp MIP driver as per the general porting instructions, set the flush callback, set the driver to write to the board GPIO and SPI outputs, enabled the tutorial defines, then call periodic tick forever. I’ve tried both soft and hard com inversion.

The comments at the top of SHARP_MIP.c and posting in Display drivers to share (sharp mip, uc1610) suggest that application-level changes are needed to increase the buffer size to accommodate extra fields for the SPI transmit (see snippet below). But it’s not clear what ‘X’ refers to, or what the extra defines are used for. Could a working example of the changes to buffer/driver initialisation be provided?

Code to reproduce

 *  VDB size : (LV_VER_RES / X) * (2 + LV_HOR_RES / 8) + 2 bytes, structure :
 * 	    [FRAME_HEADER (1 byte)] [GATE_ADDR (1 byte )] [LINE_DATA (LV_HOR_RES / 8 bytes)]	1st  line
 *	    [DUMMY        (1 byte)] [GATE_ADDR (1 byte )] [LINE_DATA (LV_HOR_RES / 8 bytes)]	2nd  line
 *	    ...........................................................................................
 *      [DUMMY        (1 byte)] [GATE_ADDR (1 byte )] [LINE_DATA (LV_HOR_RES / 8 bytes)]	last line
 *      [DUMMY                             (2 bytes)]
 *
 *  Since extra bytes (dummy, addresses, header) are stored in VDB, we need to use
 *  an "external" VDB. Configuration in lv_conf becomes :
 *  	#define LV_VDB_SIZE         ((LV_VER_RES / X) * LV_HOR_RES)
 *  	#define LV_VDB_PX_BPP       1
 *  	#define LV_VDB_ADR          LV_VDB_ADR_INV
 *  and before lv_init() we must call lv_vdb_set_adr(our_vdb_address, NULL)

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

Hi,
The related comment on SHARP_MIP.c has changed like this :

*  Since extra bytes (dummy, addresses, header) are stored in VDB, we need to use
*  an "oversized" VDB. Buffer declaration in "lv_port_disp.c" becomes for example :
*      static lv_disp_buf_t disp_buf;
*      static uint8_t buf[(LV_VER_RES_MAX / X) * (2 + (LV_HOR_RES_MAX / 8)) + 2];
*      lv_disp_buf_init(&disp_buf, buf, NULL, LV_VER_RES_MAX * LV_HOR_RES_MAX / X);

https://github.com/littlevgl/lv_drivers/blob/master/display/SHARP_MIP.c

X refers to the fraction of the total screen lines the VDB is able to store.

This is an example for lv_port_disp_init() function in lv_port_disp.c file where VDB stores half of all screen lines :

lv_disp_t * lv_port_disp_init(void) {
    /*--------------------
     * Initialize display
     * ------------------*/
    sharp_mip_init();

    /*-----------------------------
     * Create a buffer for drawing
     *----------------------------*/
    static lv_disp_buf_t sharp_mip_disp_buf;
    static uint8_t       sharp_mip_buf[(LV_VER_RES_MAX / 2) * (2 + (LV_HOR_RES_MAX / 8)) + 2];
    lv_disp_buf_init(&sharp_mip_disp_buf, sharp_mip_buf, NULL, LV_VER_RES_MAX * LV_HOR_RES_MAX / 2);

    /*-----------------------------------
     * Register the display in LittlevGL
     *----------------------------------*/
    lv_disp_drv_t disp_drv;
    lv_disp_drv_init(&disp_drv);

    /*Set the resolution of the display*/
    disp_drv.hor_res = LV_HOR_RES_MAX;
    disp_drv.ver_res = LV_VER_RES_MAX;

    /*Set up the functions to access display*/
    disp_drv.flush_cb   = sharp_mip_flush;
    disp_drv.set_px_cb  = sharp_mip_set_px;
    disp_drv.rounder_cb = sharp_mip_rounder;

    /*Set a display buffer*/
    disp_drv.buffer = &sharp_mip_disp_buf;

    return lv_disp_drv_register(&disp_drv);
}

Thanks for the clarification and the example code. I now have it working with the both the LS044Q7DH01 and LS027B7DH01 Sharp memory displays.

I am seeing display corruption on the LS044Q7DH01. It doesn’t clear the screen when calling lv_obj_clean(lv_scr_act());. This screenshot is from LittlevGL tutorial lv_tutorial_objects():-

Increasing X from 2 to 32 helps with the display corruption, although only the bottom half of the buttons are filled black and I can’t clear the screen.

What happens if you drag the slider? Is it working well?

I don’t currently have an input driver. I’m currently looking at how a GPIO input can be used according to https://blog.littlevgl.com/2019-01-08/hardware-button, but button actions seem to have been replaced by events and it’s not working. indev_drv.read_cb updates data->state correctly when the GPIO button is pressed, but indev_drv.feedback_cb is never called.

Then you can set the value with an animation:

lv_slider_set_anim_time(slider, 2000);
lv_slider_set_value(slider, 80, LV_ANIM_ON);