Skip to content

Commit 9da9967

Browse files
committed
Correct display sequence format docs
1 parent ddb3590 commit 9da9967

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

shared-bindings/displayio/Display.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,24 +58,26 @@
5858
//| r"""Create a Display object on the given display bus (`FourWire`, `ParallelBus` or `I2CDisplay`).
5959
//|
6060
//| 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:
6668
//|
6769
//| .. code-block:: python
6870
//|
6971
//| init_sequence = (b"\xe1\x0f\x00\x0E\x14\x03\x11\x07\x31\xC1\x48\x08\x0F\x0C\x31\x36\x0F" # Set Gamma
7072
//| 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)
7274
//| )
7375
//| display = displayio.Display(display_bus, init_sequence, width=320, height=240)
7476
//|
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.
7981
//|
8082
//| The initialization sequence should always leave the display memory access inline with the scan
8183
//| of the display to minimize tearing artifacts.

shared-bindings/displayio/EPaperDisplay.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@
6565
//| """Create a EPaperDisplay object on the given display bus (`displayio.FourWire` or `displayio.ParallelBus`).
6666
//|
6767
//| The ``start_sequence`` and ``stop_sequence`` are bitpacked to minimize the ram impact. Every
68-
//| command begins with a command byte followed by a byte to determine the parameter count and if
69-
//| a delay is need after. When the top bit of the second byte is 1, the next byte will be the
70-
//| delay time in milliseconds. The remaining 7 bits are the parameter count excluding any delay
71-
//| byte. The third through final bytes are the remaining command parameters. The next byte will
72-
//| begin a new command definition.
68+
//| command begins with a command byte followed by a byte to determine the parameter count and
69+
//| delay. When the top bit of the second byte is 1 (0x80), a delay will occur after the command
70+
//| parameters are sent. The remaining 7 bits are the parameter count excluding any delay
71+
//| byte. The bytes following are the parameters. When the delay bit is set, a single byte after
72+
//| the parameters specifies the delay duration in milliseconds. The value 0xff will lead to an
73+
//| extra long 500 ms delay instead of 255 ms. The next byte will begin a new command definition.
7374
//|
7475
//| :param display_bus: The bus that the display is connected to
7576
//| :type _DisplayBus: displayio.FourWire or displayio.ParallelBus

0 commit comments

Comments
 (0)