This repo comprises a device driver for the RA8875 and a port of my touch micro-GUI. It enables MicroPython targets to drive 4.3" and 7" touch displays via an SPI interface. It is an alternative to the original version which is based on different hardware with a parallel interface. The original version is faster thanks to the parallel interface and a highly optimised driver written by Robert Hammelrath. However it is STM specific and uses a large number of pins.
The RA8875 repo supports Adafruit hardware, namely
Controller board https://www.adafruit.com/product/1590
4.3 inch display https://www.adafruit.com/product/1591
7 inch display https://www.adafruit.com/product/2354
It is designed to be cross platform and should work (subject to RAM constraints) on any MicroPython target supporting the native and viper decorators.
RA8875 driver and GUI for large displays
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
RA8875 driver and GUI for large displays
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Images
My photography does not do justice to the Adafruit display hardware which is excellent.
Vertical slider controls, pushbuttons and dial displays:
Assorted controls - dropdown list, listbox, rotary "potentiometer" controls and dial display:
Dialog box:
New widgets. Vector displays in "clock" or "compass" variants:
The Textbox widget showing word wrap:
Basic tab stop support:
The plot module:
Vertical slider controls, pushbuttons and dial displays:
Assorted controls - dropdown list, listbox, rotary "potentiometer" controls and dial display:
Dialog box:
New widgets. Vector displays in "clock" or "compass" variants:
The Textbox widget showing word wrap:
Basic tab stop support:
The plot module:
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: RA8875 driver and GUI for large displays
I've now tested on an 800*480 display. These are available in two sizes, 5" and 7". The Adafruit ones appear to be electrically interchangeable: their driver and mine run the same code for both. My pictures are of a 5" display. I created two demos to see how more complex user interfaces fared given the relatively slow SPI connection. The conclusion is that they are entirely usable.
Test setup:
A simulation of an audio amplifier. The meters show dynamically changing (simulated) audio, with the colour going from cyan to yellow to red as the level increases. As usual the real displays look much better than in my photography.
If you select flat response the graphic eq controls all go to zero and are greyed out until you clear the textbox. With suitable hardware it would make a usable interface
One Pyboard acting as a terminal to another:
This is emphatically a demo. The handling of newlines and the lack of an insertion cursor are issues. A full solution would have better VT100 emulation with cursor control keys. However it does work, and the text window can be scrolled by touching it. Its speed is adequate. The keyboard keys flash when pressed as confirmation. The keyboard is easiest to use with a stylus rather than my fat fingers: the whole thing might be more finger friendly on a 7" screen.
Code for these demos is in my repo.
Test setup:
A simulation of an audio amplifier. The meters show dynamically changing (simulated) audio, with the colour going from cyan to yellow to red as the level increases. As usual the real displays look much better than in my photography.
If you select flat response the graphic eq controls all go to zero and are greyed out until you clear the textbox. With suitable hardware it would make a usable interface
One Pyboard acting as a terminal to another:
This is emphatically a demo. The handling of newlines and the lack of an insertion cursor are issues. A full solution would have better VT100 emulation with cursor control keys. However it does work, and the text window can be scrolled by touching it. Its speed is adequate. The keyboard keys flash when pressed as confirmation. The keyboard is easiest to use with a stylus rather than my fat fingers: the whole thing might be more finger friendly on a 7" screen.
Code for these demos is in my repo.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: RA8875 driver and GUI for large displays
This is an impressive demonstration.
b.t.w.: 9 inch displays with the RA8875 chip are available from www.buydisplay.com, and also a 10.1" model with an RA8876.
b.t.w.: 9 inch displays with the RA8875 chip are available from www.buydisplay.com, and also a 10.1" model with an RA8876.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: RA8875 driver and GUI for large displays
I gather that there can be differences in the electrical specifications of these displays which need to be respected in the driver. Consequently in my docs I recommend the Adafruit displays: I have copied the initialisation parameters from the Adafruit drivers.
To support larger displays I'd need to find the relevant information, possibly adapt the driver, and test with an actual display. The 9" display is 800x480 pixels so it may work with my driver but I couldn't guarantee it.
To support larger displays I'd need to find the relevant information, possibly adapt the driver, and test with an actual display. The 9" display is 800x480 pixels so it may work with my driver but I couldn't guarantee it.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: RA8875 driver and GUI for large displays
I have pushed an update to this driver with two additional widgets. A Pad object which is an invisible touch sensitive rectangular region. This can be used as an overlay to add touch sensitivity to a control which normally lacks it.
The new Scale widget can display floating point values with very high resolution. This is shown and explained in the sample images. Apologies for my poor photography. I seem to specialise in blurred text and trapezium renditions of rectangles.
The new Scale widget can display floating point values with very high resolution. This is shown and explained in the sample images. Apologies for my poor photography. I seem to specialise in blurred text and trapezium renditions of rectangles.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.