LCDproc development and user support list

Text archives Help

[Lcdproc] questions about required API functions in a new driver

Chronological Thread 
  • From: joris AT (Joris Robijn)
  • Subject: [Lcdproc] questions about required API functions in a new driver
  • Date: Sat Mar 19 17:54:01 2005

Hi Lucian,

> MODULE_EXPORT void glcdlib_set_char (Driver *drvthis, int n, char *dat);
> Is this one needed for other things than driver-internal stuff like

I don't know if it is actually called by the server (do a grep). But
there have been many request to support filling custom chars. At the time
we had decided that the client was responsible for filling custom
characters properly, as LCDproc is and should be character based. A
client could request the size (of the primary driver) and the number of
available custom chars, but the server would not support it in an other
way than to "pass on" the calls (coming in as widget commands). Icons
were meant as standardized char-based things that each driver could

> MODULE_EXPORT char * glcdlib_get_info (Driver *drvthis);
> Is this used for something?

MtxOrb.c says:
Returns string with general information about the display
I don't think it is used.

> MODULE_EXPORT char glcdlib_getkey (Driver *drvthis);
> My display has no keys, and I do not know about others supported by

Then don't define this function.

> Others like cursor or heartbeat are handled by the server core via my own
> implementation of glcdlib_icon(..).

Many functions are not required to be defined. Some functions have a
standard simple replacement in the server. I think this is explained in
the documentation.

> What about backlight/brightness/contrast stuff? I only found that there is
> actually one function drivers_backlight( int brightness ) in drivers.c
> which calls the _backlight( int on) function of dthe actual drivers if
> they implement it. What confuses me, is that the argument is called
> brightness (suggests a quantization), but is used as some kind of

This is wrong. lcd.h defines:
/* Hardware functions */
int (*get_contrast) (struct lcd_logical_driver* drvthis);
void (*set_contrast) (struct lcd_logical_driver* drvthis, int
int (*get_brightness) (struct lcd_logical_driver* drvthis, int
void (*set_brightness) (struct lcd_logical_driver* drvthis, int state,
int promille);
void (*backlight) (struct lcd_logical_driver* drvthis, int on);
void (*output) (struct lcd_logical_driver* drvthis, int

backlight() set the backlight state to on or off. The brightness for
backlight states on and off can individually be set with set_brightness.
Maybe parameter "on" should be called "state".

> on/off/blink state in some drivers and in render.c, and on the oher hand
> some of the drivers even implement such a function for contrast, which is
> not part of the API. Graphlcd-base implements in it's API a brightness
> (int percent) method,

This is not the right name and parameters. lcd.h defines the functions. I
think brightness(int percent) is a 0.4 call.

> sould I implement 2 different values of *brightness* as on/off states for
> the LCDproc-backlight, and even some kind of blinking (maybe through
> inversion)?

Blinking is done by the server. Driver only knows on and off.

> Actually, glcdlib_set_char(...) is the one I'm concearned of most, but if
> my assumptions are right, it's not necessary to export it in my case.


Joris Robijn
<joris AT>
Mobile: +31 6 288 41 964

// To understand recursion, we must first understand recursion

Archive powered by MHonArc 2.6.18.

Top of page