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)
| 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).""" |
no test coverage detected