{
  "id": "mattytrentini/MicroPython_ST7305_RLCD",
  "name": "MicroPython_ST7305_RLCD",
  "prettyName": "MicroPython_ST7305_RLCD",
  "description": "MIT-licensed MicroPython ST7305 driver for Waveshare ESP32-S3-RLCD-4.2",
  "version": "",
  "author": "mattytrentini",
  "license": "MIT",
  "tags": [],
  "status": "VALID",
  "official": false,
  "source": "https://github.com/mattytrentini/MicroPython_ST7305_RLCD",
  "updatedAt": "2026-11-21T21:32:21.945Z",
  "page": "https://checkmim.com/packages/mattytrentini+MicroPython_ST7305_RLCD",
  "createdAt": "2026-11-21T21:32:20.180Z",
  "submittedBy": "Matt",
  "install": {
    "mpremote": "mpremote mip install github:mattytrentini/MicroPython_ST7305_RLCD",
    "mip": "import mip; mip.install(\"github:mattytrentini/MicroPython_ST7305_RLCD\")"
  },
  "readme": "# MicroPython ST7305 driver for Waveshare ESP32-S3-RLCD-4.2\n\nMIT-licensed, monochrome `framebuf` driver for the **400 × 300** reflective LCD\non the [Waveshare ESP32-S3-RLCD-4.2](https://docs.waveshare.com/ESP32-S3-RLCD-4.2).\nThis targets the board's 4.2-inch panel, **not** other ST7305 display sizes.\n\nBased on [elulis's MIT-licensed ST7305 MicroPython driver](https://github.com/elulis/micropython_ST7302/blob/main/st7305viper.py).\nThe panel-specific init values, 400 × 300 address window and landscape pixel\nlayout follow [Waveshare's display example](https://github.com/waveshareteam/ESP32-S3-RLCD-4.2/blob/main/02_Example/Arduino/08_LVGL_V8_Test/display_bsp.cpp).\nNo code from GPL-licensed drivers is used.\n\n## Install\n\nWith the board running MicroPython and connected over USB:\n\n```sh\nmpremote connect /dev/ttyACM0 mip install github:mattytrentini/MicroPython_ST7305_RLCD\n```\n\nAlternatively, copy `st7305_rlcd.py` to the board with `mpremote fs cp`.\nNo additional Python dependencies are needed; firmware must support `framebuf`\nand MicroPython's `@micropython.viper` emitter.\n\n## Usage\n\n```python\nfrom machine import Pin, SPI\nfrom st7305_rlcd import RLCD42\n\n# SPI(1) defaults to this display's SCK=11 and MOSI=12 on the\n# WAVESHARE_ESP32_S3_RLCD_42 MicroPython board build. MISO is not wired.\nspi = SPI(1, baudrate=10_000_000, polarity=0, phase=0)\nlcd = RLCD42(spi, Pin(40, Pin.OUT), Pin(5, Pin.OUT), Pin(41, Pin.OUT))\nlcd.fill(0)                          # Black background\nlcd.text(\"Hello, RLCD!\", 20, 20, 1)  # White text\nlcd.rect(1, 1, 398, 298, 1)         # White border, 1-pixel edge gap\nlcd.refresh()                        # Send the full image over SPI\n```\n\nThe screen is **400 pixels wide by 300 pixels high in landscape orientation**.\n`RLCD42` inherits `framebuf.FrameBuffer`: `pixel`, `line`, `rect`, `fill_rect`,\n`text`, and `blit` update an in-memory canvas; `refresh()` transfers it. Color\n`0` is black and `1` is white on this board. The driver uses 15,200 bytes for\nthe padded `MONO_VLSB` canvas and 15,000 bytes for the panel-format transfer\nbuffer. The board's TE pin (GPIO6) is not required for full-screen refreshes.\n\nThe `SPI(1)` pin defaults above are specific to the\n`WAVESHARE_ESP32_S3_RLCD_42` MicroPython board build. On other MicroPython\nfirmware, pass `sck=Pin(11), mosi=Pin(12)` explicitly and select a suitable\nhardware SPI bus with **no MISO**.\n\n## Attribution and license\n\nCopyright © 2024 Eluli; modifications © 2026 Matty Trentini. Released under\nthe [MIT license](LICENSE). Waveshare's [example repository](https://github.com/waveshareteam/ESP32-S3-RLCD-4.2)\nprovides the board-specific electrical settings and pixel format reference.\n"
}