You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that I can insert
{ST7789_DISPON, {0}, 0x80}, //existing line
#if LV_COLOR_16_SWAP == 0 // Test: enable little endian.
{ST7789_RAMCTRL, {0, 8}, 2}, // Test: enable little endian.
#endif //DL: enable little endian.
{0, {0}, 0xff}, //existing line
to st7789_init_cmds in st7789.c
and now I can build with CONFIG_LV_COLOR_16_SWAP=n
and make LVGL code 500 bytes smaller and more efficient.
Note that ST7789VW doc says "Note: Little Endian only can be supported in 65K 8-bit and 9-bit interface.", so this trick may not work for everyone, but it seem to work for me (I am using SPI, of course).
Also, it will be nice to remove "static" from "static void st7789_send_cmd(uint8_t cmd)" and "static void st7789_send_data(void * data, uint16_t length)"
so I can experiment with register programming from my own code.
Thank you
The text was updated successfully, but these errors were encountered:
Yes
I added
#if LV_COLOR_16_SWAP==0
//CONFIG_LV_COLOR_16_SWAP=n is more efficient for little endian platforms
st7789_send_cmd(ST7789_RAMCTRL);
st7789_send_data( (uint8_t[]) {0, 8}, 2);
#endif
to guiTask in main.c
and it works OK for both
CONFIG_LV_COLOR_16_SWAP=n
and
CONFIG_LV_COLOR_16_SWAP=y
I recommend CONFIG_LV_COLOR_16_SWAP=n
code is smaller and more efficient.
Also, I suggest you add
#if LV_COLOR_16_SWAP == 0
{ST7789_RAMCTRL, {0, 8}, 2},
#endif
to st7789_init
I found that I can insert
{ST7789_DISPON, {0}, 0x80}, //existing line
#if LV_COLOR_16_SWAP == 0 // Test: enable little endian.
{ST7789_RAMCTRL, {0, 8}, 2}, // Test: enable little endian.
#endif //DL: enable little endian.
{0, {0}, 0xff}, //existing line
to st7789_init_cmds in st7789.c
and now I can build with CONFIG_LV_COLOR_16_SWAP=n
and make LVGL code 500 bytes smaller and more efficient.
Note that ST7789VW doc says "Note: Little Endian only can be supported in 65K 8-bit and 9-bit interface.", so this trick may not work for everyone, but it seem to work for me (I am using SPI, of course).
Also, it will be nice to remove "static" from "static void st7789_send_cmd(uint8_t cmd)" and "static void st7789_send_data(void * data, uint16_t length)"
so I can experiment with register programming from my own code.
Thank you
The text was updated successfully, but these errors were encountered: