Doxygen-ize

This commit is contained in:
marschap
2008-12-21 14:58:51 +00:00
parent 175e4c7b4f
commit b54a4e3706
13 changed files with 274 additions and 47 deletions
+28 -2
View File
@@ -93,7 +93,13 @@ static const unsigned char EnMask[] = { EN1, EN2, EN3, STRB, LF, INIT, SEL };
#define ALLEXT (STRB|LF|INIT|SEL)
// 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
hd_init_4bit(Driver *drvthis)
{
@@ -169,7 +175,14 @@ hd_init_4bit(Driver *drvthis)
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
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)
{
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);
}
/**
* 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 readval;
+2 -2
View File
@@ -42,8 +42,8 @@ void bwct_usb_HD44780_close(PrivateData *p);
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
* \retval 0 Success.
* \retval -1 Error.
*/
int
hd_init_bwct_usb(Driver *drvthis)
+27 -2
View File
@@ -35,7 +35,12 @@ void ethlcd_HD44780_close(PrivateData *p);
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)
{
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)
{
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 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)
{
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)
{
sock_close(p->sock);
+34 -2
View File
@@ -81,7 +81,13 @@ void lcdtime_HD44780_output(PrivateData *p, int data);
static int semid;
// initialise the driver
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
*/
int
hd_init_ext8bit(Driver *drvthis)
{
@@ -116,7 +122,14 @@ hd_init_ext8bit(Driver *drvthis)
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
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);
}
/**
* 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)
{
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);
}
/**
* 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 readval;
@@ -181,6 +207,12 @@ unsigned char lcdtime_HD44780_readkeypad(PrivateData *p, unsigned int YData)
((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)
{
// Setup data bus
+18 -3
View File
@@ -57,8 +57,8 @@ void ftdi_HD44780_close(PrivateData *p);
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
* \retval 0 Success.
* \retval -1 Error.
*/
int
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
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
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
ftdi_HD44780_close(PrivateData *p)
{
+21 -2
View File
@@ -108,7 +108,13 @@ i2c_out(PrivateData *p, unsigned char val)
#define DEFAULT_DEVICE "/dev/i2c-0"
// initialisation function
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
*/
int
hd_init_i2c(Driver *drvthis)
{
@@ -209,7 +215,14 @@ hd_init_i2c(Driver *drvthis)
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
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);
}
/**
* 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)
{
p->backlight_bit = ((!p->have_backlight||state) ? 0 : BL);
+5 -5
View File
@@ -36,8 +36,8 @@ void lcd2usb_HD44780_set_contrast(PrivateData *p, unsigned char value);
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
* \retval 0 Success.
* \retval -1 Error.
*/
int
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 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 value New contrast value (one byte).
*/
@@ -179,7 +179,7 @@ lcd2usb_set_brightness(Driver *drvthis, int state, int promille)
/**
* Read keypress.
* \param p Pointer to driver's private data structure.
* \return Bitmap of the pressed keys.
* \return Bitmap of the pressed keys.
*/
unsigned char
lcd2usb_HD44780_scankeypad(PrivateData *p)
+15 -3
View File
@@ -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);
// initialise the driver
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
*/
int hd_init_lis2(Driver *drvthis)
{
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)
{
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 temps Pointer to pre-allocated array to store the temperatures.
* \param num Length of temperature array.
* \retval 0 Error.
* \retval 1 Temperatures read successfully.
* \retval 0 Error.
* \retval 1 Temperatures read successfully.
*/
static char readMPlayTemps(int fd, int *temps, int num)
{
+32 -2
View File
@@ -128,7 +128,13 @@ void serial_HD44780_backlight(PrivateData *p, unsigned char state);
unsigned char serial_HD44780_scankeypad(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
hd_init_serial(Driver *drvthis)
{
@@ -235,7 +241,14 @@ hd_init_serial(Driver *drvthis)
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
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;
}
/**
* Turn display backlight on or off.
* \param p Pointer to driver's private data structure.
* \param state New backlight status.
*/
void
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
serial_HD44780_scankeypad(PrivateData *p)
{
@@ -298,6 +323,11 @@ serial_HD44780_scankeypad(PrivateData *p)
return '\0';
}
/**
* Close the driver (do necessary clean-up).
* \param p Pointer to driver's private data structure.
*/
void
serial_HD44780_close(PrivateData *p)
{
+32 -5
View File
@@ -64,8 +64,9 @@ void lcdserLpt_HD44780_senddata(PrivateData *p, unsigned char displayID, unsigne
void lcdserLpt_HD44780_backlight(PrivateData *p, unsigned char state);
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 LCDDATA 8
@@ -73,7 +74,13 @@ void shiftreg(PrivateData *p, unsigned char displayID, unsigned char r);
#define EN1 4
#define EN2 32
// Initialisation
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
*/
int
hd_init_serialLpt(Driver *drvthis)
{
@@ -112,6 +119,14 @@ hd_init_serialLpt(Driver *drvthis)
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
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);
}
/**
* Turn display backlight on or off.
* \param p Pointer to driver's private data structure.
* \param state New backlight status.
*/
void
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);
}
/**
* Read keypress.
* \param p Pointer to driver's private data structure.
* \return Bitmap of the pressed keys.
*/
unsigned char lcdserLpt_HD44780_scankeypad(PrivateData *p)
{
// 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 */
void
static void
rawshift(PrivateData *p, unsigned char r)
{
int i;
@@ -270,7 +297,7 @@ rawshift(PrivateData *p, unsigned char r)
}
// enableLines = value on parallel port to toggle the correct display
void
static void
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
+24 -15
View File
@@ -114,10 +114,9 @@ int uss720_set_1284_mode(usb_dev_handle *usbHandle, unsigned int mode);
/**
* Initialize the driver.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval -1 Error.
* \retval 0 Success.
* \retval -1 Error.
*/
int
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);
}
/**
* Turn display backlight on or off.
* \param p Pointer to driver's private data structure.
* \param state New backlight status.
*/
void
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
uss720_HD44780_close(PrivateData *p)
{
@@ -267,8 +276,8 @@ uss720_HD44780_close(PrivateData *p)
/**
* Pause as needed (= a long time).
* \param drvthis Pointer to driver structure.
* \param value pause duration value (integer).
* \param p Pointer to driver's private data structure.
* \param usecs Pause duration.
*/
static void
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,
/* bmRequestType */ 0xc0,/*USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,*/
/* bRequest */ 3,
/* wValue */ (unsigned int)regIndex<<8,
/* wIndex */ 0,
/* Data */ (char *)regData,
/* wLength */ 7,
10000 );
/* wValue */ (unsigned int)regIndex<<8,
/* wIndex */ 0,
/* Data */ (char *)regData,
/* wLength */ 7,
10000 );
if (res) {
@@ -311,11 +320,11 @@ uss720_set_1284_register(usb_dev_handle *usbHandle, unsigned int regAddress, uns
return usb_control_msg(usbHandle,
/* bmRequestType */ 0x40,/*USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,*/
/* bRequest */ 4,
/* wValue */ ((unsigned int)regAddress<<8 | (unsigned int) value),
/* wIndex */ 0,
/* Data */ NULL,
/* wLength */ 0,
10000 );
/* wValue */ ((unsigned int)regAddress<<8 | (unsigned int) value),
/* wIndex */ 0,
/* Data */ NULL,
/* wLength */ 0,
10000 );
}
+34 -2
View File
@@ -92,7 +92,13 @@ void lcdwinamp_HD44780_output(PrivateData *p, int data);
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
hd_init_winamp(Driver *drvthis)
{
@@ -125,7 +131,14 @@ hd_init_winamp(Driver *drvthis)
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
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
}
/**
* 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)
{
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);
}
/**
* 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 readval;
@@ -198,6 +224,12 @@ unsigned char lcdwinamp_HD44780_readkeypad(PrivateData *p, unsigned int YData)
((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)
{
// Setup data bus
+2 -2
View File
@@ -131,8 +131,8 @@ static int parse_span_list(int *spanListArray[], int *spLsize, int *dispOffsets[
* Initialize common part of drive & call sub-initialization
* routine depending on connection type.
* \param drvthis Pointer to driver structure.
* \retval 0 Success.
* \retval <0 Error.
* \retval 0 Success.
* \retval <0 Error.
*/
MODULE_EXPORT int
HD44780_init(Driver *drvthis)