|
9 | 9 | BYTE_ORDER_RGB = display_driver_framework.BYTE_ORDER_RGB |
10 | 10 | BYTE_ORDER_BGR = display_driver_framework.BYTE_ORDER_BGR |
11 | 11 |
|
12 | | -_MADCTL_MH = const(0x04) # Refresh 0=Left to Right, 1=Right to Left |
13 | | -_MADCTL_BGR = const(0x08) # BGR color order |
14 | | -_MADCTL_ML = const(0x10) # Refresh 0=Top to Bottom, 1=Bottom to Top |
15 | | -_MADCTL_MV = const(0x20) # 0=Normal, 1=Row/column exchange |
16 | | -_MADCTL_MX = const(0x40) # 0=Left to Right, 1=Right to Left |
17 | | -_MADCTL_MY = const(0x80) # 0=Top to Bottom, 1=Bottom to Top |
| 12 | +_MADCTL_MV = const(0x20) |
| 13 | +_MADCTL_MX = const(0x40) |
| 14 | +_MADCTL_MY = const(0x80) |
18 | 15 |
|
19 | 16 |
|
20 | 17 | class ST7796(display_driver_framework.DisplayDriver): |
21 | | - # The st7795 display controller has an internal framebuffer |
22 | | - # arranged in 320 x 480 |
23 | | - # configuration. Physical displays with pixel sizes less than |
24 | | - # 320 x 480 must supply a start_x and |
25 | | - # start_y argument to indicate where the physical display begins |
26 | | - # relative to the start of the |
27 | | - # display controllers internal framebuffer. |
28 | | - |
29 | | - # this display driver supports RGB565 and also RGB666. RGB666 is going to |
30 | | - # use twice as much memory as the RGB565. It is also going to slow down the |
31 | | - # frame rate by 1/3, This is becasue of the extra byte of data that needs |
32 | | - # to get sent. To use RGB666 the color depth MUST be set to 32. |
33 | | - # so when compiling |
34 | | - # make sure to have LV_COLOR_DEPTH=32 set in LVFLAGS when you call make. |
35 | | - # For RGB565 you need to have LV_COLOR_DEPTH=16 |
36 | | - |
37 | | - # the reason why we use a 32 bit color depth is because of how the data gets |
38 | | - # written. The entire 8 bits for each byte gets sent. The controller simply |
39 | | - # ignores the lowest 2 bits in the byte to make it a 6 bit color channel |
40 | | - # We just have to tell lvgl that we want to use |
41 | 18 |
|
42 | 19 | _ORIENTATION_TABLE = ( |
43 | | - 0x0, |
44 | | - _MADCTL_MV | _MADCTL_MX, |
45 | | - _MADCTL_MY | _MADCTL_MX, |
46 | | - _MADCTL_MV | _MADCTL_MY |
| 20 | + _MADCTL_MX, |
| 21 | + _MADCTL_MV | _MADCTL_MY | _MADCTL_MX, |
| 22 | + _MADCTL_MY, |
| 23 | + _MADCTL_MV |
47 | 24 | ) |
0 commit comments