MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / init

Method init

resources/waveshare_epd/gc9a01.py:54–67  ·  view source on GitHub ↗

Initialise SPI, GPIO and the GC9A01 controller. This is called every display loop iteration for e-Paper partial-update compatibility. We only run the full hardware setup + reset sequence once to avoid the blank flash that a reset causes on every frame.

(self, *args)

Source from the content-addressed store, hash-verified

52 # ------------------------------------------------------------------
53
54 def init(self, *args):
55 """Initialise SPI, GPIO and the GC9A01 controller.
56
57 This is called every display loop iteration for e-Paper partial-update
58 compatibility. We only run the full hardware setup + reset sequence
59 once to avoid the blank flash that a reset causes on every frame.
60 """
61 if self._initialized:
62 return # Already running — skip reset/reinit entirely
63 self._setup_hardware()
64 self._reset()
65 self._send_init_sequence()
66 self._initialized = True
67 logger.info("GC9A01 initialised (%dx%d)", self.width, self.height)
68
69 def Clear(self, color=0xFFFF):
70 """Fill the entire display with a solid RGB565 colour (default white)."""

Callers 5

_run_lcd1602Method · 0.95
_run_ssd1306Method · 0.95
_run_max7219Method · 0.95
ClearMethod · 0.95
displayMethod · 0.95

Calls 4

_setup_hardwareMethod · 0.95
_resetMethod · 0.95
_send_init_sequenceMethod · 0.95
infoMethod · 0.80

Tested by

no test coverage detected