Code
The code block(s) should be between ```c
and ```
tags:
/*You code here*/
#define LV_HOR_RES_MAX (240)
#define LV_VER_RES_MAX (240)
/* Color depth:
* - 1: 1 byte per pixel
* - 8: RGB332
* - 16: RGB565
* - 32: ARGB8888
*/
#define LV_COLOR_DEPTH 16
void lv_port_disp_init(void)
{
/*A static or global variable to store the buffers*/
static lv_disp_buf_t disp_buf;
/*Static or global buffer(s). The second buffer is optional*/
static lv_color_t buf_1[LV_HOR_RES_MAX * 10]; //
//static lv_color_t buf_2[LV_HOR_RES_MAX * 10];
/*Initialize `disp_buf` with the buffer(s) */
lv_disp_buf_init(&disp_buf, buf_1, NULL, LV_HOR_RES_MAX*10);
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;
//
disp_drv.flush_cb = disp_flush;
//
disp_drv.buffer = &disp_buf;
//
lv_disp_drv_register(&disp_drv);
}
void lv_disp_drv_init(lv_disp_drv_t * driver)
{
_lv_memset_00(driver, sizeof(lv_disp_drv_t));
driver->flush_cb = NULL;
driver->hor_res = LV_HOR_RES_MAX;
driver->ver_res = LV_VER_RES_MAX;
driver->buffer = NULL;
driver->rotated = LV_DISP_ROT_NONE;
driver->sw_rotate = 0;
driver->color_chroma_key = LV_COLOR_BLACK; //LV_COLOR_TRANSP //
driver->dpi = LV_DPI;
#if LV_ANTIALIAS
driver->antialiasing = true;
#endif
#if LV_COLOR_SCREEN_TRANSP
driver->screen_transp = 1;
#endif
#if LV_USE_GPU
driver->gpu_blend_cb = NULL;
driver->gpu_fill_cb = NULL;
#endif
#if LV_USE_USER_DATA
driver->user_data = NULL;
#endif
driver->set_px_cb = NULL;
}
static void disp_flush(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
lcd_color_fill(area->x1,area->y1,area->x2,area->y2,(u16_t*)color_p);
lv_disp_flush_ready(disp_drv);
}
## Screenshot and/or video
If possible, add screenshots and/or videos about the current state.
![image|560x500](upload://23idrPOJBUqXgiXrzdikNEsNFah.jpeg)