You can subscribe to this list here.
2004 |
Jan
(57) |
Feb
(71) |
Mar
(80) |
Apr
(40) |
May
(49) |
Jun
(20) |
Jul
(3) |
Aug
(9) |
Sep
(8) |
Oct
(2) |
Nov
|
Dec
(11) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(10) |
Feb
(25) |
Mar
(24) |
Apr
(26) |
May
(71) |
Jun
(35) |
Jul
(5) |
Aug
(3) |
Sep
(18) |
Oct
(4) |
Nov
(5) |
Dec
(2) |
2006 |
Jan
(50) |
Feb
(12) |
Mar
(7) |
Apr
(24) |
May
(1) |
Jun
(17) |
Jul
(51) |
Aug
(38) |
Sep
(38) |
Oct
(33) |
Nov
(8) |
Dec
(13) |
2007 |
Jan
(44) |
Feb
(25) |
Mar
(21) |
Apr
(68) |
May
(52) |
Jun
(24) |
Jul
(17) |
Aug
(12) |
Sep
(4) |
Oct
(14) |
Nov
(1) |
Dec
(3) |
2008 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(5) |
Oct
(5) |
Nov
(1) |
Dec
|
2009 |
Jan
(4) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(21) |
Jun
(5) |
Jul
|
Aug
|
Sep
(4) |
Oct
(1) |
Nov
|
Dec
|
2010 |
Jan
(15) |
Feb
(36) |
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(3) |
Aug
|
Sep
(2) |
Oct
|
Nov
(1) |
Dec
(3) |
2011 |
Jan
(22) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(25) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2012 |
Jan
(14) |
Feb
(6) |
Mar
(20) |
Apr
(12) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(2) |
Dec
|
2013 |
Jan
|
Feb
(3) |
Mar
(2) |
Apr
(1) |
May
(9) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
2014 |
Jan
(1) |
Feb
(1) |
Mar
(3) |
Apr
(2) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
(11) |
Jul
(1) |
Aug
(3) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: David B. <dc...@ho...> - 2018-02-20 09:48:15
|
Hello there, widget_text.c:293:32: warning: logical 'or' of collectively exhaustive tests is always true [-Wlogical-op] Source code is if (T->align != ALIGN_MARQUEE || T->align != ALIGN_AUTOMATIC || T->align != ALIGN_PINGPONG_LEFT || T->align != ALIGN_PINGPONG_CENTER || T->align != ALIGN_PINGPONG_RIGHT) { Suggest code rework. Regards David Binderman |
From: Alexei <kp1...@gm...> - 2016-01-17 16:49:06
|
Hello. This patch (diff file attached) I'm proposing adds a new function proc_stat::core(), which allows monitoring stats for each individual processor/core in the multiprocessor/multicore system (/proc/stat lines "cpu0"..."cpun"), as opposed to total aggregated stats (/proc/stat "cpu" line) with proc_stat::cpu(). Function takes 3 arguments: proc_stat::core(core, key, delay) Where: core - core number/index; key - which stat to get; delay - delta time period in milliseconds. Key and delay are the same arguments just like in proc_stat::cpu(). Output format is also the same as in proc_stat::cpu(). Regards, Alexei Gordeev ========== P.S. Sorry for the double post. I'm not sure if the previous email is readable, but it shows up as empty in sourceforge archive. Thunderbird messed something up with HTML formatting it seems, and this one should be plaintext and readable now. |
From: Alexei <kp1...@gm...> - 2016-01-17 16:28:05
|
Hello. This patch (diff file attached) I'm proposing adds a new function proc_stat::core(), which allows monitoring stats for each individual processor/core in the multiprocessor/multicore system (/proc/stat lines "cpu0"..."cpun"), as opposed to total aggregated stats (/proc/stat "cpu" line) with proc_stat::cpu(). Function takes 3 arguments: proc_stat::core(core, key, delay) Where: core - core number/index; key - which stat to get; delay - delta time period in milliseconds. Key and delay are the same arguments just like in proc_stat::cpu(). Output format is also the same as in proc_stat::cpu(). Regards, Alexei Gordeev |
From: Marcus M. <cod...@gm...> - 2015-11-01 17:51:50
|
Hello, let me offer some new features (diff file attached) for LCD4Linux. Table of content: 1. Summary 2. New plugins / drivers 2.1 Plugin Layout 2.2 Plugin Menu 2.3 Plugin Control 2.4 Plugin Run 2.5 Plugin List 2.6 Driver FutabaVFD 3. Comments on the diff file 4. Open issues 4.1 Wiki 4.2 External Controller 4.3 Init and coupling of plugin Layout & Menu: 4.4 Limited widget number 4.5 Test and code review 1. Summary ========== The modifications (status: proof of concept) are mainly written to achive the following goals: 1. switch layouts while runtime 2. create menu controls 3. enable external controls like buttons, scripts, LED 4. start external scripts menu controlled Most of these features are encapsulated in plugins. So the use is optional and the risk of screwing up running code is lower. But some fixes and modifications on the existing sources had to be done too (see 3.). 2. New plugins /drivers ======================= A wiki entry was created for each new plugin. But these entries have not been linked in the plugin summary entry yet. CAUTION: Since I wasn't able to modify wiki attachments some of the older ones may contain erros. So please don't use attachments that were not linked in the text of the wiki entry. 2.1 Plugin Layout ----------------- See: https://lcd4linux.bulix.org/wiki/plugin_layout The Plugin "Layout" makes it possible to switch between different layouts while runtime and create simple menus. The switching may be triggered by the Timer Widget, Keypad Widget or external controllers by using the Control plugin (2.3). 2.2 Plugin Menu --------------- See: https://lcd4linux.bulix.org/wiki/plugin_menu The plugin Menu allows to configure and use more complex menus. 2.3 Plugin Control ------------------ See: https://lcd4linux.bulix.org/wiki/plugin_control The Plugin Control makes it possible to use inputs (buttons, FIFOs, ...) and outputs (LED, ...) of different resources (usb mouse, serial port, ...) within LCD4Linux. External executables (controllers) are started to control these resources. Some example programs (serial port, usb mouse, fifo) are linked in the wiki entry. 2.4 Plugin Run --------------- See: https://lcd4linux.bulix.org/wiki/plugin_run Plugin Run supplies a way to start & kill executables. 2.5 Plugin List --------------- See: https://lcd4linux.bulix.org/wiki/plugin_list Plugin List allows to configure lists that can be modified while runtime. This can be used to make selections or log entries. 2.6 FutabaVFD ------------- See: https://lcd4linux.bulix.org/wiki/FutabaVFD The driver is not new but was rebuilt nearly from scratch. A wiki entry was added. 3. Comments on the diff file ============================ action.c/h: Actions are used by the plugins Layout and Menu and by the Futaba driver. Have a look at the wiki entries. cfg.c/h: Three functions were added to make the reading od the config more easy. drv_Curses.c: The function 'strpbrk' can't be used here because 'data' is NOT a '\0' terminated string. drv_FutabaVFD.c: rebuilt driver drv_generic_parport.c/h: The added fuction drv_generic_parport_hardwire_status is used by the FutabaVFD driver. drv_generic_text.c/h: A function to clear the display was added. (switch layouts) evaluator.c: Avoid a memory leak. plugin_control.c, plugin_layout.c, plugin_list.c, plugin_menu.c, plugin_run.c: new plugins plugin_math.c: Random function added. (nice for testing) plugin_string.c: Function 'charset' added to provide a easy way to show display specific chars. timer.c/h: typedef moved to header because type is used in plugin_layout.c too. 1 bug fixed. timer_group.c/h: Typedef moved to header because type is used in plugin_layout.c too. 1 bug fixed. widget_image.c: Function 'widget_image_update' was set non static to be useable in plugin_layout.c. widget_keypad.c: Avoid memory leaks. 4. Open issues ============== 4.1 Wiki -------- As mentioned above (2.) I've seen no way to remove/modify faulty wiki attachments. Wiki entries have been created. Modifications to be done after the code changes are checked in: - summary displays (FutabaVFD) - summary plugins (Control, Layout, List, Menu, Run) - update Math (rand) and String (charset) plugin entries 4.2 External Controller ----------------------- Since the Control plugin makes use of external programs (see wiki) it has to be decided how to provide this programs. (Subfolder in lcd4linux vs. external project - e.g. github) At the moment the three controllers which were made for testing or personal use are provided via github and discribed in the LCD4Linux wiki. (For links see 2.3) 4.3 Init and coupling of plugin Layout & Menu: ---------------------------------------------- Plugins are initiated before widget classes. But during the init of plugin Layout this widget classes are needed. So the init of plugin layout is done later by a timer callback. Plugin Menu depends on plugin Layout. So its init will be called from plugin Layout a second time (real init). Beside this the two plugins call functions of each other (not loosely coupled). 4.4 Limited widget number ------------------------- The maximum number of widgets is set to 256 (MAX_WIDGETS in widget.c). This might get a problem with big menues and multiple layouts. (Using some widgets in multiple layouts won't help because such a widget will be stored multiple times.) 4.5 Test and code review ------------------------ The plugins has been tested in text mode with the displays Curses and FutabaVFD. They should be tested with graphical displays, user defined chars, icons, images and layer too. Code reviews and comments are greatly appreciated. Thanks for reading. Regards Marcus Menzel |
From: Matt J. <mat...@gm...> - 2015-08-21 10:18:31
|
My sample config does not have the file plugin shown. I'm probably using an old version of LCD4Linux because I added support for my LCD. I offered a patch a while ago, do you know if it was included? http://sourceforge.net/p/lcd4linux/mailman/message/26137502/ Regards Matt On Wed, Aug 12, 2015 at 10:12 PM, Marcus Menzel <mar...@gm...> wrote: > Hello Matt, > > I see no way to achieve this in the config. > But you may use plugin "File" if you can get the informations into normal > files. > > Regards > > Marcus > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Lcd4linux-devel mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > > -- +61 468 335597 *LinkedIn Profile : Matt Joyce <http://au.linkedin.com/pub/matthew-joyce/6/4b5/6a4/>* |
From: Marcus M. <mar...@gm...> - 2015-08-12 12:12:36
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hello Matt,</div> <div> </div> <div>I see no way to achieve this in the config.</div> <div>But you may use plugin "File" if you can get the informations into normal files.</div> <div> </div> <div>Regards</div> <div> </div> <div>Marcus</div> </div></div></body></html> |
From: Matt J. <mat...@gm...> - 2015-08-09 10:34:24
|
Hello, I can someone tell me how to configure lcd4linux to have multiple FIFO setup? Regards Matt |
From: Praveen r. M. <pra...@gm...> - 2015-07-15 14:41:31
|
Hi, I am newbie to this forum. i would like to interface 128X64 GLCD(ST7565 controller 8 bit parallel interface) to ARM9 CPU in linux. i have two questions 1.How to cross compile the LCD4Linux to ARM9 2.Is there any graphic LCD driver in LCD4LINUX supporting 128X64 GLCD ? your reply will be appreciated. Thank you in advance Regards, Praveen |
From: Roman V. N. <rs...@ra...> - 2015-06-29 23:30:16
|
I lost my password. Please unsubscribe me. |
From: Marcus M. <cod...@gm...> - 2015-06-28 22:21:03
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hello Michael,</div> <div> </div> <div>thanks for your help. As you assumed I forgot the ./bootstrap.</div> <div> </div> <div>for (int i = 0; i < 100; i++) printf("I must read the Howto more carefully.\n");</div> <div> </div> <div>Now it works . Thank you very much.</div> <div> </div> <div>Regards</div> <div> </div> <div>Marcus</div> <div> </div> <div> <div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"> <div style="margin:0 0 10px 0;"><b>Gesendet:</b> Sonntag, 28. Juni 2015 um 12:56 Uhr<br/> <b>Von:</b> "Michael Reinelt" <mi...@re...><br/> <b>An:</b> "Marcus Menzel" <cod...@gm...>, lcd...@li...<br/> <b>Betreff:</b> Re: [Lcd4linux-devel] missing file/dir</div> <div name="quoted-content">Hello Marcus,<br/> <br/> did you try ./bootstrap ?<br/> <br/> autoconf (or auto*) is still a piece of hell, or I completely misunderstand something...</div> </div> </div> </div></div></body></html> |
From: Michael R. <mi...@re...> - 2015-06-28 10:58:06
|
Hello Marcus, did you try ./bootstrap ? autoconf (or auto*) is still a piece of hell, or I completely misunderstand something... Am 2015-06-28 um 12:32 schrieb Marcus Menzel: > Hello, > today I fetch the current sources with > > svn co https://ssl.bulix.org/svn/lcd4linux/trunk lcd4linux > > "./configure" seems to work but "make" shows some problems: > CDPATH="${ZSH_VERSION+.}:" && cd . && aclocal-1.14 -I m4 > aclocal-1.14: warning: couldn't open directory 'm4': No such file or directory > cd . && automake-1.14 --gnu > Makefile.am:16: error: required file './ltmain.sh' not found > make: *** [Makefile.in] Error 1 > In old copies I fount the missing dir and file but it seems to be an older version. > Regards > Marcus > > > ------------------------------------------------------------------------------ > Monitor 25 network devices or servers for free with OpManager! > OpManager is web-based network management software that monitors > network devices and physical & virtual servers, alerts via email & sms > for fault. Monitor 25 devices for free with no restriction. Download now > http://ad.doubleclick.net/ddm/clk/292181274;119417398;o > > > > _______________________________________________ > Lcd4linux-devel mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > -- Michael Reinelt <mi...@re...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |
From: Marcus M. <cod...@gm...> - 2015-06-28 10:32:39
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hello,</div> <div> </div> <div>today I fetch the current sources with</div> <div> <pre class="wiki">svn co https://ssl.bulix.org/svn/lcd4linux/trunk lcd4linux</pre> <div>"./configure" seems to work but "make" shows some problems:</div> <div> </div> </div> <div class="signature"> </div> <div>CDPATH="${ZSH_VERSION+.}:" && cd . && aclocal-1.14 -I m4<br/> aclocal-1.14: warning: couldn't open directory 'm4': No such file or directory<br/> cd . && automake-1.14 --gnu<br/> Makefile.am:16: error: required file './ltmain.sh' not found<br/> make: *** [Makefile.in] Error 1</div> <div> </div> <div>In old copies I fount the missing dir and file but it seems to be an older version.</div> <div> </div> <div>Regards</div> <div> </div> <div>Marcus</div></div></body></html> |
From: Marcus M. <mar...@gm...> - 2015-06-26 21:36:06
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div> <div>Hello Michael, hello Matt,</div> <div> </div> <div>even if "offline can be avoided" I'd feel more comfortable with a copy of the source (done) and docs to easily understand it.</div> <div>But I agree to Matt that this doesn't justify "significant work".</div> <div> </div> <div>I thought there'd be a simple html export possibility.<br/> If there isn't - don't waste time for a big solution of a small problem - especially in the summer time.</div> <div> </div> <div>Regards</div> <div> </div> <div>Marcus</div> </div></div></body></html> |
From: Matt J. <mat...@gm...> - 2015-06-26 04:16:51
|
Before taking on any significant work to provide an offline copy, perhaps estimate how much need there is. If you know the typical monthly page views, and know the typical minutes of outage each month, you could calculate the estimated impact. >From there you can set a threshold, and if that threshold is exceeded frequently, this conversation will be more useful. Here's a couple of options: - Move to a service that has better uptime - Somehow package up the wiki, and ask for users to seed it as a torrent (I would) - Use multiple services Personally, I think an offline copy is treating a symptom, not the root cause. This is 2015, offline can be avoided. BTW - I was playing with a Raspberry Pi this week and was able to get my 4x20 LCD up and running in about 20 mins with LCD4LINUX. Good job. I submitted a patch years ago, I don;t think it was ever incorporated, for a SURE LD023 lcd. On Fri, Jun 26, 2015 at 12:24 PM, Michael Reinelt <mi...@re...> wrote: > Hi Marcus, > > > unfortunately the site http://lcd4linux.bulix.org is broken at the > moment. > Thanks, Max has already been informed. Looks there is some maintenance... > > > Since this happens now and then (no reproach to a voluntary > project/service) > > I wonder whether a offline version of the docs would be good idea. > > This might not be most up to date but enough to sucessfully configure or > develop > > lcd4linux while the website is down or you lack internet access. > > The docs should be (optionally) delivered with the program/sources (svn). > > So you already have a offline copy in case the website goes down. > > The offline htmls may have a link to the online version of the docs. > > Basically a good idea; the problem is that the whole doc is based on the > wiki, and I dont have a idea how to export it > into some kind of "offline format" > > Ideas welcome :-) > > > regards, Michael > > > -- > Michael Reinelt <mi...@re...> > http://home.pages.at/reinelt > GPG-Key 0xDF13BA50 > ICQ #288386781 > > > ------------------------------------------------------------------------------ > Monitor 25 network devices or servers for free with OpManager! > OpManager is web-based network management software that monitors > network devices and physical & virtual servers, alerts via email & sms > for fault. Monitor 25 devices for free with no restriction. Download now > http://ad.doubleclick.net/ddm/clk/292181274;119417398;o > _______________________________________________ > Lcd4linux-devel mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > -- +61 468 335597 *LinkedIn Profile : Matt Joyce <http://au.linkedin.com/pub/matthew-joyce/6/4b5/6a4/>* |
From: Michael R. <mi...@re...> - 2015-06-26 02:24:54
|
Hi Marcus, > unfortunately the site http://lcd4linux.bulix.org is broken at the moment. Thanks, Max has already been informed. Looks there is some maintenance... > Since this happens now and then (no reproach to a voluntary project/service) > I wonder whether a offline version of the docs would be good idea. > This might not be most up to date but enough to sucessfully configure or develop > lcd4linux while the website is down or you lack internet access. > The docs should be (optionally) delivered with the program/sources (svn). > So you already have a offline copy in case the website goes down. > The offline htmls may have a link to the online version of the docs. Basically a good idea; the problem is that the whole doc is based on the wiki, and I dont have a idea how to export it into some kind of "offline format" Ideas welcome :-) regards, Michael -- Michael Reinelt <mi...@re...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |
From: Marcus M. <cod...@gm...> - 2015-06-25 11:51:37
|
<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div class="signature"> <div> <div>Hello,</div> <div> </div> <div>unfortunately the site http://lcd4linux.bulix.org is broken at the moment.</div> <div> </div> <div>Since this happens now and then (no reproach to a voluntary project/service)<br/> I wonder whether a offline version of the docs would be good idea.</div> <div> </div> <div>This might not be most up to date but enough to sucessfully configure or develop<br/> lcd4linux while the website is down or you lack internet access.</div> <div> </div> <div>The docs should be (optionally) delivered with the program/sources (svn).<br/> So you already have a offline copy in case the website goes down.</div> <div> </div> <div>The offline htmls may have a link to the online version of the docs.</div> <div> </div> <div>Just my suggestion</div> <div> </div> <div>Regards</div> <div> </div> <div>Marcus</div> </div> </div></div></body></html> |
From: Michael R. <mi...@re...> - 2015-06-18 17:12:12
|
Patch has been applied an checked in. Thanks a lot! Am 2015-06-18 um 18:00 schrieb Michael Grzeschik: > From: Michael Grzeschik <m.g...@pe...> > > This patch adds support for dual i2c io-expander > based 8bit support for HD44780. It multiplexes the > switch between the data and databits. > > Signed-off-by: Michael Grzeschik <m.g...@pe...> > --- > drv_HD44780.c | 82 ++++++++++++++++++++++++++++++++++++++----------------- > drv_generic_i2c.c | 65 +++++++++++++++++++++++++++++++++---------- > drv_generic_i2c.h | 2 +- > 3 files changed, 109 insertions(+), 40 deletions(-) > > diff --git a/drv_HD44780.c b/drv_HD44780.c > index 26f0bc9..7f4a56a 100644 > --- a/drv_HD44780.c > +++ b/drv_HD44780.c > @@ -706,10 +706,10 @@ static void drv_HD_PP_stop(void) > > */ > > -static void drv_HD_I2C_nibble(unsigned char controller, unsigned char nibble) > +static void drv_HD_I2C(unsigned char controller, unsigned char byte, int rs, int rw) > { > unsigned char enable; > - unsigned char command; /* this is actually the first data byte on the PCF8574 */ > + unsigned char command = 0; /* this is actually the first data byte on the PCF8574 */ > unsigned char data_block[2]; > /* enable signal: 'controller' is a bitmask */ > /* bit n .. send to controller #n */ > @@ -738,28 +738,51 @@ static void drv_HD_I2C_nibble(unsigned char controller, unsigned char nibble) > The main advantage we see is that we do 2 less IOCTL's from our driver. > */ > > - command = nibble; > - data_block[0] = nibble | enable; > - data_block[1] = nibble; > + if (Bits == 4) { > + if (rw) > + byte |= SIGNAL_RW; > + if (rs) > + byte |= SIGNAL_RS; > + command = byte; > + data_block[0] = byte | enable; > + data_block[1] = byte; > + > + } else if (Bits == 8) { > + if (rw) > + command |= SIGNAL_RW; > + if (rs) > + command |= SIGNAL_RS; > + > + data_block[0] = byte; > + data_block[1] = enable; > + } > > - drv_generic_i2c_command(command, data_block, 2); > + drv_generic_i2c_command(command, data_block, 2, Bits); > } > > > static void drv_HD_I2C_byte(const unsigned char controller, const unsigned char data) > { > /* send data with RS enabled */ > - drv_HD_I2C_nibble(controller, ((data >> 4) & 0x0f) | SIGNAL_RS); > - drv_HD_I2C_nibble(controller, (data & 0x0f) | SIGNAL_RS); > + if (Bits == 4) { > + drv_HD_I2C(controller, ((data >> 4) & 0x0f), 1, 0); > + drv_HD_I2C(controller, (data & 0x0f), 1, 0); > + } else if (Bits == 8) { > + drv_HD_I2C(controller, data, 1, 0); > + } > } > > > static void drv_HD_I2C_command(const unsigned char controller, const unsigned char cmd, __attribute__ ((unused)) > const unsigned long delay) > { > - /* send data with RS disabled */ > - drv_HD_I2C_nibble(controller, ((cmd >> 4) & 0x0f)); > - drv_HD_I2C_nibble(controller, ((cmd) & 0x0f)); > + /* send command data with RS disabled */ > + if (Bits == 4) { > + drv_HD_I2C(controller, ((cmd >> 4) & 0x0f), 0, 0); > + drv_HD_I2C(controller, ((cmd) & 0x0f), 0, 0); > + } else if (Bits == 8) { > + drv_HD_I2C(controller, cmd, 0, 0); > + } > } > > static void drv_HD_I2C_data(const unsigned char controller, const char *string, const int len, __attribute__ ((unused)) > @@ -781,13 +804,14 @@ static int drv_HD_I2C_load(const char *section) > { > if (cfg_number(section, "Bits", 8, 4, 8, &Bits) < 0) > return -1; > - if (Bits != 4) { > - error("%s: bad %s.Bits '%d' from %s, should be '4'", Name, section, Bits, cfg_source()); > - return -1; > - } > > info("%s: using %d bit mode", Name, Bits); > > + if (Bits != 4 && Bits != 8) { > + error("%s: bad %s.Bits '%d' from %s, should be '4' or '8'", Name, section, Bits, cfg_source()); > + return -1; > + } > + > if (drv_generic_i2c_open(section, Name) != 0) { > error("%s: could not initialize i2c attached device!", Name); > return -1; > @@ -804,16 +828,24 @@ static int drv_HD_I2C_load(const char *section) > if ((SIGNAL_GPO = drv_generic_i2c_wire("GPO", "GND")) == 0xff) > return -1; > > - /* initialize display */ > - drv_HD_I2C_nibble(allControllers, 0x03); > - udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ > - drv_HD_I2C_nibble(allControllers, 0x03); > - udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ > - drv_HD_I2C_nibble(allControllers, 0x03); > - udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ > - drv_HD_I2C_nibble(allControllers, 0x02); > - udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ > - drv_HD_I2C_command(allControllers, 0x28, T_EXEC); /* 4 Bit mode, 1/16 duty cycle, 5x8 font */ > + if (Bits == 4) { > + /* initialize display */ > + drv_HD_I2C(allControllers, 0x02, 0, 0); > + udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ > + drv_HD_I2C(allControllers, 0x03, 0, 0); > + udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ > + drv_HD_I2C(allControllers, 0x03, 0, 0); > + udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ > + drv_HD_I2C(allControllers, 0x02, 0, 0); > + udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ > + drv_HD_I2C_command(allControllers, 0x28, T_EXEC); /* 4 Bit mode, 1/16 duty cycle, 5x8 font */ > + } else if (Bits == 8) { > + drv_HD_I2C(allControllers, 0x30, 0, 0); /* 8 Bit mode, wait 4.1 ms */ > + udelay(T_INIT1); /* 8 Bit mode, wait 4.1 ms */ > + drv_HD_I2C(allControllers, 0x30, 0, 0); /* 8 Bit mode, wait 100 us */ > + udelay(T_INIT2); /* 8 Bit mode, wait 4.1 ms */ > + drv_HD_I2C_command(allControllers, 0x38, T_EXEC); /* 8 Bit mode, 1/16 duty cycle, 5x8 font */ > + } > > info("%s: I2C initialization done", Name); > > diff --git a/drv_generic_i2c.c b/drv_generic_i2c.c > index 2170b0c..1bee16f 100644 > --- a/drv_generic_i2c.c > +++ b/drv_generic_i2c.c > @@ -62,7 +62,8 @@ > static char *Driver = ""; > static char *Section = ""; > static int i2c_device; > - > +static int ctrldev; > +static int datadev; > > static void my_i2c_smbus_write_byte_data(const int device, const unsigned char val) > { > @@ -91,34 +92,49 @@ static void my_i2c_smbus_read_byte_data(const int device, const unsigned char da > } > #endif > > +int drv_generic_i2c_pre_write(int dev) { > + > + info("%s: selecting slave device 0x%x", Driver, dev); > + if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { > + error("%s: error selecting slave device 0x%x\n", Driver, dev); > + return -EPIPE; > + } > + > + info("%s: initializing I2C slave device 0x%x for output", Driver, dev); > + if (i2c_smbus_write_byte_data(i2c_device, 3, 0) < 0) { > + error("%s: error initializing device 0x%x\n", Driver, dev); > + close(i2c_device); > + } > + > + return 0; > +} > > int drv_generic_i2c_open(const char *section, const char *driver) > { > - int dev; > char *bus, *device; > udelay_init(); > Section = (char *) section; > Driver = (char *) driver; > bus = cfg_get(Section, "Port", NULL); > device = cfg_get(Section, "Device", NULL); > - dev = atoi(device); > + ctrldev = atoi(device); > + device = cfg_get(Section, "DDevice", NULL); > + datadev = atoi(device); > + > info("%s: initializing I2C bus %s", Driver, bus); > if ((i2c_device = open(bus, O_WRONLY)) < 0) { > error("%s: I2C bus %s open failed !\n", Driver, bus); > goto exit_error; > } > - info("%s: selecting slave device 0x%x", Driver, dev); > - if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { > - error("%s: error selecting slave device 0x%x\n", Driver, dev); > - goto exit_error; > - } > > - info("%s: initializing I2C slave device 0x%x", Driver, dev); > - if (i2c_smbus_write_quick(i2c_device, I2C_SMBUS_WRITE) < 0) { > - error("%s: error initializing device 0x%x\n", Driver, dev); > - close(i2c_device); > + if (datadev) { > + if (drv_generic_i2c_pre_write(datadev) < 0) > + goto exit_error; > } > > + if (drv_generic_i2c_pre_write(ctrldev) < 0) > + goto exit_error; > + > return 0; > > exit_error: > @@ -172,8 +188,29 @@ void drv_generic_i2c_data(const unsigned char data) > my_i2c_smbus_write_byte_data(i2c_device, data); > } > > +static void i2c_out(int dev, unsigned char val) > +{ > + info("%s: initializing I2C slave device 0x%x", Driver, dev); > + if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { > + error("%s: error selecting slave device 0x%x\n", Driver, dev); > + return; > + } > + > + i2c_smbus_write_byte_data(i2c_device, 1, val); > +} > > -void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length) > +void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length, int bits) > { > - i2c_smbus_write_block_data(i2c_device, command, length, data); > + if (bits == 4) { > + i2c_smbus_write_block_data(i2c_device, command, length, data); > + } else if (bits == 8 && datadev) { > + /* set data on pins */ > + info("cmd: %08x, data0: %08x, data1: %08x\n", command, data[0], data[1]); > + i2c_out(datadev, data[0]); > + /* set enable pin including optional rs and rw */ > + i2c_out(ctrldev, command | data[1]); > + /* unset enable pin including optional rs and rw */ > + i2c_out(ctrldev, command); > + } > + > } > diff --git a/drv_generic_i2c.h b/drv_generic_i2c.h > index 2cc6a02..bd68e44 100644 > --- a/drv_generic_i2c.h > +++ b/drv_generic_i2c.h > @@ -57,6 +57,6 @@ int drv_generic_i2c_close(void); > unsigned char drv_generic_i2c_wire(const char *name, const char *deflt); > void drv_generic_i2c_byte(const unsigned char data); > void drv_generic_i2c_data(const unsigned char data); > -void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length); > +void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length, int bits); > > #endif > -- Michael Reinelt <mi...@re...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |
From: Michael G. <mg...@pe...> - 2015-06-18 16:01:07
|
From: Michael Grzeschik <m.g...@pe...> This patch adds support for dual i2c io-expander based 8bit support for HD44780. It multiplexes the switch between the data and databits. Signed-off-by: Michael Grzeschik <m.g...@pe...> --- drv_HD44780.c | 82 ++++++++++++++++++++++++++++++++++++++----------------- drv_generic_i2c.c | 65 +++++++++++++++++++++++++++++++++---------- drv_generic_i2c.h | 2 +- 3 files changed, 109 insertions(+), 40 deletions(-) diff --git a/drv_HD44780.c b/drv_HD44780.c index 26f0bc9..7f4a56a 100644 --- a/drv_HD44780.c +++ b/drv_HD44780.c @@ -706,10 +706,10 @@ static void drv_HD_PP_stop(void) */ -static void drv_HD_I2C_nibble(unsigned char controller, unsigned char nibble) +static void drv_HD_I2C(unsigned char controller, unsigned char byte, int rs, int rw) { unsigned char enable; - unsigned char command; /* this is actually the first data byte on the PCF8574 */ + unsigned char command = 0; /* this is actually the first data byte on the PCF8574 */ unsigned char data_block[2]; /* enable signal: 'controller' is a bitmask */ /* bit n .. send to controller #n */ @@ -738,28 +738,51 @@ static void drv_HD_I2C_nibble(unsigned char controller, unsigned char nibble) The main advantage we see is that we do 2 less IOCTL's from our driver. */ - command = nibble; - data_block[0] = nibble | enable; - data_block[1] = nibble; + if (Bits == 4) { + if (rw) + byte |= SIGNAL_RW; + if (rs) + byte |= SIGNAL_RS; + command = byte; + data_block[0] = byte | enable; + data_block[1] = byte; + + } else if (Bits == 8) { + if (rw) + command |= SIGNAL_RW; + if (rs) + command |= SIGNAL_RS; + + data_block[0] = byte; + data_block[1] = enable; + } - drv_generic_i2c_command(command, data_block, 2); + drv_generic_i2c_command(command, data_block, 2, Bits); } static void drv_HD_I2C_byte(const unsigned char controller, const unsigned char data) { /* send data with RS enabled */ - drv_HD_I2C_nibble(controller, ((data >> 4) & 0x0f) | SIGNAL_RS); - drv_HD_I2C_nibble(controller, (data & 0x0f) | SIGNAL_RS); + if (Bits == 4) { + drv_HD_I2C(controller, ((data >> 4) & 0x0f), 1, 0); + drv_HD_I2C(controller, (data & 0x0f), 1, 0); + } else if (Bits == 8) { + drv_HD_I2C(controller, data, 1, 0); + } } static void drv_HD_I2C_command(const unsigned char controller, const unsigned char cmd, __attribute__ ((unused)) const unsigned long delay) { - /* send data with RS disabled */ - drv_HD_I2C_nibble(controller, ((cmd >> 4) & 0x0f)); - drv_HD_I2C_nibble(controller, ((cmd) & 0x0f)); + /* send command data with RS disabled */ + if (Bits == 4) { + drv_HD_I2C(controller, ((cmd >> 4) & 0x0f), 0, 0); + drv_HD_I2C(controller, ((cmd) & 0x0f), 0, 0); + } else if (Bits == 8) { + drv_HD_I2C(controller, cmd, 0, 0); + } } static void drv_HD_I2C_data(const unsigned char controller, const char *string, const int len, __attribute__ ((unused)) @@ -781,13 +804,14 @@ static int drv_HD_I2C_load(const char *section) { if (cfg_number(section, "Bits", 8, 4, 8, &Bits) < 0) return -1; - if (Bits != 4) { - error("%s: bad %s.Bits '%d' from %s, should be '4'", Name, section, Bits, cfg_source()); - return -1; - } info("%s: using %d bit mode", Name, Bits); + if (Bits != 4 && Bits != 8) { + error("%s: bad %s.Bits '%d' from %s, should be '4' or '8'", Name, section, Bits, cfg_source()); + return -1; + } + if (drv_generic_i2c_open(section, Name) != 0) { error("%s: could not initialize i2c attached device!", Name); return -1; @@ -804,16 +828,24 @@ static int drv_HD_I2C_load(const char *section) if ((SIGNAL_GPO = drv_generic_i2c_wire("GPO", "GND")) == 0xff) return -1; - /* initialize display */ - drv_HD_I2C_nibble(allControllers, 0x03); - udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ - drv_HD_I2C_nibble(allControllers, 0x03); - udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ - drv_HD_I2C_nibble(allControllers, 0x03); - udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ - drv_HD_I2C_nibble(allControllers, 0x02); - udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ - drv_HD_I2C_command(allControllers, 0x28, T_EXEC); /* 4 Bit mode, 1/16 duty cycle, 5x8 font */ + if (Bits == 4) { + /* initialize display */ + drv_HD_I2C(allControllers, 0x02, 0, 0); + udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ + drv_HD_I2C(allControllers, 0x03, 0, 0); + udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ + drv_HD_I2C(allControllers, 0x03, 0, 0); + udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ + drv_HD_I2C(allControllers, 0x02, 0, 0); + udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ + drv_HD_I2C_command(allControllers, 0x28, T_EXEC); /* 4 Bit mode, 1/16 duty cycle, 5x8 font */ + } else if (Bits == 8) { + drv_HD_I2C(allControllers, 0x30, 0, 0); /* 8 Bit mode, wait 4.1 ms */ + udelay(T_INIT1); /* 8 Bit mode, wait 4.1 ms */ + drv_HD_I2C(allControllers, 0x30, 0, 0); /* 8 Bit mode, wait 100 us */ + udelay(T_INIT2); /* 8 Bit mode, wait 4.1 ms */ + drv_HD_I2C_command(allControllers, 0x38, T_EXEC); /* 8 Bit mode, 1/16 duty cycle, 5x8 font */ + } info("%s: I2C initialization done", Name); diff --git a/drv_generic_i2c.c b/drv_generic_i2c.c index 2170b0c..1bee16f 100644 --- a/drv_generic_i2c.c +++ b/drv_generic_i2c.c @@ -62,7 +62,8 @@ static char *Driver = ""; static char *Section = ""; static int i2c_device; - +static int ctrldev; +static int datadev; static void my_i2c_smbus_write_byte_data(const int device, const unsigned char val) { @@ -91,34 +92,49 @@ static void my_i2c_smbus_read_byte_data(const int device, const unsigned char da } #endif +int drv_generic_i2c_pre_write(int dev) { + + info("%s: selecting slave device 0x%x", Driver, dev); + if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { + error("%s: error selecting slave device 0x%x\n", Driver, dev); + return -EPIPE; + } + + info("%s: initializing I2C slave device 0x%x for output", Driver, dev); + if (i2c_smbus_write_byte_data(i2c_device, 3, 0) < 0) { + error("%s: error initializing device 0x%x\n", Driver, dev); + close(i2c_device); + } + + return 0; +} int drv_generic_i2c_open(const char *section, const char *driver) { - int dev; char *bus, *device; udelay_init(); Section = (char *) section; Driver = (char *) driver; bus = cfg_get(Section, "Port", NULL); device = cfg_get(Section, "Device", NULL); - dev = atoi(device); + ctrldev = atoi(device); + device = cfg_get(Section, "DDevice", NULL); + datadev = atoi(device); + info("%s: initializing I2C bus %s", Driver, bus); if ((i2c_device = open(bus, O_WRONLY)) < 0) { error("%s: I2C bus %s open failed !\n", Driver, bus); goto exit_error; } - info("%s: selecting slave device 0x%x", Driver, dev); - if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { - error("%s: error selecting slave device 0x%x\n", Driver, dev); - goto exit_error; - } - info("%s: initializing I2C slave device 0x%x", Driver, dev); - if (i2c_smbus_write_quick(i2c_device, I2C_SMBUS_WRITE) < 0) { - error("%s: error initializing device 0x%x\n", Driver, dev); - close(i2c_device); + if (datadev) { + if (drv_generic_i2c_pre_write(datadev) < 0) + goto exit_error; } + if (drv_generic_i2c_pre_write(ctrldev) < 0) + goto exit_error; + return 0; exit_error: @@ -172,8 +188,29 @@ void drv_generic_i2c_data(const unsigned char data) my_i2c_smbus_write_byte_data(i2c_device, data); } +static void i2c_out(int dev, unsigned char val) +{ + info("%s: initializing I2C slave device 0x%x", Driver, dev); + if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { + error("%s: error selecting slave device 0x%x\n", Driver, dev); + return; + } + + i2c_smbus_write_byte_data(i2c_device, 1, val); +} -void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length) +void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length, int bits) { - i2c_smbus_write_block_data(i2c_device, command, length, data); + if (bits == 4) { + i2c_smbus_write_block_data(i2c_device, command, length, data); + } else if (bits == 8 && datadev) { + /* set data on pins */ + info("cmd: %08x, data0: %08x, data1: %08x\n", command, data[0], data[1]); + i2c_out(datadev, data[0]); + /* set enable pin including optional rs and rw */ + i2c_out(ctrldev, command | data[1]); + /* unset enable pin including optional rs and rw */ + i2c_out(ctrldev, command); + } + } diff --git a/drv_generic_i2c.h b/drv_generic_i2c.h index 2cc6a02..bd68e44 100644 --- a/drv_generic_i2c.h +++ b/drv_generic_i2c.h @@ -57,6 +57,6 @@ int drv_generic_i2c_close(void); unsigned char drv_generic_i2c_wire(const char *name, const char *deflt); void drv_generic_i2c_byte(const unsigned char data); void drv_generic_i2c_data(const unsigned char data); -void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length); +void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length, int bits); #endif -- 2.1.4 |
From: Michael G. <m.g...@pe...> - 2015-06-18 15:40:55
|
This patch adds support for dual i2c io-expander based 8bit mode for HD44780. It multiplexes the switch between the data and databits on both chips. Signed-off-by: Michael Grzeschik <m.g...@pe...> --- drv_HD44780.c | 82 ++++++++++++++++++++++++++++++++++++++----------------- drv_generic_i2c.c | 65 +++++++++++++++++++++++++++++++++---------- drv_generic_i2c.h | 2 +- 3 files changed, 109 insertions(+), 40 deletions(-) diff --git a/drv_HD44780.c b/drv_HD44780.c index 26f0bc9..7f4a56a 100644 --- a/drv_HD44780.c +++ b/drv_HD44780.c @@ -706,10 +706,10 @@ static void drv_HD_PP_stop(void) */ -static void drv_HD_I2C_nibble(unsigned char controller, unsigned char nibble) +static void drv_HD_I2C(unsigned char controller, unsigned char byte, int rs, int rw) { unsigned char enable; - unsigned char command; /* this is actually the first data byte on the PCF8574 */ + unsigned char command = 0; /* this is actually the first data byte on the PCF8574 */ unsigned char data_block[2]; /* enable signal: 'controller' is a bitmask */ /* bit n .. send to controller #n */ @@ -738,28 +738,51 @@ static void drv_HD_I2C_nibble(unsigned char controller, unsigned char nibble) The main advantage we see is that we do 2 less IOCTL's from our driver. */ - command = nibble; - data_block[0] = nibble | enable; - data_block[1] = nibble; + if (Bits == 4) { + if (rw) + byte |= SIGNAL_RW; + if (rs) + byte |= SIGNAL_RS; + command = byte; + data_block[0] = byte | enable; + data_block[1] = byte; + + } else if (Bits == 8) { + if (rw) + command |= SIGNAL_RW; + if (rs) + command |= SIGNAL_RS; + + data_block[0] = byte; + data_block[1] = enable; + } - drv_generic_i2c_command(command, data_block, 2); + drv_generic_i2c_command(command, data_block, 2, Bits); } static void drv_HD_I2C_byte(const unsigned char controller, const unsigned char data) { /* send data with RS enabled */ - drv_HD_I2C_nibble(controller, ((data >> 4) & 0x0f) | SIGNAL_RS); - drv_HD_I2C_nibble(controller, (data & 0x0f) | SIGNAL_RS); + if (Bits == 4) { + drv_HD_I2C(controller, ((data >> 4) & 0x0f), 1, 0); + drv_HD_I2C(controller, (data & 0x0f), 1, 0); + } else if (Bits == 8) { + drv_HD_I2C(controller, data, 1, 0); + } } static void drv_HD_I2C_command(const unsigned char controller, const unsigned char cmd, __attribute__ ((unused)) const unsigned long delay) { - /* send data with RS disabled */ - drv_HD_I2C_nibble(controller, ((cmd >> 4) & 0x0f)); - drv_HD_I2C_nibble(controller, ((cmd) & 0x0f)); + /* send command data with RS disabled */ + if (Bits == 4) { + drv_HD_I2C(controller, ((cmd >> 4) & 0x0f), 0, 0); + drv_HD_I2C(controller, ((cmd) & 0x0f), 0, 0); + } else if (Bits == 8) { + drv_HD_I2C(controller, cmd, 0, 0); + } } static void drv_HD_I2C_data(const unsigned char controller, const char *string, const int len, __attribute__ ((unused)) @@ -781,13 +804,14 @@ static int drv_HD_I2C_load(const char *section) { if (cfg_number(section, "Bits", 8, 4, 8, &Bits) < 0) return -1; - if (Bits != 4) { - error("%s: bad %s.Bits '%d' from %s, should be '4'", Name, section, Bits, cfg_source()); - return -1; - } info("%s: using %d bit mode", Name, Bits); + if (Bits != 4 && Bits != 8) { + error("%s: bad %s.Bits '%d' from %s, should be '4' or '8'", Name, section, Bits, cfg_source()); + return -1; + } + if (drv_generic_i2c_open(section, Name) != 0) { error("%s: could not initialize i2c attached device!", Name); return -1; @@ -804,16 +828,24 @@ static int drv_HD_I2C_load(const char *section) if ((SIGNAL_GPO = drv_generic_i2c_wire("GPO", "GND")) == 0xff) return -1; - /* initialize display */ - drv_HD_I2C_nibble(allControllers, 0x03); - udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ - drv_HD_I2C_nibble(allControllers, 0x03); - udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ - drv_HD_I2C_nibble(allControllers, 0x03); - udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ - drv_HD_I2C_nibble(allControllers, 0x02); - udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ - drv_HD_I2C_command(allControllers, 0x28, T_EXEC); /* 4 Bit mode, 1/16 duty cycle, 5x8 font */ + if (Bits == 4) { + /* initialize display */ + drv_HD_I2C(allControllers, 0x02, 0, 0); + udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ + drv_HD_I2C(allControllers, 0x03, 0, 0); + udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ + drv_HD_I2C(allControllers, 0x03, 0, 0); + udelay(T_INIT1); /* 4 Bit mode, wait 4.1 ms */ + drv_HD_I2C(allControllers, 0x02, 0, 0); + udelay(T_INIT2); /* 4 Bit mode, wait 100 us */ + drv_HD_I2C_command(allControllers, 0x28, T_EXEC); /* 4 Bit mode, 1/16 duty cycle, 5x8 font */ + } else if (Bits == 8) { + drv_HD_I2C(allControllers, 0x30, 0, 0); /* 8 Bit mode, wait 4.1 ms */ + udelay(T_INIT1); /* 8 Bit mode, wait 4.1 ms */ + drv_HD_I2C(allControllers, 0x30, 0, 0); /* 8 Bit mode, wait 100 us */ + udelay(T_INIT2); /* 8 Bit mode, wait 4.1 ms */ + drv_HD_I2C_command(allControllers, 0x38, T_EXEC); /* 8 Bit mode, 1/16 duty cycle, 5x8 font */ + } info("%s: I2C initialization done", Name); diff --git a/drv_generic_i2c.c b/drv_generic_i2c.c index 2170b0c..1bee16f 100644 --- a/drv_generic_i2c.c +++ b/drv_generic_i2c.c @@ -62,7 +62,8 @@ static char *Driver = ""; static char *Section = ""; static int i2c_device; - +static int ctrldev; +static int datadev; static void my_i2c_smbus_write_byte_data(const int device, const unsigned char val) { @@ -91,34 +92,49 @@ static void my_i2c_smbus_read_byte_data(const int device, const unsigned char da } #endif +int drv_generic_i2c_pre_write(int dev) { + + info("%s: selecting slave device 0x%x", Driver, dev); + if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { + error("%s: error selecting slave device 0x%x\n", Driver, dev); + return -EPIPE; + } + + info("%s: initializing I2C slave device 0x%x for output", Driver, dev); + if (i2c_smbus_write_byte_data(i2c_device, 3, 0) < 0) { + error("%s: error initializing device 0x%x\n", Driver, dev); + close(i2c_device); + } + + return 0; +} int drv_generic_i2c_open(const char *section, const char *driver) { - int dev; char *bus, *device; udelay_init(); Section = (char *) section; Driver = (char *) driver; bus = cfg_get(Section, "Port", NULL); device = cfg_get(Section, "Device", NULL); - dev = atoi(device); + ctrldev = atoi(device); + device = cfg_get(Section, "DDevice", NULL); + datadev = atoi(device); + info("%s: initializing I2C bus %s", Driver, bus); if ((i2c_device = open(bus, O_WRONLY)) < 0) { error("%s: I2C bus %s open failed !\n", Driver, bus); goto exit_error; } - info("%s: selecting slave device 0x%x", Driver, dev); - if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { - error("%s: error selecting slave device 0x%x\n", Driver, dev); - goto exit_error; - } - info("%s: initializing I2C slave device 0x%x", Driver, dev); - if (i2c_smbus_write_quick(i2c_device, I2C_SMBUS_WRITE) < 0) { - error("%s: error initializing device 0x%x\n", Driver, dev); - close(i2c_device); + if (datadev) { + if (drv_generic_i2c_pre_write(datadev) < 0) + goto exit_error; } + if (drv_generic_i2c_pre_write(ctrldev) < 0) + goto exit_error; + return 0; exit_error: @@ -172,8 +188,29 @@ void drv_generic_i2c_data(const unsigned char data) my_i2c_smbus_write_byte_data(i2c_device, data); } +static void i2c_out(int dev, unsigned char val) +{ + info("%s: initializing I2C slave device 0x%x", Driver, dev); + if (ioctl(i2c_device, I2C_SLAVE, dev) < 0) { + error("%s: error selecting slave device 0x%x\n", Driver, dev); + return; + } + + i2c_smbus_write_byte_data(i2c_device, 1, val); +} -void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length) +void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length, int bits) { - i2c_smbus_write_block_data(i2c_device, command, length, data); + if (bits == 4) { + i2c_smbus_write_block_data(i2c_device, command, length, data); + } else if (bits == 8 && datadev) { + /* set data on pins */ + info("cmd: %08x, data0: %08x, data1: %08x\n", command, data[0], data[1]); + i2c_out(datadev, data[0]); + /* set enable pin including optional rs and rw */ + i2c_out(ctrldev, command | data[1]); + /* unset enable pin including optional rs and rw */ + i2c_out(ctrldev, command); + } + } diff --git a/drv_generic_i2c.h b/drv_generic_i2c.h index 2cc6a02..bd68e44 100644 --- a/drv_generic_i2c.h +++ b/drv_generic_i2c.h @@ -57,6 +57,6 @@ int drv_generic_i2c_close(void); unsigned char drv_generic_i2c_wire(const char *name, const char *deflt); void drv_generic_i2c_byte(const unsigned char data); void drv_generic_i2c_data(const unsigned char data); -void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length); +void drv_generic_i2c_command(const unsigned char command, /*const */ unsigned char *data, const unsigned char length, int bits); #endif -- 2.1.4 |
From: Bernhard B. <Ber...@gm...> - 2015-03-09 10:32:00
|
> Gesendet: Dienstag, 21. Oktober 2014 um 23:41 Uhr > Von: "Bernhard Bitsch" <Ber...@gm...> > An: lcd...@li... > Betreff: [lcd4linux] Some issues found > > Hi, > > I hope someone reads this. The development isn't really engaged in this project, I suspect from the state of the home page. > > I'm using LCD4Linux since a while as part of my IPFire appliance on an ALIX board. > LCD4Linux isn't running continously on my system, because from a while to a while I noticed performance losses with the program active. Of course the display of system parameters on a LCD is just a nice addon to my system, but not really necessary. > > In the last days we discussed a new config for the Pearl (DPF) display. Unfortunately this config caused very high load ( CPU usage about 80%-90%! ). > First idea was, the use of exec plugin gives that high load. But just a config with 2 static text rows made the same effect! > > > Further investigation showed two problems: > > 1) The high load is produced by the update parameter for the text widget class ( =0 -->static, one shot ). Changing the value to just 10 removes that load. Is this issue known? If yes, does exist a patch for this? > > 2) Trying to eliminate some exec functions ( they just read some info from a file ) by using the File::readline function did not succeed. The files read do not contain a EOL character, thus the function does return the empty string. > Looking at the sources of the plugin showed, that a EOL is mandatory. Why? Furthermore the maximum line length is set to 80. The rest of the line is eaten up. > This behaviour is not necessary. fgets stops at EOF, also. Thus a one line file without EOL char could be read also. > I found further issues with this code. > The code for reading is: > char value[80], val2[80]; > .... > fgets(val2, sizeof(val2), fp); <--- read 80 chars at most > size = strcspn(val2, "\r\n"); <--- search for EOL, if not found size is >=80 > strncpy(value, val2, size); <--- only valid if size <=80 > value[size] = '\0'; <--- only valid for size <80 > > > - Bernhard > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Lcd4linux-users mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-users > |
From: Mattia Jona-L. <mat...@gm...> - 2015-03-04 09:41:56
|
Hi Dennis. Hi Michael. Did you try the lcd-linux driver for your display? It is a kernel level driver for hd44780 displays and timings issues are quite well under control. If it really is a timings issue then lcd-linux might help. http://lcd-linux.sourceforge.net/ Best Mattia On Tue, Mar 3, 2015 at 1:49 PM, Dennis Grant <re...@gm...> wrote: > http://pdf1.alldatasheet.com/datasheet-pdf/view/105087/SAMSUNG/16T202DA1J.html > > Thanks Michael. > > I hope you are wrong about the voltage issue as that appears to be a > nontrivial fix. > > My suspicion that it is timing is based on this: > > - With the original motherboard (GA-MA780G-UD3H) and processor (Phenom > II x4 940) it worked fine. > - Same motherboard, but upgraded processor (Phenom II x6 1090T) it > mostly worked, but sections of the display that were being updated (eg > CPU use) would occasionally shift right, then back (so CPU: 15% might > read CPU: 155, then CPU: 205 etc - the "%" got overwritten at some > point) This could be fixed by restarting the service > - New motherboard + PCI parport card, same behavior, but now the > second line vanishes after a while > > Note that I misspoke earlier; it is a 16x2 > > What is maddening is that the display mounting points are slightly > larger than what appears to be standard. I was going to replace it > with a Matrix Orbital USB display, rather than buy a parport card, but > the mounting holes are differently spaced. > > I guess we'll see. > > Thanks for the assist. > > DG > > On Tue, Mar 3, 2015 at 1:28 AM, Michael Reinelt <mi...@re...> wrote: >> Hello Dennis, >> >> post a link to the datasheet, and your config, and I will have a look at it. >> >> Maybe its not a timing issue, but a voltage issue: Some display require 5V >> signal level, and modern parports provide just 3.3V >> >> In this case you have to use a level shifter (e.g. 74HCT245) >> >> Am 2015-03-03 um 03:52 schrieb Dennis Grant: >>> >>> Hey there. I hope someone is still on this list. >>> >>> I have a display based on a Samsung 16T202DA1J 16x4 VFD. I have been >>> using the HD44780 display driver with some success (every once and a >>> while the display would overwrite a char to the left) but a recent >>> motherboard upgrade and a change to a PCI based parport (yup, it is >>> parport driven) has caused more problems. >>> >>> Given that is *almost* works - it's fine for a few minutes, then >>> eventually corrupts - I think it is a timing issue. >>> >>> I have the datasheet PDF. Anybody feel like looking at it for me and >>> telling me what timings I should be using? >>> >>> Thanks. >>> >>> DG >>> >>> >>> ------------------------------------------------------------------------------ >>> Dive into the World of Parallel Programming The Go Parallel Website, >>> sponsored >>> by Intel and developed in partnership with Slashdot Media, is your hub for >>> all >>> things parallel software development, from weekly thought leadership blogs >>> to >>> news, videos, case studies, tutorials and more. Take a look and join the >>> conversation now. http://goparallel.sourceforge.net/ >>> _______________________________________________ >>> Lcd4linux-devel mailing list >>> Lcd...@li... >>> https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel >>> >>> >> >> -- >> Michael Reinelt <mi...@re...> >> http://home.pages.at/reinelt >> GPG-Key 0xDF13BA50 >> ICQ #288386781 > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Lcd4linux-devel mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel |
From: Dennis G. <re...@gm...> - 2015-03-03 12:50:00
|
http://pdf1.alldatasheet.com/datasheet-pdf/view/105087/SAMSUNG/16T202DA1J.html Thanks Michael. I hope you are wrong about the voltage issue as that appears to be a nontrivial fix. My suspicion that it is timing is based on this: - With the original motherboard (GA-MA780G-UD3H) and processor (Phenom II x4 940) it worked fine. - Same motherboard, but upgraded processor (Phenom II x6 1090T) it mostly worked, but sections of the display that were being updated (eg CPU use) would occasionally shift right, then back (so CPU: 15% might read CPU: 155, then CPU: 205 etc - the "%" got overwritten at some point) This could be fixed by restarting the service - New motherboard + PCI parport card, same behavior, but now the second line vanishes after a while Note that I misspoke earlier; it is a 16x2 What is maddening is that the display mounting points are slightly larger than what appears to be standard. I was going to replace it with a Matrix Orbital USB display, rather than buy a parport card, but the mounting holes are differently spaced. I guess we'll see. Thanks for the assist. DG On Tue, Mar 3, 2015 at 1:28 AM, Michael Reinelt <mi...@re...> wrote: > Hello Dennis, > > post a link to the datasheet, and your config, and I will have a look at it. > > Maybe its not a timing issue, but a voltage issue: Some display require 5V > signal level, and modern parports provide just 3.3V > > In this case you have to use a level shifter (e.g. 74HCT245) > > Am 2015-03-03 um 03:52 schrieb Dennis Grant: >> >> Hey there. I hope someone is still on this list. >> >> I have a display based on a Samsung 16T202DA1J 16x4 VFD. I have been >> using the HD44780 display driver with some success (every once and a >> while the display would overwrite a char to the left) but a recent >> motherboard upgrade and a change to a PCI based parport (yup, it is >> parport driven) has caused more problems. >> >> Given that is *almost* works - it's fine for a few minutes, then >> eventually corrupts - I think it is a timing issue. >> >> I have the datasheet PDF. Anybody feel like looking at it for me and >> telling me what timings I should be using? >> >> Thanks. >> >> DG >> >> >> ------------------------------------------------------------------------------ >> Dive into the World of Parallel Programming The Go Parallel Website, >> sponsored >> by Intel and developed in partnership with Slashdot Media, is your hub for >> all >> things parallel software development, from weekly thought leadership blogs >> to >> news, videos, case studies, tutorials and more. Take a look and join the >> conversation now. http://goparallel.sourceforge.net/ >> _______________________________________________ >> Lcd4linux-devel mailing list >> Lcd...@li... >> https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel >> >> > > -- > Michael Reinelt <mi...@re...> > http://home.pages.at/reinelt > GPG-Key 0xDF13BA50 > ICQ #288386781 |
From: Michael R. <mi...@re...> - 2015-03-03 05:28:48
|
Hello Dennis, post a link to the datasheet, and your config, and I will have a look at it. Maybe its not a timing issue, but a voltage issue: Some display require 5V signal level, and modern parports provide just 3.3V In this case you have to use a level shifter (e.g. 74HCT245) Am 2015-03-03 um 03:52 schrieb Dennis Grant: > Hey there. I hope someone is still on this list. > > I have a display based on a Samsung 16T202DA1J 16x4 VFD. I have been > using the HD44780 display driver with some success (every once and a > while the display would overwrite a char to the left) but a recent > motherboard upgrade and a change to a PCI based parport (yup, it is > parport driven) has caused more problems. > > Given that is *almost* works - it's fine for a few minutes, then > eventually corrupts - I think it is a timing issue. > > I have the datasheet PDF. Anybody feel like looking at it for me and > telling me what timings I should be using? > > Thanks. > > DG > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming The Go Parallel Website, sponsored > by Intel and developed in partnership with Slashdot Media, is your hub for all > things parallel software development, from weekly thought leadership blogs to > news, videos, case studies, tutorials and more. Take a look and join the > conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Lcd4linux-devel mailing list > Lcd...@li... > https://lists.sourceforge.net/lists/listinfo/lcd4linux-devel > > -- Michael Reinelt <mi...@re...> http://home.pages.at/reinelt GPG-Key 0xDF13BA50 ICQ #288386781 |
From: Dennis G. <re...@gm...> - 2015-03-03 02:52:36
|
Hey there. I hope someone is still on this list. I have a display based on a Samsung 16T202DA1J 16x4 VFD. I have been using the HD44780 display driver with some success (every once and a while the display would overwrite a char to the left) but a recent motherboard upgrade and a change to a PCI based parport (yup, it is parport driven) has caused more problems. Given that is *almost* works - it's fine for a few minutes, then eventually corrupts - I think it is a timing issue. I have the datasheet PDF. Anybody feel like looking at it for me and telling me what timings I should be using? Thanks. DG |
From: chris j. <cn...@gm...> - 2014-05-02 14:40:12
|
Hi, I am a happy LCD4Linux user. I use it to display the time, CPU Load and internet traffic. After start using FireQOS which is a pkaet scheuler to priotize and queue the traffic, LCD4Linux shows wrog network input and output values. The values are much to high. I suspect that this has something to do with the traffoc queuing. I don't know but may the traffic is queued for a while and then the queue is emptied in short timefrime, which leads to the wrong values. I hope somebody could have a look and write a patch. thanks chris |