|
58 | 58 | //| r"""Create a Display object on the given display bus (`FourWire`, `ParallelBus` or `I2CDisplay`). |
59 | 59 | //| |
60 | 60 | //| The ``init_sequence`` is bitpacked to minimize the ram impact. Every command begins with a |
61 | | -//| command byte followed by a byte to determine the parameter count and if a delay is need after. |
62 | | -//| When the top bit of the second byte is 1, the next byte will be the delay time in milliseconds. |
63 | | -//| The remaining 7 bits are the parameter count excluding any delay byte. The third through final |
64 | | -//| bytes are the remaining command parameters. The next byte will begin a new command definition. |
65 | | -//| Here is a portion of ILI9341 init code: |
| 61 | +//| command byte followed by a byte to determine the parameter count and delay. When the top bit |
| 62 | +//| of the second byte is 1 (0x80), a delay will occur after the command parameters are sent. |
| 63 | +//| The remaining 7 bits are the parameter count excluding any delay byte. The bytes following |
| 64 | +//| are the parameters. When the delay bit is set, a single byte after the parameters specifies |
| 65 | +//| the delay duration in milliseconds. The value 0xff will lead to an extra long 500 ms delay |
| 66 | +//| instead of 255 ms. The next byte will begin a new command definition. |
| 67 | +//| Here is an example: |
66 | 68 | //| |
67 | 69 | //| .. code-block:: python |
68 | 70 | //| |
69 | 71 | //| init_sequence = (b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma |
70 | 72 | //| b"\x11\x80\x78"# Exit Sleep then delay 0x78 (120ms) |
71 | | -//| b"\x29\x80\x78"# Display on then delay 0x78 (120ms) |
| 73 | +//| b"\x29\x81\xaa\x78"# Display on then delay 0x78 (120ms) |
72 | 74 | //| ) |
73 | 75 | //| display = displayio.Display(display_bus, init_sequence, width=320, height=240) |
74 | 76 | //| |
75 | | -//| The first command is 0xe1 with 15 (0xf) parameters following. The second and third are 0x11 and |
76 | | -//| 0x29 respectively with delays (0x80) of 120ms (0x78) and no parameters. Multiple byte literals |
77 | | -//| (b"") are merged together on load. The parens are needed to allow byte literals on subsequent |
78 | | -//| lines. |
| 77 | +//| The first command is 0xe1 with 15 (0xf) parameters following. The second is 0x11 with 0 |
| 78 | +//| parameters and a 120ms (0x78) delay. The third command is 0x29 with one parameter 0xaa and a |
| 79 | +//| 120ms delay (0x78). Multiple byte literals (b"") are merged together on load. The parens |
| 80 | +//| are needed to allow byte literals on subsequent lines. |
79 | 81 | //| |
80 | 82 | //| The initialization sequence should always leave the display memory access inline with the scan |
81 | 83 | //| of the display to minimize tearing artifacts. |
|
0 commit comments