convert 2 further drivers to bignum library
This commit is contained in:
@@ -22,16 +22,74 @@
|
||||
|
||||
#include "lcd.h"
|
||||
|
||||
#define DEFAULT_CELL_WIDTH 5
|
||||
#define DEFAULT_CELL_HEIGHT 8
|
||||
#define DEFAULT_DEVICE "/dev/lcd"
|
||||
#define DEFAULT_SPEED 9600
|
||||
#define DEFAULT_SIZE "16x2"
|
||||
#define DEFAULT_CELL_WIDTH 5
|
||||
#define DEFAULT_CELL_HEIGHT 8
|
||||
#define DEFAULT_DEVICE "/dev/lcd"
|
||||
#define DEFAULT_SPEED 9600
|
||||
#define DEFAULT_SIZE "16x2"
|
||||
|
||||
#define TYAN_LCDM_KEY_ENTER 0xF2
|
||||
#define TYAN_LCDM_KEY_ESCAPE 0xF3
|
||||
#define TYAN_LCDM_KEY_RIGHT 0xF5
|
||||
#define TYAN_LCDM_KEY_LEFT 0xF6
|
||||
#define TYAN_LCDM_KEY_UP 0xF7
|
||||
#define TYAN_LCDM_KEY_DOWN 0xF8
|
||||
|
||||
#define TYAN_LCDM_CMD_BEGIN 0xF1
|
||||
#define TYAN_LCDM_CMD_END 0xF2
|
||||
|
||||
|
||||
/* Constants for userdefchar_mode */
|
||||
#define NUM_CCs 8 /* max. number of custom characters */
|
||||
|
||||
typedef enum {
|
||||
standard, /* only char 0 is used for heartbeat */
|
||||
vbar, /* vertical bars */
|
||||
hbar, /* horizontaln bars */
|
||||
bignum, /* big numbers */
|
||||
bigchar, /* big characters */
|
||||
custom /* custom icons */
|
||||
} CGmode;
|
||||
|
||||
|
||||
typedef struct cgram_cache {
|
||||
unsigned char cache[LCD_DEFAULT_CELLHEIGHT];
|
||||
int clean;
|
||||
} CGram;
|
||||
|
||||
|
||||
typedef struct driver_private_data {
|
||||
char device[200];
|
||||
int speed;
|
||||
int fd;
|
||||
|
||||
unsigned char *framebuf;
|
||||
unsigned char *backingstore;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int cellwidth;
|
||||
int cellheight;
|
||||
|
||||
/* defineable characters */
|
||||
CGram cc[NUM_CCs];
|
||||
CGmode ccmode;
|
||||
} PrivateData;
|
||||
|
||||
|
||||
/* API: variables for the server core */
|
||||
MODULE_EXPORT char *api_version = API_VERSION;
|
||||
MODULE_EXPORT int stay_in_foreground = 0;
|
||||
MODULE_EXPORT int supports_multiple = 0;
|
||||
MODULE_EXPORT char *symbol_prefix = "tyan_lcdm_";
|
||||
|
||||
/* API: functions for the server core */
|
||||
MODULE_EXPORT int tyan_lcdm_init (Driver * drvthis, char *device);
|
||||
MODULE_EXPORT void tyan_lcdm_close (Driver * drvthis);
|
||||
MODULE_EXPORT int tyan_lcdm_width (Driver * drvthis);
|
||||
MODULE_EXPORT int tyan_lcdm_height (Driver * drvthis);
|
||||
MODULE_EXPORT int tyan_lcdm_cellwidth (Driver * drvthis);
|
||||
MODULE_EXPORT int tyan_lcdm_cellheight (Driver * drvthis);
|
||||
MODULE_EXPORT void tyan_lcdm_clear (Driver * drvthis);
|
||||
MODULE_EXPORT void tyan_lcdm_flush (Driver * drvthis);
|
||||
MODULE_EXPORT void tyan_lcdm_string (Driver * drvthis, int x, int y, char string[]);
|
||||
@@ -42,7 +100,8 @@ MODULE_EXPORT void tyan_lcdm_hbar (Driver * drvthis, int x, int y, int len, int
|
||||
MODULE_EXPORT void tyan_lcdm_num (Driver * drvthis, int x, int num);
|
||||
MODULE_EXPORT int tyan_lcdm_icon(Driver * drvthis, int x, int y, int icon);
|
||||
|
||||
MODULE_EXPORT void tyan_lcdm_set_char (Driver * drvthis, int n, char *dat);
|
||||
MODULE_EXPORT int tyan_lcdm_get_free_chars (Driver *drvthis);
|
||||
MODULE_EXPORT void tyan_lcdm_set_char (Driver * drvthis, int n, unsigned char *dat);
|
||||
|
||||
MODULE_EXPORT void tyan_lcdm_backlight (Driver * drvthis, int on);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user