Skip to content

Commit 0e78ab6

Browse files
committed
rgbmatrix: document MTX_ADDRESS and MTX_COMMON
1 parent b61900f commit 0e78ab6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

shared-bindings/rgbmatrix/RGBMatrix.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,14 @@ STATIC void preflight_pins_or_throw(uint8_t clock_pin, uint8_t *rgb_pins, uint8_
192192
//| A RGBMatrix is often used in conjunction with a
193193
//| `framebufferio.FramebufferDisplay`.
194194
//|
195+
//| On boards designed for use with RGBMatrix panels, `board.MTX_ADDRESS` is a tuple of all the address pins, and `board.MTX_COMMON` is a dictionary with ``rgb_pins``, ``clock_pin``, ``latch_pin``, and ``output_enable_pin``.
196+
//| For panels that use fewer than the maximum number of address pins, "slice" the ``MTX_ADDRESS`` to get the correct number of address pins.
197+
//| Using these board properties makes calling the constructor simpler and more portable:
198+
//|
199+
//| .. code-block:: python
200+
//|
201+
//| matrix = rgbmatrix.RGBMatrix(..., addr_pins=board.MTX_ADDRESS[:4], **board.MTX_COMMON)
202+
//|
195203
//| :param int width: The overall width of the whole matrix in pixels. For a matrix with multiple panels in row, this is the width of a single panel times the number of panels across.
196204
//| :param int tile: In a multi-row matrix, the number of rows of panels
197205
//| :param int bit_depth: The color depth of the matrix. A value of 1 gives 8 colors, a value of 2 gives 64 colors, and so on. Increasing bit depth increases the CPU and RAM usage of the RGBMatrix, and may lower the panel refresh rate. The framebuffer is always in RGB565 format regardless of the bit depth setting

0 commit comments

Comments
 (0)