Drivers for ST7735 and ST7789V

Posted on
  • I was going to help with the drivers for ST7735 and ST7789V but in searching I see that they're referenced in the "Build config" python code.

    Does Espruino have built in support for these (and all the other) LCD screens?­b/master/scripts/build_platform_config.p­y#L382

    Any advice on how to use it? I'd like to show off some code?

  • Espruino does have some code to handle those screens which I added very recently, but it's something you'll have to recompile to use - take a look at the BANGLE*.py for some examples.

    However I'm pretty sure that the driver for at least one of those displays leans heavily on Nordic's HAL layer so would need some work to run on other devices. What device were you looking at making it run on?

  • Jorgen did a driver for the ST7735 a while back. Its in this thread:­822/

    You can require the driver directly via https like this:

    D5.set(); // Backlight On
    var colorPalette = new Uint16Array([0, 0xF80F, 0x001F, 0xFFFF]);
    var spi = new SPI();
    spi.setup({mosi:D19 /* sda */, sck:D18 /* scl */});
    var g = require("­api/v1/files/a77b4d12f6a3b7587da5a3a70c0­2dc13ad2a3332.js").connectPaletted(color­Palette, spi, D21 /* DC */, D15 /*CS */, D2 /* RST */, function() {

    Adjust the pinouts for your setup. I've used it a few times and it seems fine. Gordon was there something you found wrong about it? I noticed it wasn't on the drivers page. Maybe I missed something about it.

    The unit I have is labeled SCL and SDA, but as you can see on some forums thats just how its labelled. It is in fact SPI.

  • I don't think so - looking at the thread I'd asked if I could grab an image of it so I could add some docs for it, and didn't get a reply so it just fell off my stack of things to do.

    If you fancied submitting it as a module it'd be awesome though :)

  • Well its not my work. So I guess we'd have to ask him :)

  • Also if you look at his actual code at his link, from my impression its almost exactly like the ILI9163 module. So I'm not sure what I would do exactly to make it submissable -- it SEEMS like a module for me already, and works -- though to be fair, I've never made a module before for Espruino. :)

  • Just added - basically all you need is a .md file with an example of use and hopefully a picture:

    If you're interested, this is what I did:­/commit/fb50e12ef45b22a05f3e10777ab16a74­9ce1a325

    It'll be live next time I do an update. I changed the module a bit to allow a height to be optionally specified since it looks like loads of ST7735 displays are 128x160 rather than just 128x128 - since I don't have one, please could you test it and make sure it still works?

  • Wow, great! I get the pattern now. Thanks for laying it out so clearly -- the changes in github make it really clear. I'll test it out and hopefully you'll see my first module -- one day soon :)

  • Thanks!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Drivers for ST7735 and ST7789V

Posted by Avatar for DamianMontero @DamianMontero