Minor fixes. Still untested on real hardware.
This commit is contained in:
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include "hd44780-picanlcd.h"
|
||||
#include "hd44780-low.h"
|
||||
#include "hd44780.h"
|
||||
|
||||
#include "shared/str.h"
|
||||
@@ -45,6 +46,8 @@
|
||||
// HD44780_readkeypad
|
||||
|
||||
void picanlcd_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch);
|
||||
void picanlcd_HD44780_backlight (PrivateData *p, unsigned char state);
|
||||
unsigned char picanlcd_HD44780_scankeypad (PrivateData *p);
|
||||
|
||||
// PIC-an-LCD ASCII commands
|
||||
//#define PICANLCD_HOME '\001'
|
||||
@@ -69,12 +72,12 @@ hd_init_picanlcd (Driver *drvthis)
|
||||
/* Get serial device to use */
|
||||
strncpy(device, drvthis->config_get_string ( drvthis->name , "device" , 0 , DEFAULT_DEVICE),sizeof(device));
|
||||
device[sizeof(device)-1]=0;
|
||||
report (RPT_INFO,"HD44780: PC-an-LCD: Using device: %s", device);
|
||||
report (RPT_INFO,"HD44780: PIC-an-LCD: Using device: %s", device);
|
||||
|
||||
// Set up io port correctly, and open it...
|
||||
p->fd = open(device, O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
if (p->fd == -1) {
|
||||
report(RPT_ERR, "HD44780: PC-an-LCD: could not open device %s (%s)\n", device, strerror(errno));
|
||||
report(RPT_ERR, "HD44780: PIC-an-LCD: could not open device %s (%s)\n", device, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -101,6 +104,8 @@ hd_init_picanlcd (Driver *drvthis)
|
||||
tcsetattr(p->fd, TCSANOW, &portset);
|
||||
|
||||
p->hd44780_functions->senddata = picanlcd_HD44780_senddata;
|
||||
p->hd44780_functions->backlight = picanlcd_HD44780_backlight;
|
||||
p->hd44780_functions->scankeypad = picanlcd_HD44780_scankeypad;
|
||||
|
||||
common_init (p);
|
||||
|
||||
@@ -126,3 +131,15 @@ picanlcd_HD44780_senddata (PrivateData *p, unsigned char displayID, unsigned cha
|
||||
write( p->fd, &ch, 1 );
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
picanlcd_HD44780_backlight (PrivateData *p, unsigned char state)
|
||||
{
|
||||
/* Anyone wants to implement this ? */
|
||||
}
|
||||
|
||||
unsigned char
|
||||
picanlcd_HD44780_scankeypad (PrivateData *p)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user