mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add BGR argument to lcd init.
This commit is contained in:
parent
f58980fdc8
commit
0cfae6334e
@ -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
|
||||
|
||||
@ -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});
|
||||
|
||||
@ -83,6 +83,7 @@ Q(set_backlight)
|
||||
Q(get_backlight)
|
||||
Q(display)
|
||||
Q(clear)
|
||||
Q(bgr)
|
||||
|
||||
// tv Module
|
||||
Q(tv)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user