8000 Update displayio docs to add detail to display bus comments · rhwlo/circuitpython@afbf590 · GitHub
[go: up one dir, main page]

Skip to content

Commit afbf590

Browse files
committed
Update displayio docs to add detail to display bus comments
Fixes adafruit#1599
1 parent 224e9b1 commit afbf590

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

shared-bindings/displayio/FourWire.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,19 @@
4646
//| Manage updating a display over SPI four wire protocol in the background while Python code runs.
4747
//| It doesn't handle display initialization.
4848
//|
49-
//| .. class:: FourWire(spi_bus, *, command, chip_select, reset)
49+
//| .. class:: FourWire(spi_bus, *, command, chip_select, reset=None)
5050
//|
5151
//| Create a FourWire object associated with the given pins.
5252
//|
53+
//| The SPI bus and pins are then in use by the display until `displayio.release_displays()` is
54+
//| called even after a reload. (It does this so CircuitPython can use the display after your code
55+
//| is done.) So, the first time you initialize a display bus in code.py you should call
56+
//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run.
57+
//|
5358
//| :param busio.SPI spi_bus: The SPI bus that make up the clock and data lines
5459
//| :param microcontroller.Pin command: Data or command pin
5560
//| :param microcontroller.Pin chip_select: Chip select pin
56-
//| :param microcontroller.Pin reset: Reset pin
61+
//| :param microcontroller.Pin reset: Reset pin. When None only software reset can be used
5762
//|
5863
STATIC mp_obj_t displayio_fourwire_make_new(const mp_obj_type_t *type, size_t n_args, const mp_obj_t *pos_args, mp_map_t *kw_args) {
5964
enum { ARG_spi_bus, ARG_command, ARG_chip_select, ARG_reset };

shared-bindings/displayio/ParallelBus.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,24 @@
3939

4040
//| .. currentmodule:: displayio
4141
//|
42-
//| :class:`ParallelBus` -- Manage updating a display over SPI four wire protocol
42+
//| :class:`ParallelBus` -- Manage updating a display over 8-bit parallel bus
4343
//| ==============================================================================
4444
//|
45-
//| Manage updating a display over SPI four wire protocol in the background while Python code runs.
46-
//| It doesn't handle display initialization.
45+
//| Manage updating a display over 8-bit parallel bus in the background while Python code runs. This
46+
//| protocol may be refered to as 8080-I Series Parallel Interface in datasheets. It doesn't handle
47+
//| display initialization.
4748
//|
4849
//| .. class:: ParallelBus(*, data0, command, chip_select, write, read, reset)
4950
//|
5051
//| Create a ParallelBus object associated with the given pins. The bus is inferred from data0
5152
//| by implying the next 7 additional pins on a given GPIO port.
5253
//|
53-
//| :param microcontroller.Pin: The first data pin. The rest are implied
54+
//| The parallel bus and pins are then in use by the display until `displayio.release_displays()`
55+
//| is called even after a reload. (It does this so CircuitPython can use the display after your
56+
//| code is done.) So, the first time you initialize a display bus in code.py you should call
57+
//| :py:func`displayio.release_displays` first, otherwise it will error after the first code.py run.
58+
//|
59+
//| :param microcontroller.Pin data0: The first data pin. The rest are implied
5460
//| :param microcontroller.Pin command: Data or command pin
5561
//| :param microcontroller.Pin chip_select: Chip select pin
5662
//| :param microcontroller.Pin write: Write pin

shared-bindings/displayio/__init__.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@
7171
//| Shape
7272
//| TileGrid
7373
//|
74-
//| All libraries change hardware state but are never deinit
75-
//|
7674

7775

7876
//| .. method:: release_displays()
@@ -81,6 +79,9 @@
8179
//| release the builtin display on boards that have one. You will need to reinitialize it yourself
8280
//| afterwards.
8381
//|
82+
//| Use this once in your code.py if you initialize a display. Place it right before the
83+
//| initialization so the display is active as long as possible.
84+
//|
8485
STATIC mp_obj_t displayio_release_displays(void) {
8586
common_hal_displayio_release_displays();
8687
return mp_const_none;

0 commit comments

Comments
 (0)
0