2011-02-13 17:50:29 +00:00
|
|
|
/** \file server/drivers/pylcd.h
|
|
|
|
|
* This is the header file of the LCDproc driver for the "pyramid" LCD device
|
|
|
|
|
* from Pyramid.
|
|
|
|
|
*/
|
2005-12-15 09:39:26 +00:00
|
|
|
|
2011-02-13 17:50:29 +00:00
|
|
|
/*-
|
|
|
|
|
* Copyright (C) 2005 Silvan Marco Fin <silvan@kernelconcepts.de>
|
|
|
|
|
* 2006 coresystems GmbH <info@coresystems.de>
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
2005-12-15 09:39:26 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef PYLCD_H
|
|
|
|
|
#define PYLCD_H
|
|
|
|
|
|
2011-02-13 17:50:29 +00:00
|
|
|
#define MAXCOUNT 10 /* Size of read buffer including NUL */
|
2005-12-15 09:39:26 +00:00
|
|
|
|
2011-02-13 17:50:29 +00:00
|
|
|
/* Display properties */
|
2005-12-15 09:39:26 +00:00
|
|
|
#define WIDTH 16
|
|
|
|
|
#define HEIGHT 2
|
2011-02-13 17:50:29 +00:00
|
|
|
#define SCREEN_SIZE (WIDTH * HEIGHT)
|
2006-04-24 15:45:35 +00:00
|
|
|
#define CUSTOMCHARS 8
|
2006-04-13 15:14:34 +00:00
|
|
|
#define CELLHEIGHT 8
|
|
|
|
|
#define CELLWIDTH 5
|
|
|
|
|
|
2008-12-21 17:15:03 +00:00
|
|
|
/** private data for the \c pyramid driver */
|
|
|
|
|
typedef struct pyramid_private_data {
|
2006-04-13 15:14:34 +00:00
|
|
|
/* device io */
|
2005-12-15 09:39:26 +00:00
|
|
|
int FD;
|
2006-04-12 16:04:06 +00:00
|
|
|
char device[255];
|
2005-12-15 09:39:26 +00:00
|
|
|
fd_set rdfs;
|
|
|
|
|
struct timeval timeout;
|
2006-04-13 15:14:34 +00:00
|
|
|
|
|
|
|
|
/* device description */
|
|
|
|
|
int width;
|
|
|
|
|
int height;
|
|
|
|
|
int customchars;
|
|
|
|
|
int cellwidth;
|
|
|
|
|
int cellheight;
|
|
|
|
|
|
|
|
|
|
/* output handling */
|
2011-02-13 17:50:29 +00:00
|
|
|
char framebuffer[SCREEN_SIZE];
|
|
|
|
|
char backingstore[SCREEN_SIZE];
|
|
|
|
|
CGmode ccmode;
|
|
|
|
|
unsigned char cc_cache[CUSTOMCHARS][CELLHEIGHT];
|
2006-04-13 15:14:34 +00:00
|
|
|
|
|
|
|
|
/* button handling */
|
2005-12-15 09:39:26 +00:00
|
|
|
char last_key_pressed[6];
|
|
|
|
|
unsigned long long last_key_time;
|
2006-04-13 15:14:34 +00:00
|
|
|
|
|
|
|
|
/* cursor handling */
|
2005-12-15 09:39:26 +00:00
|
|
|
int C_x;
|
|
|
|
|
int C_y;
|
|
|
|
|
int C_state;
|
2006-04-13 15:14:34 +00:00
|
|
|
|
|
|
|
|
/* led handling */
|
2008-10-08 20:19:37 +00:00
|
|
|
char led[8];
|
2006-04-13 15:14:34 +00:00
|
|
|
|
2006-04-12 16:04:06 +00:00
|
|
|
} PrivateData;
|
2005-12-15 09:39:26 +00:00
|
|
|
|
2011-02-13 17:50:29 +00:00
|
|
|
MODULE_EXPORT int pyramid_init(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT void pyramid_close(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT int pyramid_width(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT int pyramid_height(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT int pyramid_cellwidth(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT int pyramid_cellheight(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT void pyramid_clear(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT void pyramid_flush(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT void pyramid_string(Driver *drvthis, int x, int y, const char string[]);
|
|
|
|
|
MODULE_EXPORT void pyramid_chr(Driver *drvthis, int x, int y, char c);
|
|
|
|
|
MODULE_EXPORT void pyramid_vbar(Driver *drvthis, int x, int y, int len, int promille, int options);
|
|
|
|
|
MODULE_EXPORT void pyramid_hbar(Driver *drvthis, int x, int y, int len, int promille, int options);
|
|
|
|
|
MODULE_EXPORT int pyramid_icon(Driver *drvthis, int x, int y, int icon);
|
|
|
|
|
MODULE_EXPORT void pyramid_cursor(Driver *drvthis, int x, int y, int state);
|
|
|
|
|
MODULE_EXPORT int pyramid_get_free_chars(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT void pyramid_set_char(Driver *drvthis, int n, unsigned char *dat);
|
|
|
|
|
MODULE_EXPORT void pyramid_output(Driver *drvthis, int state);
|
|
|
|
|
MODULE_EXPORT const char *pyramid_get_key(Driver *drvthis);
|
|
|
|
|
MODULE_EXPORT const char *pyramid_get_info(Driver *drvthis);
|
2011-02-10 22:53:15 +00:00
|
|
|
|
2005-12-15 09:39:26 +00:00
|
|
|
#endif
|