Sunday, April 9, 2023

Modifying the Waveshare demo code to use for my GUI

THE LCD MODULE IS SOLD BY WAVESHARE, COMES WITH EXAMPLE CODE

When I bought the module that provides the 3" x 5" color LCD screen with its integrated touch system, it came with example code in C and Python for the processor board they designed for, as well as a way to fit it to Arduino. What they developed was very specific to the Pico (and Arduino) but I can modify it to leverage the library code for my user interface.

This code has routines to draw various geometric figures, characters and to identify the location of a touch on the screen. It also provides a routine to calibrate the touch positioning of the screen, saving those values for future use. There is quite a bit I don't need to use as well - drivers for an SD Card device on the module to allow it to display a bitmap image stored on an SD card, with all the FAT file system and other logic required to do that. 

CONVERTING FROM RASPBERRY PI PICO TO CYCLONE V ARM LINUX

The conversion consists of a few broad categories of work:

  1. Convert the hardware specific access to SPI and the GPIO pins to Cyclone memory mapping
  2. Adjust the header files to match those on the Yocto Linux system
  3. Remove the code that reads the SD Card and displays an image
  4. Resolving any incompatible library or system calls
  5. Integrating the interrupt from the touch device rather than polling as their code does


No comments:

Post a Comment