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

Method init

resources/waveshare_epd/ssd1306.py:71–83  ·  view source on GitHub ↗

Initialise I2C bus and send the SSD1306 startup sequence. Idempotent: if already initialised, returns immediately without re-sending the init sequence (same pattern as gc9a01.py).

(self, *args)

Source from the content-addressed store, hash-verified

69 # ------------------------------------------------------------------
70
71 def init(self, *args):
72 """Initialise I2C bus and send the SSD1306 startup sequence.
73
74 Idempotent: if already initialised, returns immediately without
75 re-sending the init sequence (same pattern as gc9a01.py).
76 """
77 if self._initialized:
78 return
79 self._setup_hardware()
80 self._send_init_sequence()
81 self._initialized = True
82 logger.info("SSD1306 initialised (%dx%d) at I2C 0x%02X bus %d",
83 self.width, self.height, self._addr, self._bus_num)
84
85 def Clear(self):
86 """Fill the display with black (all pixels off)."""

Callers 2

ClearMethod · 0.95
displayMethod · 0.95

Calls 3

_setup_hardwareMethod · 0.95
_send_init_sequenceMethod · 0.95
infoMethod · 0.80

Tested by

no test coverage detected