|
2 | 2 | from micropython import const # NOQA
|
3 | 3 |
|
4 | 4 | import lvgl as lv # NOQA
|
| 5 | +import lcd_bus # NOQA |
5 | 6 | import display_driver_framework
|
6 | 7 |
|
7 | 8 |
|
|
39 | 40 |
|
40 | 41 | class ILI9341(display_driver_framework.DisplayDriver):
|
41 | 42 |
|
| 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 | + |
42 | 88 | def init(self, sequence=1):
|
43 | 89 | param_buf = bytearray(15)
|
44 | 90 | param_mv = memoryview(param_buf)
|
|
0 commit comments