From: Michael R. <re...@eu...> - 2004-08-29 13:23:31
|
Hi Joco, I'm CC'ing this to the list, as maybe other developers may be interested, too... We should continue our discussion on the list! First for the good news: I just added your driver to CVS and checked everything in! (Hey! something is going on with LCD4Linux again!) Could you please thest the driver? >>>I'm used network control(and only localhost) only for command leds because >>>the port is write-only and can't control outside lcdprogram or >>>rewerse,the lcd4l store the port status! >> >>I didn't really understand that part. Are there any leds? Maybe they >>sould be implemented as GPO's... > > Yes 4 leds, 2 green 2 red and unfortunatelly use the same port with lcd > and more, its only write, i not implemented as GPO-s because i did't > understand the GPO-s. :( Ok, and after having a closer look into your driver, I think I understood your LED approach :-) > If you explain i rewrite the code, the questios is: > -can define a timer for update? (maybe somebody want to be faster update > example if using for transfer, ide-leds etc, others maybe for > rarelly changed data) > -from where get the led status externally? > or we can add GPO control from socket! GPO's are "general purpose outputs", which means there is one or more pins where one can connect a LED, a beeper, a relais, or something else. LCD4Linux has had GPO support from the beginning (because my first display, a MatrixOrbital, had one such GPO output). The current CVS version lacks GPO support, because the internal framework is not yet present. This is another story for 0.10.1 At the moment I think GPO's will be implemented the following way: If a driver wants to provide one or more GPO's, it will register a function to the evaluator. This function may be called "GPO (num, state)", where num is the output number, and state may be 0 or 1 (if binary) or any other useful range (0..255, some display have an analog output, or a PWM output) The GPO will never be adressed directly from lcd4linux, but from an event handler specified in the config file (you remember, events is another thing for 0.10.1), There maybe events triggered by a keypad, triggered by some sort of "sensors" (not shure about this one), and, of course, timer events. This timer event may have a configurable frequency, which answers your question #1. The handler for this event would call the GPO() function, with the "state" gathered from any of the functions lcd4linux provides. There will be no special "socket interface" for GPO's, but maybe a more general plugin for sockets, so one can use a socket as a data source for everything, not only GPO's. You should probably modify your driver, throw away all the socket and LED stuff, but keep the RP_Leds variable (maybe rename it to "GPO" or something just like in the other drivers). As soon as GPO support will be there, I will browse through all drivers and add the GPO plugin. Another thing: the RouterBoard LCD Header is capable of controlling the backlight, right? That's what the LCD_BACKLIGHT=0x0800 is about? At the moment, you have the backlight hardcoded/hardwired to "on". You should make this one configurable! Have a look at the BeckmannEgle driver how to do so. The "initial" backlight state should be read from the config file, and the driver should register a function which allows querying and setting the backlight. Thanks a lot for your contribution! bye, Michael -- Michael Reinelt ICQ #288386781 e-mail: re...@eu... Tel: +43 676 3079941 Geisslergasse 4, A-8045 Graz, Austria GPG/PGP-Key: 0xDF13BA50 |