Doxygen-ize
This commit is contained in:
@@ -93,7 +93,13 @@ static const unsigned char EnMask[] = { EN1, EN2, EN3, STRB, LF, INIT, SEL };
|
|||||||
#define ALLEXT (STRB|LF|INIT|SEL)
|
#define ALLEXT (STRB|LF|INIT|SEL)
|
||||||
// The above bits are on the control port of LPT
|
// The above bits are on the control port of LPT
|
||||||
|
|
||||||
// initialisation function
|
|
||||||
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
hd_init_4bit(Driver *drvthis)
|
hd_init_4bit(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -169,7 +175,14 @@ hd_init_4bit(Driver *drvthis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// lcdstat_HD44780_senddata
|
|
||||||
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
lcdstat_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
lcdstat_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
@@ -226,6 +239,12 @@ lcdstat_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void lcdstat_HD44780_backlight(PrivateData *p, unsigned char state)
|
void lcdstat_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
p->backlight_bit = ((!p->have_backlight||state)?0:BL);
|
p->backlight_bit = ((!p->have_backlight||state)?0:BL);
|
||||||
@@ -233,6 +252,13 @@ void lcdstat_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
port_out(p->port, p->backlight_bit);
|
port_out(p->port, p->backlight_bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read keypress.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param YData ???
|
||||||
|
* \return Bitmap of the pressed keys.
|
||||||
|
*/
|
||||||
unsigned char lcdstat_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
unsigned char lcdstat_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
||||||
{
|
{
|
||||||
unsigned char readval;
|
unsigned char readval;
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ void bwct_usb_HD44780_close(PrivateData *p);
|
|||||||
/**
|
/**
|
||||||
* Initialize the driver.
|
* Initialize the driver.
|
||||||
* \param drvthis Pointer to driver structure.
|
* \param drvthis Pointer to driver structure.
|
||||||
* \retval 0 Success.
|
* \retval 0 Success.
|
||||||
* \retval -1 Error.
|
* \retval -1 Error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
hd_init_bwct_usb(Driver *drvthis)
|
hd_init_bwct_usb(Driver *drvthis)
|
||||||
|
|||||||
@@ -35,7 +35,12 @@ void ethlcd_HD44780_close(PrivateData *p);
|
|||||||
void ethlcd_HD44780_uPause(PrivateData *p, int usecs) {}
|
void ethlcd_HD44780_uPause(PrivateData *p, int usecs) {}
|
||||||
|
|
||||||
|
|
||||||
// initialisation function
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int hd_init_ethlcd(Driver *drvthis)
|
int hd_init_ethlcd(Driver *drvthis)
|
||||||
{
|
{
|
||||||
char hostname[_POSIX_HOST_NAME_MAX];
|
char hostname[_POSIX_HOST_NAME_MAX];
|
||||||
@@ -82,7 +87,13 @@ int hd_init_ethlcd(Driver *drvthis)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ethlcd_HD44780_senddata
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void ethlcd_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
void ethlcd_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
static char buff[2];
|
static char buff[2];
|
||||||
@@ -98,6 +109,11 @@ void ethlcd_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned c
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read keypress.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \return Bitmap of the pressed keys.
|
||||||
|
*/
|
||||||
unsigned char ethlcd_HD44780_scankeypad(PrivateData *p)
|
unsigned char ethlcd_HD44780_scankeypad(PrivateData *p)
|
||||||
{
|
{
|
||||||
unsigned char readval;
|
unsigned char readval;
|
||||||
@@ -127,6 +143,11 @@ unsigned char ethlcd_HD44780_scankeypad(PrivateData *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn the LCD backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void ethlcd_HD44780_backlight(PrivateData *p, unsigned char state)
|
void ethlcd_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
static char buff[2];
|
static char buff[2];
|
||||||
@@ -148,6 +169,10 @@ void ethlcd_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the driver (do necessary clean-up).
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
*/
|
||||||
void ethlcd_HD44780_close(PrivateData *p)
|
void ethlcd_HD44780_close(PrivateData *p)
|
||||||
{
|
{
|
||||||
sock_close(p->sock);
|
sock_close(p->sock);
|
||||||
|
|||||||
@@ -81,7 +81,13 @@ void lcdtime_HD44780_output(PrivateData *p, int data);
|
|||||||
|
|
||||||
static int semid;
|
static int semid;
|
||||||
|
|
||||||
// initialise the driver
|
|
||||||
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
hd_init_ext8bit(Driver *drvthis)
|
hd_init_ext8bit(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -116,7 +122,14 @@ hd_init_ext8bit(Driver *drvthis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// lcdtime_HD44780_senddata
|
|
||||||
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
lcdtime_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
lcdtime_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
@@ -142,6 +155,12 @@ lcdtime_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char
|
|||||||
sem_signal(semid);
|
sem_signal(semid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void lcdtime_HD44780_backlight(PrivateData *p, unsigned char state)
|
void lcdtime_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
p->backlight_bit = (state?0:SEL);
|
p->backlight_bit = (state?0:SEL);
|
||||||
@@ -151,6 +170,13 @@ void lcdtime_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
port_out(p->port + 2, p->backlight_bit ^ OUTMASK);
|
port_out(p->port + 2, p->backlight_bit ^ OUTMASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read keypress.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param YData ???
|
||||||
|
* \return Bitmap of the pressed keys.
|
||||||
|
*/
|
||||||
unsigned char lcdtime_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
unsigned char lcdtime_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
||||||
{
|
{
|
||||||
unsigned char readval;
|
unsigned char readval;
|
||||||
@@ -181,6 +207,12 @@ unsigned char lcdtime_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
|||||||
((readval & ACK) / ACK)) & ~p->stuckinputs; /* pin 10 */
|
((readval & ACK) / ACK)) & ~p->stuckinputs; /* pin 10 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set output port.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param data Value the output port shall be set to.
|
||||||
|
*/
|
||||||
void lcdtime_HD44780_output(PrivateData *p, int data)
|
void lcdtime_HD44780_output(PrivateData *p, int data)
|
||||||
{
|
{
|
||||||
// Setup data bus
|
// Setup data bus
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ void ftdi_HD44780_close(PrivateData *p);
|
|||||||
/**
|
/**
|
||||||
* Initialize the driver.
|
* Initialize the driver.
|
||||||
* \param drvthis Pointer to driver structure.
|
* \param drvthis Pointer to driver structure.
|
||||||
* \retval 0 Success.
|
* \retval 0 Success.
|
||||||
* \retval -1 Error.
|
* \retval -1 Error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
hd_init_ftdi(Driver *drvthis)
|
hd_init_ftdi(Driver *drvthis)
|
||||||
@@ -145,7 +145,13 @@ hd_init_ftdi(Driver *drvthis)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ftdi_HD44780_senddata
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
ftdi_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
ftdi_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
@@ -209,6 +215,11 @@ ftdi_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char fla
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
ftdi_HD44780_backlight(PrivateData *p, unsigned char state)
|
ftdi_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
@@ -227,6 +238,10 @@ ftdi_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the driver (do necessary clean-up).
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
ftdi_HD44780_close(PrivateData *p)
|
ftdi_HD44780_close(PrivateData *p)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -108,7 +108,13 @@ i2c_out(PrivateData *p, unsigned char val)
|
|||||||
|
|
||||||
#define DEFAULT_DEVICE "/dev/i2c-0"
|
#define DEFAULT_DEVICE "/dev/i2c-0"
|
||||||
|
|
||||||
// initialisation function
|
|
||||||
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
hd_init_i2c(Driver *drvthis)
|
hd_init_i2c(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -209,7 +215,14 @@ hd_init_i2c(Driver *drvthis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// i2c_HD44780_senddata
|
|
||||||
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
i2c_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
i2c_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
@@ -243,6 +256,12 @@ i2c_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flag
|
|||||||
i2c_out(p, portControl | l);
|
i2c_out(p, portControl | l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void i2c_HD44780_backlight(PrivateData *p, unsigned char state)
|
void i2c_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
p->backlight_bit = ((!p->have_backlight||state) ? 0 : BL);
|
p->backlight_bit = ((!p->have_backlight||state) ? 0 : BL);
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ void lcd2usb_HD44780_set_contrast(PrivateData *p, unsigned char value);
|
|||||||
/**
|
/**
|
||||||
* Initialize the driver.
|
* Initialize the driver.
|
||||||
* \param drvthis Pointer to driver structure.
|
* \param drvthis Pointer to driver structure.
|
||||||
* \retval 0 Success.
|
* \retval 0 Success.
|
||||||
* \retval -1 Error.
|
* \retval -1 Error.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
hd_init_lcd2usb(Driver *drvthis)
|
hd_init_lcd2usb(Driver *drvthis)
|
||||||
@@ -121,7 +121,7 @@ lcd2usb_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Turn the LCD backlight on or off.
|
* Turn display backlight on or off.
|
||||||
* \param p Pointer to driver's private data structure.
|
* \param p Pointer to driver's private data structure.
|
||||||
* \param state New backlight status.
|
* \param state New backlight status.
|
||||||
*/
|
*/
|
||||||
@@ -138,7 +138,7 @@ lcd2usb_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Change LCD contrast.
|
* Change display contrast.
|
||||||
* \param p Pointer to driver's private data structure.
|
* \param p Pointer to driver's private data structure.
|
||||||
* \param value New contrast value (one byte).
|
* \param value New contrast value (one byte).
|
||||||
*/
|
*/
|
||||||
@@ -179,7 +179,7 @@ lcd2usb_set_brightness(Driver *drvthis, int state, int promille)
|
|||||||
/**
|
/**
|
||||||
* Read keypress.
|
* Read keypress.
|
||||||
* \param p Pointer to driver's private data structure.
|
* \param p Pointer to driver's private data structure.
|
||||||
* \return Bitmap of the pressed keys.
|
* \return Bitmap of the pressed keys.
|
||||||
*/
|
*/
|
||||||
unsigned char
|
unsigned char
|
||||||
lcd2usb_HD44780_scankeypad(PrivateData *p)
|
lcd2usb_HD44780_scankeypad(PrivateData *p)
|
||||||
|
|||||||
@@ -60,7 +60,12 @@ static void setLIS2Fans(int fd, int fan1, int fan2, int fan3, int fan4);
|
|||||||
static void writeChar(int fd, unsigned char code);
|
static void writeChar(int fd, unsigned char code);
|
||||||
|
|
||||||
|
|
||||||
// initialise the driver
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int hd_init_lis2(Driver *drvthis)
|
int hd_init_lis2(Driver *drvthis)
|
||||||
{
|
{
|
||||||
PrivateData *p = (PrivateData*) drvthis->private_data;
|
PrivateData *p = (PrivateData*) drvthis->private_data;
|
||||||
@@ -127,6 +132,13 @@ int hd_init_lis2(Driver *drvthis)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void lis2_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
void lis2_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
static int mode = 0;
|
static int mode = 0;
|
||||||
@@ -288,8 +300,8 @@ static void setLIS2CustomCharRow(int fd, unsigned char custom, unsigned char row
|
|||||||
* \param fd File handle to read from.
|
* \param fd File handle to read from.
|
||||||
* \param temps Pointer to pre-allocated array to store the temperatures.
|
* \param temps Pointer to pre-allocated array to store the temperatures.
|
||||||
* \param num Length of temperature array.
|
* \param num Length of temperature array.
|
||||||
* \retval 0 Error.
|
* \retval 0 Error.
|
||||||
* \retval 1 Temperatures read successfully.
|
* \retval 1 Temperatures read successfully.
|
||||||
*/
|
*/
|
||||||
static char readMPlayTemps(int fd, int *temps, int num)
|
static char readMPlayTemps(int fd, int *temps, int num)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -128,7 +128,13 @@ void serial_HD44780_backlight(PrivateData *p, unsigned char state);
|
|||||||
unsigned char serial_HD44780_scankeypad(PrivateData *p);
|
unsigned char serial_HD44780_scankeypad(PrivateData *p);
|
||||||
void serial_HD44780_close(PrivateData *p);
|
void serial_HD44780_close(PrivateData *p);
|
||||||
|
|
||||||
// initialize the driver
|
|
||||||
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
hd_init_serial(Driver *drvthis)
|
hd_init_serial(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -235,7 +241,14 @@ hd_init_serial(Driver *drvthis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// serial_HD44780_senddata
|
|
||||||
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
serial_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
serial_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
@@ -260,6 +273,12 @@ serial_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char f
|
|||||||
lastdisplayID = displayID;
|
lastdisplayID = displayID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
serial_HD44780_backlight(PrivateData *p, unsigned char state)
|
serial_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
@@ -279,6 +298,12 @@ serial_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read keypress.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \return Bitmap of the pressed keys.
|
||||||
|
*/
|
||||||
unsigned char
|
unsigned char
|
||||||
serial_HD44780_scankeypad(PrivateData *p)
|
serial_HD44780_scankeypad(PrivateData *p)
|
||||||
{
|
{
|
||||||
@@ -298,6 +323,11 @@ serial_HD44780_scankeypad(PrivateData *p)
|
|||||||
return '\0';
|
return '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the driver (do necessary clean-up).
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
serial_HD44780_close(PrivateData *p)
|
serial_HD44780_close(PrivateData *p)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -64,8 +64,9 @@ void lcdserLpt_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigne
|
|||||||
void lcdserLpt_HD44780_backlight(PrivateData *p, unsigned char state);
|
void lcdserLpt_HD44780_backlight(PrivateData *p, unsigned char state);
|
||||||
|
|
||||||
unsigned char lcdserLpt_HD44780_scankeypad(PrivateData *p);
|
unsigned char lcdserLpt_HD44780_scankeypad(PrivateData *p);
|
||||||
void rawshift(PrivateData *p, unsigned char r);
|
|
||||||
void shiftreg(PrivateData *p, unsigned char displayID, unsigned char r);
|
static void rawshift(PrivateData *p, unsigned char r);
|
||||||
|
static void shiftreg(PrivateData *p, unsigned char displayID, unsigned char r);
|
||||||
|
|
||||||
#define RS 32
|
#define RS 32
|
||||||
#define LCDDATA 8
|
#define LCDDATA 8
|
||||||
@@ -73,7 +74,13 @@ void shiftreg(PrivateData *p, unsigned char displayID, unsigned char r);
|
|||||||
#define EN1 4
|
#define EN1 4
|
||||||
#define EN2 32
|
#define EN2 32
|
||||||
|
|
||||||
// Initialisation
|
|
||||||
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
hd_init_serialLpt(Driver *drvthis)
|
hd_init_serialLpt(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -112,6 +119,14 @@ hd_init_serialLpt(Driver *drvthis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
lcdserLpt_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
lcdserLpt_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
@@ -138,6 +153,12 @@ lcdserLpt_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned cha
|
|||||||
port_out(p->port, p->backlight_bit);
|
port_out(p->port, p->backlight_bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
lcdserLpt_HD44780_backlight(PrivateData *p, unsigned char state)
|
lcdserLpt_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
@@ -148,6 +169,12 @@ lcdserLpt_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
port_out(p->port, p->backlight_bit);
|
port_out(p->port, p->backlight_bit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read keypress.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \return Bitmap of the pressed keys.
|
||||||
|
*/
|
||||||
unsigned char lcdserLpt_HD44780_scankeypad(PrivateData *p)
|
unsigned char lcdserLpt_HD44780_scankeypad(PrivateData *p)
|
||||||
{
|
{
|
||||||
// Unfortunately just bit shifting does not work with the 2-wire version...
|
// Unfortunately just bit shifting does not work with the 2-wire version...
|
||||||
@@ -258,7 +285,7 @@ unsigned char lcdserLpt_HD44780_scankeypad(PrivateData *p)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* this function sends r out onto the shift register */
|
/* this function sends r out onto the shift register */
|
||||||
void
|
static void
|
||||||
rawshift(PrivateData *p, unsigned char r)
|
rawshift(PrivateData *p, unsigned char r)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -270,7 +297,7 @@ rawshift(PrivateData *p, unsigned char r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// enableLines = value on parallel port to toggle the correct display
|
// enableLines = value on parallel port to toggle the correct display
|
||||||
void
|
static void
|
||||||
shiftreg(PrivateData *p, unsigned char enableLines, unsigned char r)
|
shiftreg(PrivateData *p, unsigned char enableLines, unsigned char r)
|
||||||
{
|
{
|
||||||
rawshift(p, r | 0x80); // highest bit always set to 1 for Clear for 2-wire version
|
rawshift(p, r | 0x80); // highest bit always set to 1 for Clear for 2-wire version
|
||||||
|
|||||||
@@ -114,10 +114,9 @@ int uss720_set_1284_mode(usb_dev_handle *usbHandle, unsigned int mode);
|
|||||||
/**
|
/**
|
||||||
* Initialize the driver.
|
* Initialize the driver.
|
||||||
* \param drvthis Pointer to driver structure.
|
* \param drvthis Pointer to driver structure.
|
||||||
* \retval 0 Success.
|
* \retval 0 Success.
|
||||||
* \retval -1 Error.
|
* \retval -1 Error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
int
|
int
|
||||||
hd_init_uss720(Driver *drvthis)
|
hd_init_uss720(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -248,6 +247,12 @@ uss720_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char f
|
|||||||
uss720_set_1284_register(p->usbHandle, ControlRegAdr, portControl ^ OUTMASK);
|
uss720_set_1284_register(p->usbHandle, ControlRegAdr, portControl ^ OUTMASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
uss720_HD44780_backlight(PrivateData *p, unsigned char state)
|
uss720_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
@@ -255,6 +260,10 @@ uss720_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Close the driver (do necessary clean-up).
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
uss720_HD44780_close(PrivateData *p)
|
uss720_HD44780_close(PrivateData *p)
|
||||||
{
|
{
|
||||||
@@ -267,8 +276,8 @@ uss720_HD44780_close(PrivateData *p)
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Pause as needed (= a long time).
|
* Pause as needed (= a long time).
|
||||||
* \param drvthis Pointer to driver structure.
|
* \param p Pointer to driver's private data structure.
|
||||||
* \param value pause duration value (integer).
|
* \param usecs Pause duration.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
uss720_HD44780_uPause(PrivateData *p, int usecs)
|
uss720_HD44780_uPause(PrivateData *p, int usecs)
|
||||||
@@ -289,11 +298,11 @@ uss720_get_1284_register(usb_dev_handle *usbHandle, unsigned int regIndex, unsig
|
|||||||
res = usb_control_msg(usbHandle,
|
res = usb_control_msg(usbHandle,
|
||||||
/* bmRequestType */ 0xc0,/*USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,*/
|
/* bmRequestType */ 0xc0,/*USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,*/
|
||||||
/* bRequest */ 3,
|
/* bRequest */ 3,
|
||||||
/* wValue */ (unsigned int)regIndex<<8,
|
/* wValue */ (unsigned int)regIndex<<8,
|
||||||
/* wIndex */ 0,
|
/* wIndex */ 0,
|
||||||
/* Data */ (char *)regData,
|
/* Data */ (char *)regData,
|
||||||
/* wLength */ 7,
|
/* wLength */ 7,
|
||||||
10000 );
|
10000 );
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
|
||||||
@@ -311,11 +320,11 @@ uss720_set_1284_register(usb_dev_handle *usbHandle, unsigned int regAddress, uns
|
|||||||
return usb_control_msg(usbHandle,
|
return usb_control_msg(usbHandle,
|
||||||
/* bmRequestType */ 0x40,/*USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,*/
|
/* bmRequestType */ 0x40,/*USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,*/
|
||||||
/* bRequest */ 4,
|
/* bRequest */ 4,
|
||||||
/* wValue */ ((unsigned int)regAddress<<8 | (unsigned int) value),
|
/* wValue */ ((unsigned int)regAddress<<8 | (unsigned int) value),
|
||||||
/* wIndex */ 0,
|
/* wIndex */ 0,
|
||||||
/* Data */ NULL,
|
/* Data */ NULL,
|
||||||
/* wLength */ 0,
|
/* wLength */ 0,
|
||||||
10000 );
|
10000 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,13 @@ void lcdwinamp_HD44780_output(PrivateData *p, int data);
|
|||||||
|
|
||||||
static const unsigned char EnMask[] = { EN1, EN2, EN3 };
|
static const unsigned char EnMask[] = { EN1, EN2, EN3 };
|
||||||
|
|
||||||
// initialise the driver
|
|
||||||
|
/**
|
||||||
|
* Initialize the driver.
|
||||||
|
* \param drvthis Pointer to driver structure.
|
||||||
|
* \retval 0 Success.
|
||||||
|
* \retval -1 Error.
|
||||||
|
*/
|
||||||
int
|
int
|
||||||
hd_init_winamp(Driver *drvthis)
|
hd_init_winamp(Driver *drvthis)
|
||||||
{
|
{
|
||||||
@@ -125,7 +131,14 @@ hd_init_winamp(Driver *drvthis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// lcdwinamp_HD44780_senddata
|
|
||||||
|
/**
|
||||||
|
* Send data or commands to the display.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param displayID ID of the display (or 0 for all) to send data to.
|
||||||
|
* \param flags Defines whether to end a command or data.
|
||||||
|
* \param ch The value to send.
|
||||||
|
*/
|
||||||
void
|
void
|
||||||
lcdwinamp_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
lcdwinamp_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned char flags, unsigned char ch)
|
||||||
{
|
{
|
||||||
@@ -170,6 +183,12 @@ lcdwinamp_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigned cha
|
|||||||
// 10 nS data hold time provided by the length of ISA write for EN
|
// 10 nS data hold time provided by the length of ISA write for EN
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turn display backlight on or off.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param state New backlight status.
|
||||||
|
*/
|
||||||
void lcdwinamp_HD44780_backlight(PrivateData *p, unsigned char state)
|
void lcdwinamp_HD44780_backlight(PrivateData *p, unsigned char state)
|
||||||
{
|
{
|
||||||
p->backlight_bit = (state?0:nSEL);
|
p->backlight_bit = (state?0:nSEL);
|
||||||
@@ -177,6 +196,13 @@ void lcdwinamp_HD44780_backlight(PrivateData *p, unsigned char state)
|
|||||||
port_out(p->port + 2, p->backlight_bit ^ OUTMASK);
|
port_out(p->port + 2, p->backlight_bit ^ OUTMASK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read keypress.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param YData ???
|
||||||
|
* \return Bitmap of the pressed keys.
|
||||||
|
*/
|
||||||
unsigned char lcdwinamp_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
unsigned char lcdwinamp_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
||||||
{
|
{
|
||||||
unsigned char readval;
|
unsigned char readval;
|
||||||
@@ -198,6 +224,12 @@ unsigned char lcdwinamp_HD44780_readkeypad(PrivateData *p, unsigned int YData)
|
|||||||
((readval & ACK) / ACK )) & ~p->stuckinputs; /* pin 10 */
|
((readval & ACK) / ACK )) & ~p->stuckinputs; /* pin 10 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set output port.
|
||||||
|
* \param p Pointer to driver's private data structure.
|
||||||
|
* \param data Value the output port shall be set to.
|
||||||
|
*/
|
||||||
void lcdwinamp_HD44780_output(PrivateData *p, int data)
|
void lcdwinamp_HD44780_output(PrivateData *p, int data)
|
||||||
{
|
{
|
||||||
// Setup data bus
|
// Setup data bus
|
||||||
|
|||||||
@@ -131,8 +131,8 @@ static int parse_span_list(int *spanListArray[], int *spLsize, int *dispOffsets[
|
|||||||
* Initialize common part of drive & call sub-initialization
|
* Initialize common part of drive & call sub-initialization
|
||||||
* routine depending on connection type.
|
* routine depending on connection type.
|
||||||
* \param drvthis Pointer to driver structure.
|
* \param drvthis Pointer to driver structure.
|
||||||
* \retval 0 Success.
|
* \retval 0 Success.
|
||||||
* \retval <0 Error.
|
* \retval <0 Error.
|
||||||
*/
|
*/
|
||||||
MODULE_EXPORT int
|
MODULE_EXPORT int
|
||||||
HD44780_init(Driver *drvthis)
|
HD44780_init(Driver *drvthis)
|
||||||
|
|||||||
Reference in New Issue
Block a user