Page 1 of 1

4Dsystem display library

Posted: Wed Jan 26, 2022 9:15 am
by alex31
Hello,

We use 4DSystem serial display, mainly for educational purpose.
There is a vast family of these, with 3 types of processor (goldelox, picaso, diablo16), oled or lcd, in many dimension, touch enabled or not.

Each family has his own command set, so we made a library to abstract the processor type, and made portage between family easier.

First job was to list all functions for all families, which is resumed in the csv file https://github.com/alex31/chibios_enac_various_common/blob/master/TOOLS/fonctions%204dsystem%20SPE.csv

Then, a script https://github.com/alex31/chibios_enac_various_common/blob/master/TOOLS/gen4DSysLib.pl generates the low level library : files display4DS_ll.c/h.

A higher level library, which use the low level one, is also provided : display4DS.c/h.

Theses library can use serial or uart driver, choice has to be done at compile time. When graphic primitives or bitmap are sent, using uart (dma) driver save mcu cycles.

All can be find in this repository https://github.com/alex31/chibios_enac_various_common/ (which is a big mess ...) in the display4DS* files.

If you plan to use 4D system screen, this project can be a help for you at different level : You can use the csv file if you plan to write your own code generator, you can use the csv file and modify the code generator for your own use, you can only use the low level stuff, or use the code as is.

I can send example of use if needed.

Alexandre

Re: 4Dsystem display library

Posted: Wed Jan 26, 2022 7:26 pm
by Giovanni
Hi Alex,

If you want you can post full examples or snippets, thanks for sharing.

Giovanni

Re: 4Dsystem display library

Posted: Thu Jan 27, 2022 11:39 am
by alex31
Hi, Giovanni,

You are right : let's start with a simple example, 95% of the time we just output text on these screen, but we also have students who made complete gui with button, menu, tabs, etc.

A project will begin soon with students to design a CO2 room detector, fusionning data from NDIR and MoX sensor, and displaying on a large screen current Co2, level, histogram, alarms, etc.

That is a minimal example which show how it works using the small oled display fitted on our pedagogical devboard.

Code: Select all

 FdsConfig fds;
 // initialize the screen
 fdsStart(&fds, &SD6, 115200, LINE_C13_RESET_OLED, GOLDELOX);
 
 fdsPrintFmt(&fds,
         "\en  embedded\en"
         "  world\en"
         "  would be\en"
         "  boring\en"
         "  without\en");
  txt_fgColour(&fds, fds_colorDecTo16b(100, 0, 0), NULL);
  fdsPrintFmt(&fds,
         "  ChibiOS"
         );
  gfx_rectangle(&fds, 0, 0, 95, 63, fds_colorDecTo16b(0, 0, 100));
 



link to result :
https://photos.app.goo.gl/nt6t9MJUndV11r7E8

the fdsxxx functions are in the high level API, the txt_xxx, gfx_xxx etc API are in the low level API and the names are 1:1 the one found in the 4DSystem reference manual.

Alexandre

Re: 4Dsystem display library

Posted: Thu Feb 17, 2022 11:10 am
by fOrisca
It's a great result.