Add BGR argument to lcd init.

This commit is contained in:
iabdalkader 2020-02-15 19:53:03 +02:00
parent f58980fdc8
commit 0cfae6334e
3 changed files with 5 additions and 1 deletions

View File

@ -49,6 +49,7 @@ write_command(0x11) # Sleep Exit
time.sleep(120)
# Memory Data Access Control
# Write 0xC8 for BGR mode.
write_command(0x36, 0xC0)
# Interface Pixel Format

View File

@ -204,7 +204,9 @@ static mp_obj_t py_lcd_init(uint n_args, const mp_obj_t *args, mp_map_t *kw_args
systick_sleep(120);
// Memory Data Access Control
lcd_write_command(0x36, 1, (uint8_t []) {0xC0});
uint8_t madctl = 0xC0;
uint8_t bgr = py_helper_keyword_int(n_args, args, 0, kw_args, MP_OBJ_NEW_QSTR(MP_QSTR_bgr), 0);
lcd_write_command(0x36, 1, (uint8_t []) {madctl | (bgr<<3)});
// Interface Pixel Format
lcd_write_command(0x3A, 1, (uint8_t []) {0x05});

View File

@ -83,6 +83,7 @@ Q(set_backlight)
Q(get_backlight)
Q(display)
Q(clear)
Q(bgr)
// tv Module
Q(tv)