Setting up screen buffer for SSD1306 Mono LCD

Description

Display content of display buffer to LCD using a single page that is the entire display, not paged.
cb_flush() routine is called 8 times with 8 pages.
Only want a single page with area being the entire screen. Do not need to do paging when writing to SSD1306.

In lv_refr.c, line#313 the max_rows is calculated as (1024 / 128)=8 (buffer / width) but I want the result to be 64, so only a single page (0,0->127,64)

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

nrf52832 and MBed.

What do you want to achieve?

Display content of display buffer to LCD using a single page that is the entire display, not paged.
cb_flush() routine is called 8 times with 8 pages.
Only want a single page with area being the entire screen. Do not need to do paging when writing to SSD1306.

What have you tried so far?

The documentation indicates that lv_disp_buf_init() last parameter is the number of pixels in the display, but when I tried 128 * 64 it produced a crash.
Is it true that the last parameter is actually the number of bytes in the buffer, not the number of pixels?

Code to reproduce

Add the relevant code snippets here.

static lv_disp_buf_t disp_buf_1;
static lv_color_t buf1_1[128 * 64 / 8]; // 1k buffer as monochrome and only 1 bit per pixel.

lv_disp_buf_init(&disp_buf_1, buf1_1, NULL, 128 * 64 / 8);

In lv_refr.c, line#313 the max_rows is calculated as (1024 / 128)=8 (buffer / width) but I want the result to be 64, so only a single page (0,0->127,64)

Screenshot and/or video

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

The last parameter should be identical to the size you passed to your buf1_1 array. So the code sample you provided is the right way of doing it (both values should be the same).

It is the number of lv_color_t entries in the array, not the number of bytes.

LittlevGL doesn’t support 1 bit/px color format by default. However, you can set a set_px_cb in the display driver to set the content of the buffer as you need.

I suggest reading this excellent write up about porting LittlevGL to monochrome displays: