Skip to content

Commit 244119d

Browse files
committed
updates ili9341 driver
1 parent b780a32 commit 244119d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

api_drivers/common_api_drivers/display/ili9341.py

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from micropython import const # NOQA
33

44
import lvgl as lv # NOQA
5+
import lcd_bus # NOQA
56
import display_driver_framework
67

78

@@ -39,6 +40,51 @@
3940

4041
class ILI9341(display_driver_framework.DisplayDriver):
4142

43+
def __init__(
44+
self,
45+
data_bus,
46+
display_width,
47+
display_height,
48+
frame_buffer1=None,
49+
frame_buffer2=None,
50+
reset_pin=None,
51+
reset_state=STATE_LOW,
52+
power_pin=None,
53+
power_on_state=STATE_HIGH,
54+
backlight_pin=None,
55+
backlight_on_state=STATE_HIGH,
56+
offset_x=0,
57+
offset_y=0,
58+
color_byte_order=BYTE_ORDER_RGB, # NOQA
59+
color_space=lv.COLOR_FORMAT.RGB565,
60+
rgb565_byte_swap=False
61+
):
62+
63+
if (
64+
color_space == lv.COLOR_FORMAT.RGB565 and
65+
isinstance(data_bus, (lcd_bus.SPIBus, lcd_bus.I80Bus))
66+
):
67+
rgb565_byte_swap = True
68+
69+
super().__init__(
70+
data_bus=data_bus,
71+
display_width=display_width,
72+
display_height=display_height,
73+
frame_buffer1=frame_buffer1,
74+
frame_buffer2=frame_buffer2,
75+
reset_pin=reset_pin,
76+
reset_state=reset_state,
77+
power_pin=power_pin,
78+
power_on_state=power_on_state,
79+
backlight_pin=backlight_pin,
80+
backlight_on_state=backlight_on_state,
81+
offset_x=offset_x,
82+
offset_y=offset_y,
83+
color_byte_order=BYTE_ORDER_BGR,
84+
color_space=color_space,
85+
rgb565_byte_swap=rgb565_byte_swap
86+
)
87+
4288
def init(self, sequence=1):
4389
param_buf = bytearray(15)
4490
param_mv = memoryview(param_buf)

0 commit comments

Comments
 (0)