Sharp MIP display driver


I want to use sharp memory LCD with lvgl. I see that there is a driver for this type of displays, but it’s not clear to me how to use the driver. I read the porting guide, maybe I didn’t understand it well.

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

nRF52840, Keil MDK

What do you want to achieve?

Set up a project with FreeRTOS that drives Sharp MIP display

What have you tried so far?

I have a driver that transfers the display buffer data to the display using DAM, but my port of lvgl doesn’t drive the display yet.

Code to reproduce

Add the relevant code snippets here.

The code block(s) should be between ```c and ``` tags:

/*You code here*/

Screenshot and/or video

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


  1. You have to copy lv_drv_conf_templ.h as lv_drv_conf.h next to the lv_drivers repo.
  2. In lv_drv_conf_h configure the SHARP_MIP driver
  3. In lv_drv_conf_h fill the SPI macros.

Thanks for the reply. Here is my main so far:

#include "lv_conf.h"
#include "lvgl.h"

int main(void)
    static lv_disp_buf_t disp_buf;              /*A static or global variable to store the buffers*/
    static lv_color_t buf_1[LV_HOR_RES_MAX * 10]; /*Static or global buffer(s). The second buffer is optional*/
    static lv_color_t buf_2[LV_HOR_RES_MAX * 10];
    lv_disp_buf_init(&disp_buf, buf_1, buf_2, LV_HOR_RES_MAX*10);/*Initialize `disp_buf` with the buffer(s) */
    lv_disp_drv_t disp_drv;                     /*A variable to hold the drivers. Can be local variable*/
    lv_disp_drv_init(&disp_drv);            /*Basic initialization*/
    disp_drv.buffer = &disp_buf;            /*Set an initialized buffer*/
    disp_drv.flush_cb = sharp_mip_flush;   /*Set a flush callback to draw to the display*/
    disp_drv.rounder_cb = sharp_mip_rounder;
    disp_drv.set_px_cb = sharp_mip_set_px;
    lv_disp_t * disp;
    disp = lv_disp_drv_register(&disp_drv); /*Register the driver and save the created display objects*/

When I try to compile it I get:

..\..\..\main.c(113): error: #20: identifier "sharp_mip_flush" is undefined
..\..\..\main.c(114): error: #20: identifier "sharp_mip_rounder" is undefined
..\..\..\main.c(115): error: #20: identifier "sharp_mip_set_px" is undefined

If I add #include "SHARP_MIP.h" in the include section I get this error:

..\..\..\main.c(58): error: #130: expected a "{"

It looks to my like there is a typo in SHARP_MIP.h

I know my code is not complete, I’m building after each step from the porting guide. Does this make any sense?

Did you set USE_SHARP_MIP to 1 in lv_drv_conf.h?

Yes, as well as #if 1 /*Set it to "1" to enable the content*/

The include parts are all set in Keil MDK

I see. Try to add #error "my build test" to SHARP_MIP.c. If you see the error it compiles.
If not then your project doesn’t see the source file.

Okay, the error doesn’t show. I searched all lvgl and lv_driver filex for sharp_mip.h and it’s not included enywhere. Then the “my build test” error is normal not to show.

If I add #include "SHARP_MIP".h in the main.c include section I get this error:

…\main.c(58): error: #130: expected a “{”

Do you mean #include "SHARP_MIP.h" ? (misplaced " )`

There are 2 typos is Sharp_MIP.h:

void sharp_mip_flush_(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); //the function shall be sharp_mip_flush
void sharp_mip_rounder(lv_disp_drv_t * disp_drv, lv_area_t * area);
void sharp_mip_set_px(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);
void sharp_mip_com_inversion(void)   // missing ;

Now I can compile the code :slight_smile:

Great! :slightly_smiling_face:

Can you sen a pull request to fix it?

I’m looking to use these same Sharp Memory LCD’s with the latest LVGL v9 library and need some help.

Would it be this same process as described by @kisvegabor @elektronchika ?

Can’t find any examples of LVGL & these LCD displays anywhere so lots of time wasted in trying things that don’t work.

Any help or advice here is greatly appreciated.

Using ESP32 Wroom + Platform IO with Arduino Framework.

You revived a thread that is almost five years old at this point.
I suggest making a new post.