Display interface

In order to work on every display, ardUI needs to know how to talk to that specific display, but how does ardUI know how to do that?

In short, it doesn't. In a bit more detail, ardUI has a common display interface to do just that. This interface is just a set of functions ardUI can call to get information about a display and draw basic shapes. Once you have installed ardUI, open the llpi.cpp file (LLPI stands for Low-Level Programming Interface) and complete the functions there to work with your display. Once that is done, ardUI will work with your exact display.

Completing the interface

ardUI architecture can be visualized like this, where your application is on the very top and your hardware on the bottom:

ardUI architecture

ardUI display interface is the third layer in this image and it allows ardUI to communicate with your display (usually via a display library). Display interface was made to be very similar to many ready display libraries so that creating an interface is as simple as possible. This is what it might look like for a single function:

ReturnCode arduiDisplayFillRect(uint16_t x1,
uint16_t y1,
uint16_t x2,
uint16_t y2,
uint32_t color) {
// This will depend on your display library
tft.fillRect(x1, y1, x2, y2, tft.color565(color));
return OK;
}

The exact function for your display might be different but most display libraries have methods for drawing text, rectangles, triangles, and more so you just have to find the matching function and test that it works. You can do this by including a llpi.h file in your main program and manually calling those functions to see if they work correctly:

#include <Arduino.h>
#include <llpi.h>
void setup() {
arduiDisplayFillRect(0, 0, 100, 100, 0);
}
void loop() {
}

Once you complete these functions, ardUI will start drawing on your display! If you want to test ardUI without going through this process, you can enable verbose mode in ardUI settings (found in ardUI_config.h file) and watch the draw calls in your serial monitor. This will not, however, draw anything on the screen.

On this page