WebbotLib AVR library
WebbotLib It just does it
  C++ documentation  C documentation

FourD/ser4D.h

Adds support for serial graphic displays from 4D Systems.
Note that these devices require the SGC firmware to be programmed into the display so that it can be controlled via software. You may be able to order them with this already done - but if not then you will need to follow the instructions on their website.
Not all of the functionality of these devices has been made available in WebbotLib yet - notably the use of the SD card to display images and play audio and video, and the touch screen abilities.
The 4D Systems displays are either based on the GOLDELOX chip or the more powerful PICASO. This is the only thing you need to know when using WebbotLib because it can discover information like the screen resolution at runtime by asking the display.
As a graphical display it supports the function in _gdisplay_common.h but it can also be used as a plain vanilla text display because it also supports the functions in _display_common.h. Consequently it can be used as a print destination to send streams of text.
4duLCD-32PT.jpg
Model shown: µLCD-32PT © 4D Systems.

 

Function

 


GENERIC_4D_DISPLAY MAKE_GOLDELOX(uart, baud, reset, writer)

Creates a display based on the 'GOLDELOX' chip.
'uart' - is the UART you are using to talk to the display. I don't recommend using a software UART as the communication speed is too slow.
'baud' - is the baud rate you want to use. 115,200 seems to work fine,
'reset' - is the IO pin connected to the 'RESET' pin on the graphics card.
'writer' - is the Writer function you have created to send characters to the display.
If you are using Project Designer then it does all of this for you - but if you are still doing it by hand then here is an example:-
// Create a forward reference to the writer
static MAKE_WRITER(display_put_char);
 
// Create the display on UART2 at 115,200 baud with A0 as RESET
GENERIC_4D_DISPLAY display = MAKE_GOLDELOX(UART2,115200,A0,&display_put_char);
 
// Now define the writer for real
static MAKE_WRITER(display_put_char){
    return displaySendByte(&display,byte);
}
You can the send rprintf output to the display using:-
rprintfInit(displayGetWriter(&display));

GENERIC_4D_DISPLAY MAKE_PICASO(uart, baud, reset, writer)

Creates a display based on the 'PICASO' chip.
'uart' - is the UART you are using to talk to the display. I don't recommend using a software UART as the communication speed is too slow.
'baud' - is the baud rate you want to use. 115,200 seems to work fine,
'reset' - is the IO pin connected to the 'RESET' pin on the graphics card.
'writer' - is the Writer function you have created to send characters to the display.
If you are using Project Designer then it does all of this for you - but if you are still doing it by hand then here is an example:-
// Create a forward reference to the writer
static MAKE_WRITER(display_put_char);
 
// Create the display on UART2 at 115,200 baud with A0 as RESET
GENERIC_4D_DISPLAY display = MAKE_PICASO(UART2,115200,A0,&display_put_char);
 
// Now define the writer for real
static MAKE_WRITER(display_put_char){
    return displaySendByte(&display,byte);
}
You can the send rprintf output to the display using:-
rprintfInit(displayGetWriter(&display));

Valid XHTML 1.0 Transitional