more complete hd44780 initialization; a bit more dox; typo fixes in docs

This commit is contained in:
marschap
2007-12-26 15:40:58 +00:00
parent 6a81513049
commit d64dcf7e11
4 changed files with 33 additions and 20 deletions
+1
View File
@@ -43,6 +43,7 @@ v.0.5dev (ongoing development)
+ hd44780 driver: new ConnectionType ftdi (Thomas Jarosch) + hd44780 driver: new ConnectionType ftdi (Thomas Jarosch)
* shuttleVFD driver: fix VendorID, support newer models (Miska Sulander) * shuttleVFD driver: fix VendorID, support newer models (Miska Sulander)
+ i2500vfd driver for a graphocal Noritake VFD (Thomas Jarosch) + i2500vfd driver for a graphocal Noritake VFD (Thomas Jarosch)
* hd44780 driver: more complete initialization (idea by Pierre Ossman)
v.0.5.2 v.0.5.2
* fix switching on/off the Load screen in lcdproc client using the menu * fix switching on/off the Load screen in lcdproc client using the menu
+2 -2
View File
@@ -980,7 +980,7 @@ This type of connection should work with winamp.
</row> </row>
<row> <row>
<entry>nSTRB</entry> <entry>nSTRB</entry>
<entry>(1)</entry> <entry>1</entry>
<entry></entry> <entry></entry>
<entry>EN</entry> <entry>EN</entry>
<entry>6</entry> <entry>6</entry>
@@ -2128,7 +2128,7 @@ The board, driven by the <code>bwctusb</code> connection type,
does neither support a keypad for input, nor more than one single-controller does neither support a keypad for input, nor more than one single-controller
display, nor does it allow setting the backlight or brightness. display, nor does it allow setting the backlight or brightness.
But you can set the display's contrast using software But you can set the display's contrast using software
(see the <command>Constrast=</command> configuration parameter). (see the <command>Contrast=</command> configuration parameter).
</para> </para>
<sect4 id="hd44780-bwctusb-config"> <sect4 id="hd44780-bwctusb-config">
+16 -12
View File
@@ -2,9 +2,9 @@
* Interface to low-level driver types, headers and names. * Interface to low-level driver types, headers and names.
* *
* To add support for a new driver in this file: * To add support for a new driver in this file:
* \li 1. include your header file * -# include your header file
* \li 2. Add a new connectionType * -# Add a new connectionType
* \li 3. Add an entry in the \c ConnectionMapping structure * -# Add an entry in the \c ConnectionMapping structure
*/ */
#ifndef HD44780_DRIVERS_H #ifndef HD44780_DRIVERS_H
@@ -32,26 +32,28 @@
// add new connection type header files here // add new connection type header files here
// connectionType enumerator: /** connectionType mapping table:
// - string to identify connection in config file * - string to identify connection in config file
// - connection type identifier * - connection type identifier
// - interface type * - interface type
// - initialisation function * - initialisation function
*/
static const ConnectionMapping connectionMapping[] = { static const ConnectionMapping connectionMapping[] = {
#ifdef HAVE_PCSTYLE_LPT_CONTROL #ifdef HAVE_PCSTYLE_LPT_CONTROL
/* parallel connection types */
{ "4bit", HD44780_CT_4BIT, IF_TYPE_PARPORT, hd_init_4bit }, { "4bit", HD44780_CT_4BIT, IF_TYPE_PARPORT, hd_init_4bit },
{ "8bit", HD44780_CT_8BIT, IF_TYPE_PARPORT, hd_init_ext8bit }, { "8bit", HD44780_CT_8BIT, IF_TYPE_PARPORT, hd_init_ext8bit },
{ "serialLpt", HD44780_CT_SERIALLPT, IF_TYPE_PARPORT, hd_init_serialLpt }, { "serialLpt", HD44780_CT_SERIALLPT, IF_TYPE_PARPORT, hd_init_serialLpt },
{ "winamp", HD44780_CT_WINAMP, IF_TYPE_PARPORT, hd_init_winamp }, { "winamp", HD44780_CT_WINAMP, IF_TYPE_PARPORT, hd_init_winamp },
#endif #endif
/* Serial connectiontypes */ /* serial connection types */
{ "picanlcd", HD44780_CT_PICANLCD, IF_TYPE_SERIAL, hd_init_serial }, { "picanlcd", HD44780_CT_PICANLCD, IF_TYPE_SERIAL, hd_init_serial },
{ "lcdserializer", HD44780_CT_LCDSERIALIZER, IF_TYPE_SERIAL, hd_init_serial }, { "lcdserializer", HD44780_CT_LCDSERIALIZER, IF_TYPE_SERIAL, hd_init_serial },
{ "los-panel", HD44780_CT_LOS_PANEL, IF_TYPE_SERIAL, hd_init_serial }, { "los-panel", HD44780_CT_LOS_PANEL, IF_TYPE_SERIAL, hd_init_serial },
{ "vdr-lcd", HD44780_CT_VDR_LCD, IF_TYPE_SERIAL, hd_init_serial }, { "vdr-lcd", HD44780_CT_VDR_LCD, IF_TYPE_SERIAL, hd_init_serial },
{ "vdr-wakeup", HD44780_CT_VDR_WAKEUP, IF_TYPE_SERIAL, hd_init_serial }, { "vdr-wakeup", HD44780_CT_VDR_WAKEUP, IF_TYPE_SERIAL, hd_init_serial },
{ "pertelian", HD44780_CT_PERTELIAN, IF_TYPE_SERIAL, hd_init_serial }, { "pertelian", HD44780_CT_PERTELIAN, IF_TYPE_SERIAL, hd_init_serial },
/* End serial connectiontypes */ /* USB connection types */
{ "lis2", HD44780_CT_LIS2, IF_TYPE_USB, hd_init_lis2 }, { "lis2", HD44780_CT_LIS2, IF_TYPE_USB, hd_init_lis2 },
{ "mplay", HD44780_CT_MPLAY, IF_TYPE_USB, hd_init_lis2 }, { "mplay", HD44780_CT_MPLAY, IF_TYPE_USB, hd_init_lis2 },
#ifdef HAVE_LIBUSB #ifdef HAVE_LIBUSB
@@ -61,11 +63,13 @@ static const ConnectionMapping connectionMapping[] = {
#ifdef HAVE_LIBFTDI #ifdef HAVE_LIBFTDI
{ "ftdi", HD44780_CT_FTDI, IF_TYPE_USB, hd_init_ftdi }, { "ftdi", HD44780_CT_FTDI, IF_TYPE_USB, hd_init_ftdi },
#endif #endif
/* I2C connection types */
#ifdef HAVE_I2C #ifdef HAVE_I2C
{ "i2c", HD44780_CT_I2C, IF_TYPE_I2C, hd_init_i2c }, { "i2c", HD44780_CT_I2C, IF_TYPE_I2C, hd_init_i2c },
#endif #endif
// add new connection types and their string specifier here // add new connection types here
// default, end of structure element (do not delete) // ....
// default, end of structure element (do not delete)
{ NULL, HD44780_CT_UNKNOWN, IF_TYPE_UNKNOWN, NULL } { NULL, HD44780_CT_UNKNOWN, IF_TYPE_UNKNOWN, NULL }
}; };
+14 -6
View File
@@ -456,16 +456,20 @@ HD44780_init(Driver *drvthis)
/** /**
* Common initialisation sequence - sets cursor off and not blinking, * Common initialisation sequence:
* clear display and homecursor * - set twoline mode, small (5x8) charactersi & 4- or 8-bit mode
* Does not set twoline mode nor small characters (5x8). The init function of * - set display on & cursor off, not blinking,
* the connectiontype should do this. * - set output mode to lefto-to-right & turn off display scolling
* - clear display & move cursor home
* .
* \param p Pointer to PrivateData structure.
* \param if_bit Command bits for 4- resp. 8-bit mode
*/ */
void void
common_init(PrivateData *p, unsigned char if_bit) common_init(PrivateData *p, unsigned char if_bit)
{ {
if (p->ext_mode) { if (p->ext_mode) {
// Set up extended mode */ // Set up extended mode
p->hd44780_functions->senddata(p, 0, RS_INSTR, FUNCSET | if_bit | TWOLINE | SMALLCHAR | EXTREG); p->hd44780_functions->senddata(p, 0, RS_INSTR, FUNCSET | if_bit | TWOLINE | SMALLCHAR | EXTREG);
p->hd44780_functions->uPause(p, 40); p->hd44780_functions->uPause(p, 40);
p->hd44780_functions->senddata(p, 0, RS_INSTR, EXTMODESET | FOURLINE); p->hd44780_functions->senddata(p, 0, RS_INSTR, EXTMODESET | FOURLINE);
@@ -475,6 +479,8 @@ common_init(PrivateData *p, unsigned char if_bit)
p->hd44780_functions->uPause(p, 40); p->hd44780_functions->uPause(p, 40);
p->hd44780_functions->senddata(p, 0, RS_INSTR, ONOFFCTRL | DISPON | CURSOROFF | CURSORNOBLINK); p->hd44780_functions->senddata(p, 0, RS_INSTR, ONOFFCTRL | DISPON | CURSOROFF | CURSORNOBLINK);
p->hd44780_functions->uPause(p, 40); p->hd44780_functions->uPause(p, 40);
p->hd44780_functions->senddata(p, 0, RS_INSTR, ENTRYMODE | E_MOVERIGHT | NOSCROLL);
p->hd44780_functions->uPause(p, 40);
p->hd44780_functions->senddata(p, 0, RS_INSTR, CLEAR); p->hd44780_functions->senddata(p, 0, RS_INSTR, CLEAR);
p->hd44780_functions->uPause(p, 1600); p->hd44780_functions->uPause(p, 1600);
p->hd44780_functions->senddata(p, 0, RS_INSTR, HOMECURSOR); p->hd44780_functions->senddata(p, 0, RS_INSTR, HOMECURSOR);
@@ -483,7 +489,9 @@ common_init(PrivateData *p, unsigned char if_bit)
/** /**
* Delay a number of microseconds * Delay a number of microseconds.
* \param p Pointer to PrivateData structure.
* \param usecs Number of micro-seconds to sleep.
*/ */
void void
uPause(PrivateData *p, int usecs) uPause(PrivateData *p, int usecs)