You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* can now send the I2C bus initialization code
* can now reset the display on an I/O expander pin
* parameters re-ordered to enable easy use with **board.TFT_IO_EXPANDER
Copy file name to clipboardExpand all lines: shared-bindings/dotclockframebuffer/__init__.c
+39-15Lines changed: 39 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -39,15 +39,17 @@
39
39
//|
40
40
//| def ioexpander_send_init_sequence(
41
41
//| bus: busio.I2C,
42
+
//| init_sequence: ReadableBuffer,
43
+
//| *,
44
+
//| i2c_init_sequence: ReadableBuffer,
42
45
//| i2c_address: int,
43
-
//| reg_addr: int,
44
-
//| gpio_data_len: Length,
45
46
//| gpio_address: int,
47
+
//| gpio_data_len: Length,
46
48
//| gpio_data: int,
47
49
//| cs_bit: int,
48
50
//| mosi_bit: int,
49
51
//| clk_bit: int,
50
-
//| init_sequence: ReadableBuffer,
52
+
//| reset_bit: Optional[int],
51
53
//| ):
52
54
//| """Send a displayio-style initialization sequence over an I2C I/O expander
53
55
//|
@@ -60,30 +62,41 @@
60
62
//|
61
63
//| Normally this function is used via a convenience library that is specific to the display & I/O expander in use.
62
64
//|
65
+
//| If the board has an integrated I/O expander, ``**board.TFT_IO_EXPANDER`` expands to the proper arguments starting with ``gpio_address``.
66
+
//| Note that this may include the ``i2c_init_sequence`` argument which can change the direction & value of I/O expander pins.
67
+
//| If this is undesirable, take a copy of ``TFT_IO_EXPANDER`` and change or remove the ``i2c_init_sequence`` key.
68
+
//|
69
+
//| If the board has an integrated display that requires an initialization sequence, ``board.TFT_INIT_SEQUENCE`` is the initialization string for the display.
70
+
//|
63
71
//| :param busio.I2C bus: The I2C bus where the I/O expander resides
64
-
//| :param busio.i2c_address: int: The I2C bus address of the I/O expander
72
+
//| :param int busio.i2c_address: The I2C bus address of the I/O expander
73
+
//| :param ReadableBuffer init_sequence: The initialization sequence to send to the display
65
74
//| :param int gpio_address: The address portion of the I2C transaction (1 byte)
66
75
//| :param int gpio_data_len: The size of the data portion of the I2C transaction, 1 or 2 bytes
67
76
//| :param int gpio_data: The output value for all GPIO bits other than cs, mosi, and clk (needed because GPIO expanders may be unable to read back the current output value)
68
77
//| :param int cs_bit: The bit number (from 0 to 7, or from 0 to 15) of the chip select bit in the GPIO register
69
78
//| :param int mosi_value: The bit number (from 0 to 7, or from 0 to 15) of the data out bit in the GPIO register
70
79
//| :param int clk_value: The bit number (from 0 to 7, or from 0 to 15) of the clock out bit in the GPIO register
80
+
//| :param Optional[int] reset_value: The bit number (from 0 to 7, or from 0 to 15) of the display reset bit in the GPIO register
81
+
//| :param Optional[ReadableBuffer] i2c_init_sequence: An initialization sequence to send to the I2C expander
0 commit comments