The init() function.
It starts up the LCD, initializes all variables, allocates private data space
and stores the pointer by calling store_private_ptr();
Shut down the connection with the LCD.
Called just before unloading the driver.
Get the screen width in characters.
The result is 1-based.
Get the screen height in character lines.
The result is 1-based.
Clear the framebuffer.
Flush the framebuffer to the LCD.
void (*string)( | drvthis, | |
| x, | |
| y, | |
| str) ; | |
Driver * | drvthis; |
int | x; |
int | y; |
char * | str; |
Place string str
into position
(x
,y
) in the framebuffer.
All coordinates are 1-based, i.e. (1,1) is top left.
The driver should check for overflows, i.e. that the positional parameters
are within the screen's boundaries and cut off the part of the string
that is out of bounds.
void (*chr)( | drvthis, | |
| x, | |
| y, | |
| c) ; | |
Driver * | drvthis; |
int | x; |
int | y; |
char | c; |
Place a single character c
into position
(x
,y
) in the framebuffer.
The driver should check for overflows, i.e. that the positional parameters
are within the screen's boundaries and ignore the request if
the character is out of bounds.
void (*vbar)( | drvthis, | |
| x, | |
| y, | |
| len, | |
| promille, | |
| options) ; | |
Driver * | drvthis; |
int | x; |
int | y; |
int | len; |
int | promille; |
int | options; |
Draw a vertical bar at position (x
,y
)
that has maximal length len
, where a fraction of
(promille
/ 1000) is filled.
void (*hbar)( | drvthis, | |
| x, | |
| y, | |
| len, | |
| promille, | |
| options) ; | |
Driver * | drvthis; |
int | x; |
int | y; |
int | len; |
int | promille; |
int | options; |
Draw a horizontal bar at position (x
,y
)
that has maximal length len
, where a fraction of
(promille
/ 1000) is filled.
void (*num)( | drvthis, | |
| x, | |
| num) ; | |
Driver * | drvthis; |
int | x; |
int | num; |
Display big number num
at horizontal position x
.
void (*heartbeat)( | drvthis, | |
| state) ; | |
Driver * | drvthis; |
int | state; |
Sets the heartbeat to the indicated state: 0=off 1=graph1 2=graph2
HEARTBEAT_ON to say that we want to display/refresh the heartbeat.
The driver choose how to do it. See MtxOrb.c
void (*icon)( | drvthis, | |
| x, | |
| y, | |
| icon) ; | |
Driver * | drvthis; |
int | x; |
int | y; |
int | icon; |
Draw named icon icon
at position
(x
,y
).
void (*cursor)( | drvthis, | |
| x, | |
| y, | |
| type) ; | |
Driver * | drvthis; |
int | x; |
int | y; |
int | type; |
Move cursor to position (x
,y
),
setting its type to type
.
void (*set_char)( | drvthis, | |
| ch, | |
| dat) ; | |
Driver * | drvthis; |
char | ch; |
unsigned char * | dat; |
The set_char function expects a simple block of data with 1 byte for each pixel-line.
(So that is 8 bytes for a 5x8 char)
int (*get_free_chars)( | drvthis) ; | |
int (*cellwidth)( | drvthis) ; | |
Return the width of a character cell in pixels.
The result is 1-based.
int (*cellheight)( | drvthis) ; | |
Return the height of a character cell in pixels.
The result is 1-based.
int (*get_contrast)( | drvthis) ; | |
Get the contrast value from the driver.
The return value is an integer in the range from 0 to 1000.
Many displays do not support getting or setting contrast using software.
int (*set_contrast)( | drvthis, | |
| promille) ; | |
Driver * | drvthis; |
int | promille; |
Sets the contrast to the given value, which is an integer in the range from 0 to 1000.
It is up to the driver to map the logical interval [0, 1000] into the
interval that the hardware supports.
Many displays do not support software setting of contrast.
int (*get_brightness)( | drvthis, | |
| state) ; | |
Driver * | drvthis; |
int | state; |
Get the brightness value from the driver for the given backlight state.
The parameter state
determnies which one
is returned.
The return value is an integer in the range from 0 to 1000.
Many displays do not support getting or setting brightness using software.
int (*set_brightness)( | drvthis, | |
| state, | |
| promille) ; | |
Driver * | drvthis; |
int | state; |
int | promille; |
Set the brightness for the given backlight state to the value given.
Value must be an integer in the range from 0 to 1000.
It is up to the driver to map the logical interval [0, 1000] into the
interval that the hardware supports.
Many displays do not support software setting of brightness.
void (*backlight)( | drvthis, | |
| state) ; | |
Driver * | drvthis; |
int | state; |
Sets the backlight to the given brightness state.
Often hardware can only support two values for the backlight:
on and off.
In that case any value of state > 0 will switch the backlight on.
void (*output)( | drvthis, | |
| state) ; | |
Driver * | drvthis; |
int | state; |
Sets the output value. Some displays/wirings have a general purpose
output, which can be controlled by calling this function. See the
'output' command in the 'widget language'.
const char *(*get_key)( | drvthis) ; | |
Checks if a key has been pressed on the device.
Returns NULL for "no key pressed", or a string describing the pressd key.
These characters should match the keypad-layout.
const char *(*get_info)( | drvthis) ; | |
Returns a string describing the driver and its features.
char (*config_get_bool)( | sectionname, | |
| keyname, | |
| skip, | |
| default_value) ; | |
char * | sectionname; |
char * | keyname; |
int | skip; |
char | default_value; |
Call to server. Retrieve a bool from the config file.
Sectionname should be the name of the driver (as in the struct).
If the key cannot be found, the default value will be returned.
skip should be 0 usually, but if you want to retrieve multiple
identical keys, then increase skip to get every next value.
int (*config_get_int)( | sectionname, | |
| keyname, | |
| skip, | |
| default_value) ; | |
char * | sectionname; |
char * | keyname; |
int | skip; |
int | default_value; |
Call to server. Retrieve an integer from the config file.
double (*config_get_float)( | sectionname, | |
| keyname, | |
| skip, | |
| default_value) ; | |
char * | sectionname; |
char * | keyname; |
int | skip; |
double | default_value; |
Call to server. Retrieve a float from the config file.
char *(*config_get_string)( | sectionname, | |
| keyname, | |
| skip, | |
| default) ; | |
char * | sectionname; |
char * | keyname; |
int | skip; |
char * | default; |
Call to server. Retrieve a string from the config file.
Fill result with a pointer to some available space. You can fill it
with a default value. If the key is found, it will be overwritten
with the value from the key.
Note that you should always first copy the the returned string.
It is in the address space of the server, and will be freed at the
next call.
int config_has_section( | sectionname) ; | |
Returns wether a section exists. Does not need to be called prior
to a call to a config_get_* function.
int config_has_key( | sectionname, | |
| keyname) ; | |
char * | sectionname; |
char * | keyname; |
Returns the number of times a key exists. Does not need to be called
prior to a call to a config_get_* function.
First version, Joris Robijn, 20011016