add serialVFD driver provided by Stefan Herdler
This commit is contained in:
@@ -41,6 +41,7 @@ Driver=CFontzPacket
|
|||||||
#Driver=glcdlib
|
#Driver=glcdlib
|
||||||
#Driver=imon
|
#Driver=imon
|
||||||
#Driver=NoritakeVFD
|
#Driver=NoritakeVFD
|
||||||
|
#Driver=serialVFD
|
||||||
|
|
||||||
# Tells the driver to bind to the given interface
|
# Tells the driver to bind to the given interface
|
||||||
Bind=127.0.0.1
|
Bind=127.0.0.1
|
||||||
@@ -350,18 +351,6 @@ KeyMatrix_4_3=Down
|
|||||||
KeyMatrix_4_4=Escape
|
KeyMatrix_4_4=Escape
|
||||||
|
|
||||||
|
|
||||||
## Noritake VFD driver ##
|
|
||||||
[NoritakeVFD]
|
|
||||||
# Port where the VFD is. Usual values are /dev/ttyS0 and /dev/ttyS1
|
|
||||||
Device=/dev/ttyS0
|
|
||||||
|
|
||||||
# Specifies the size of the LCD.
|
|
||||||
Size=20x4
|
|
||||||
|
|
||||||
Contrast=255
|
|
||||||
# set the serial port speed [default: 9600]
|
|
||||||
Speed=9600
|
|
||||||
|
|
||||||
|
|
||||||
## ICP A106 driver ##
|
## ICP A106 driver ##
|
||||||
[icp_a106]
|
[icp_a106]
|
||||||
@@ -539,6 +528,20 @@ keypad_test_mode=no
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Noritake VFD driver ##
|
||||||
|
[NoritakeVFD]
|
||||||
|
# Port where the VFD is. Usual values are /dev/ttyS0 and /dev/ttyS1
|
||||||
|
Device=/dev/ttyS0
|
||||||
|
|
||||||
|
# Specifies the size of the LCD.
|
||||||
|
Size=20x4
|
||||||
|
|
||||||
|
Contrast=255
|
||||||
|
# set the serial port speed [default: 9600]
|
||||||
|
Speed=9600
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Pyramid pylcd driver ##
|
## Pyramid pylcd driver ##
|
||||||
[pylcd]
|
[pylcd]
|
||||||
|
|
||||||
@@ -566,6 +569,36 @@ Port=0x378
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Serial VFD driver ##
|
||||||
|
## Drives various (see below) serial 5x7dot VFD's. ##
|
||||||
|
[serialVFD]
|
||||||
|
# Port where the VFD is. Usual values are /dev/ttyS0 and /dev/ttyS1
|
||||||
|
Device=/dev/ttyS1
|
||||||
|
|
||||||
|
# Specifies the size of the VFD.
|
||||||
|
Size=20x2
|
||||||
|
|
||||||
|
# Specifies the displaytype.[default: 0]
|
||||||
|
# 0 NEC (FIPC8367 based) VFDs.
|
||||||
|
# 1 KD Rev 2.1.
|
||||||
|
# 2 Noritake VFDs (*).
|
||||||
|
# 3 Futaba VFDs (*).
|
||||||
|
# (* most should work, not testet yet.)
|
||||||
|
Displaytype=1
|
||||||
|
|
||||||
|
# Display brightness [default: 255].
|
||||||
|
# 0 min ... 255 max ... 1000 also max
|
||||||
|
# (4 steps 0-64, 65-128, 129-192, 193-1000)
|
||||||
|
Brightness=255
|
||||||
|
|
||||||
|
# set the serial port speed [default: 9600]
|
||||||
|
Speed=9600
|
||||||
|
|
||||||
|
# enable ISO 8859 1 compatibility [default: 1]
|
||||||
|
#ISO_8859_1=1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## stv5730 driver ##
|
## stv5730 driver ##
|
||||||
[stv5730]
|
[stv5730]
|
||||||
|
|
||||||
|
|||||||
+7
-3
@@ -8,14 +8,14 @@ AC_ARG_ENABLE(drivers,
|
|||||||
[ bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,]
|
[ bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,]
|
||||||
[ glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,]
|
[ glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,]
|
||||||
[ joy,lb216,lcdm001,lcterm,lirc,ms6931,mtc_s16209x,]
|
[ joy,lb216,lcdm001,lcterm,lirc,ms6931,mtc_s16209x,]
|
||||||
[ MtxOrb,NoritakeVFD,pylcd,sed1330,sed1520,sli,stv5730,]
|
[ MtxOrb,NoritakeVFD,pylcd,sed1330,sed1520,serialVFD,]
|
||||||
[ svga,t6963,text,tyan,xosd]
|
[ sli,stv5730,svga,t6963,text,tyan,xosd]
|
||||||
[ \"all\" compiles all drivers],
|
[ \"all\" compiles all drivers],
|
||||||
drivers="$enableval",
|
drivers="$enableval",
|
||||||
drivers=[bayrad,CFontz,CFontz633,curses,CwLnx,glk,lb216,lcdm001,MtxOrb,pylcd,text])
|
drivers=[bayrad,CFontz,CFontz633,curses,CwLnx,glk,lb216,lcdm001,MtxOrb,pylcd,text])
|
||||||
|
|
||||||
if test "$drivers" = "all"; then
|
if test "$drivers" = "all"; then
|
||||||
drivers=[bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,joy,lb216,lcdm001,lcterm,lirc,ms6931,mtc_s16209x,MtxOrb,NoritakeVFD,pylcd,sed1330,sed1520,sli,stv5730,svga,t6963,text,tyan,xosd]
|
drivers=[bayrad,CFontz,CFontz633,CFontzPacket,curses,CwLnx,glcdlib,glk,hd44780,icp_a106,imon,IOWarrior,irman,joy,lb216,lcdm001,lcterm,lirc,ms6931,mtc_s16209x,MtxOrb,NoritakeVFD,pylcd,sed1330,sed1520,serialVFD,sli,stv5730,svga,t6963,text,tyan,xosd]
|
||||||
fi
|
fi
|
||||||
|
|
||||||
drivers=`echo $drivers | sed 's/,/ /g'`
|
drivers=`echo $drivers | sed 's/,/ /g'`
|
||||||
@@ -236,6 +236,10 @@ dnl else
|
|||||||
AC_MSG_WARN([The sed1520 driver needs a parallel port.])
|
AC_MSG_WARN([The sed1520 driver needs a parallel port.])
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
serialVFD)
|
||||||
|
DRIVERS="$DRIVERS serialVFD${SO}"
|
||||||
|
actdrivers=["$actdrivers serialVFD"]
|
||||||
|
;;
|
||||||
sli)
|
sli)
|
||||||
DRIVERS="$DRIVERS wirz_sli${SO}"
|
DRIVERS="$DRIVERS wirz_sli${SO}"
|
||||||
actdrivers=["$actdrivers sli"]
|
actdrivers=["$actdrivers sli"]
|
||||||
|
|||||||
@@ -0,0 +1,113 @@
|
|||||||
|
The serialVFD-driver should work with all NEC FIPC8367 based VFDs:
|
||||||
|
NEC FC20X2JA
|
||||||
|
NEC FM20X2KB-AB
|
||||||
|
NEC FC20X1SA-AB/AA
|
||||||
|
...
|
||||||
|
Tested only on: NEC FM20X2KB-AB
|
||||||
|
The driver also works (tested) on "KD Rev 2.1" (an ATMEL AT90S....
|
||||||
|
based FM20X2KB-AB replacement).
|
||||||
|
Note: Above char. 128 the FIPC-displays and KD's charactersets
|
||||||
|
are different.
|
||||||
|
|
||||||
|
The driver may work or will be easy to get working on the following
|
||||||
|
Displays / Controllers (not tested!).
|
||||||
|
Display: Controller:
|
||||||
|
FUTABA M204SD01AA FUTABA 5P00A016
|
||||||
|
Noritake CU20026SCPB-T (microcontroller)
|
||||||
|
Noritake CU20045SCPB-T28A ?
|
||||||
|
... or compatible.
|
||||||
|
(most Futaba/Noritake 7x5 dot VFDs with serial(rs232) interface
|
||||||
|
(including serial(rs232)/parallel types))
|
||||||
|
Maybe there are little changes in the commands to do to get all
|
||||||
|
functions to work correctly. But because of the similarity of the
|
||||||
|
protocols, it wont be much work.
|
||||||
|
|
||||||
|
If you want to add a new device to the driver add a new section
|
||||||
|
to the displaytype-switch-case in the init-function and fill it
|
||||||
|
with the corrrect commands for the display.
|
||||||
|
(Try wich displaytype works best with your display, copy and modify
|
||||||
|
it's section that is the easiest way I guess.)
|
||||||
|
|
||||||
|
|
||||||
|
On this page I found pictures and datasheets from the VFD's:
|
||||||
|
http://www.maltepoeggel.de/html/vfd/index.html
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
To enable the bignumbers on 2-line displays (only this driver supports
|
||||||
|
this yet) you have to edit "/clientchrono.c" before compiling.
|
||||||
|
In function "big_clock_screen" you have to replace the "4" by a "2" in
|
||||||
|
this line: "if (lcd_hgt < 4)"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
This driver uses the serial mode of the displays.
|
||||||
|
It is NOT possible to connect most of the displays directly to the
|
||||||
|
serialport. The signal has to be inverted. I use the following
|
||||||
|
circuit to do that job.
|
||||||
|
|
||||||
|
Computer Display
|
||||||
|
(signal)
|
||||||
|
HDD Powerconnector
|
||||||
|
color(Voltage)
|
||||||
|
|
||||||
|
red(+5V) --------------------------------o----- +5V
|
||||||
|
|
|
||||||
|
black(GND) --------------------o |
|
||||||
|
| R
|
||||||
|
| R 10k
|
||||||
|
Serial(SUB-D 9Pin female) V* R
|
||||||
|
pin(signal) |
|
||||||
|
|
|
||||||
|
3(TxD) --RRRR--o--o o-----------------o----- RxD
|
||||||
|
10k | | |
|
||||||
|
| | C|
|
||||||
|
| | ----- BC547c (or similar NPN)
|
||||||
|
R | B| / |
|
||||||
|
10k R o--|-| |
|
||||||
|
R | \ |
|
||||||
|
| --->- A*
|
||||||
|
| E| |
|
||||||
|
| | |
|
||||||
|
5(GND) --------o----------o----o----------------- GND
|
||||||
|
|
||||||
|
Shield ------------------------------------------
|
||||||
|
optional
|
||||||
|
|
||||||
|
*connect near display
|
||||||
|
|
||||||
|
|
||||||
|
The pins on the different displays vary.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
FM20X2KB-AB:
|
||||||
|
|
||||||
|
CN1:
|
||||||
|
Pin 33 <--- RxD
|
||||||
|
(Testmode: connect pins 25 & 26 then power up)
|
||||||
|
|
||||||
|
CN2:
|
||||||
|
Pin 1 <--- +5V
|
||||||
|
Pin 2 ---- GND
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
KD Rev 2.1:
|
||||||
|
|
||||||
|
blue connector (6pin in a row) (the important one!):
|
||||||
|
--------------------------------
|
||||||
|
| +5V +5V RxD GND GND GND |
|
||||||
|
--------------------------------
|
||||||
|
NOTE: hold the display in that position where you can read
|
||||||
|
the "KD Rev 2.1" marking normally!
|
||||||
|
|
||||||
|
gray connector (10pin 2 rows):
|
||||||
|
Do not use. (the ATMEL ISP connector I guess)
|
||||||
|
|
||||||
|
The two jumpers next to the gray connector:
|
||||||
|
Normally not used.
|
||||||
|
You can activate two different testmodes with them.
|
||||||
|
|
||||||
|
|
||||||
@@ -19,8 +19,8 @@ AM_LDFLAGS = @LDSHARED@
|
|||||||
LIBS =
|
LIBS =
|
||||||
|
|
||||||
pkglib_PROGRAMS = @DRIVERS@
|
pkglib_PROGRAMS = @DRIVERS@
|
||||||
EXTRA_PROGRAMS = bayrad CFontz CFontz633 CFontzPacket curses CwLnx glcdlib glk hd44780 icp_a106 imon IOWarrior irman joy lb216 lcdm001 lcterm lirc ms6931 mtc_s16209x MtxOrb NoritakeVFD pylcd sed1330 sed1520 stv5730 svga t6963 text tyan wirz_sli xosd
|
EXTRA_PROGRAMS = bayrad CFontz CFontz633 CFontzPacket curses CwLnx glcdlib glk hd44780 icp_a106 imon IOWarrior irman joy lb216 lcdm001 lcterm lirc ms6931 mtc_s16209x MtxOrb NoritakeVFD pylcd sed1330 sed1520 serialVFD stv5730 svga t6963 text tyan wirz_sli xosd
|
||||||
noinst_LIBRARIES = libLCD.a
|
noinst_LIBRARIES = libLCD.a libbignum.a
|
||||||
|
|
||||||
IOWarrior_CFLAGS = @libusb_cflags@ $(AM_CFLAGS)
|
IOWarrior_CFLAGS = @libusb_cflags@ $(AM_CFLAGS)
|
||||||
hd44780_CFLAGS = @libusb_cflags@ $(AM_CFLAGS)
|
hd44780_CFLAGS = @libusb_cflags@ $(AM_CFLAGS)
|
||||||
@@ -41,12 +41,14 @@ irman_LDADD = @LIBIRMAN@
|
|||||||
lirc_LDADD = @LIBLIRC_CLIENT@
|
lirc_LDADD = @LIBLIRC_CLIENT@
|
||||||
lcterm_LDADD = libLCD.a
|
lcterm_LDADD = libLCD.a
|
||||||
NoritakeVFD_LDADD = libLCD.a
|
NoritakeVFD_LDADD = libLCD.a
|
||||||
|
serialVFD_LDADD = libLCD.a libbignum.a
|
||||||
svga_LDADD = @LIBSVGA@
|
svga_LDADD = @LIBSVGA@
|
||||||
t6963_LDADD = libLCD.a
|
t6963_LDADD = libLCD.a
|
||||||
tyan_LDADD = libLCD.a
|
tyan_LDADD = libLCD.a
|
||||||
xosd_LDADD = @LIBXOSD@
|
xosd_LDADD = @LIBXOSD@
|
||||||
|
|
||||||
libLCD_a_SOURCES = lcd_lib.h lcd_lib.c
|
libLCD_a_SOURCES = lcd_lib.h lcd_lib.c
|
||||||
|
libbignum_a_SOURCES = adv_bignum.h adv_bignum.c
|
||||||
|
|
||||||
bayrad_SOURCES = lcd.h bayrad.h bayrad.c report.h
|
bayrad_SOURCES = lcd.h bayrad.h bayrad.c report.h
|
||||||
CFontz_SOURCES = lcd.h CFontz.c CFontz.h CFontz-charmap.h report.h
|
CFontz_SOURCES = lcd.h CFontz.c CFontz.h CFontz-charmap.h report.h
|
||||||
@@ -74,6 +76,7 @@ NoritakeVFD_SOURCES = lcd.h NoritakeVFD.c NoritakeVFD.h report.h
|
|||||||
pylcd_SOURCES = lcd.h pylcd.c pylcd.h
|
pylcd_SOURCES = lcd.h pylcd.c pylcd.h
|
||||||
sed1330_SOURCES = lcd.h sed1330.h sed1330.c port.h lpt-port.h timing.h report.h
|
sed1330_SOURCES = lcd.h sed1330.h sed1330.c port.h lpt-port.h timing.h report.h
|
||||||
sed1520_SOURCES = lcd.h sed1520.c sed1520.h sed1520fm.c sed1520fm.h port.h report.h
|
sed1520_SOURCES = lcd.h sed1520.c sed1520.h sed1520fm.c sed1520fm.h port.h report.h
|
||||||
|
serialVFD_SOURCES = lcd.h serialVFD.c serialVFD.h report.h adv_bignum.h
|
||||||
stv5730_SOURCES = lcd.h stv5730.c stv5730.h report.h
|
stv5730_SOURCES = lcd.h stv5730.c stv5730.h report.h
|
||||||
svga_SOURCES = lcd.h svgalib_drv.c svgalib_drv.h report.h
|
svga_SOURCES = lcd.h svgalib_drv.c svgalib_drv.h report.h
|
||||||
t6963_SOURCES = lcd.h t6963.c t6963.h t6963_font.h report.h
|
t6963_SOURCES = lcd.h t6963.c t6963.h t6963_font.h report.h
|
||||||
|
|||||||
@@ -0,0 +1,986 @@
|
|||||||
|
/* This is the bignumber-library used by the serialVFD driver.
|
||||||
|
|
||||||
|
Copyright (C) 2006 Stefan Herdler
|
||||||
|
|
||||||
|
Based on drivers.c and lcd-lib.c.
|
||||||
|
It may contain parts of other drivers of this package too.
|
||||||
|
|
||||||
|
2006-01-26 Version 0.1: everything should work (not all hardware tested!)
|
||||||
|
|
||||||
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Demands on the calling driver / display:
|
||||||
|
cellwidth == 5
|
||||||
|
cellheight == 7 or 8 (testet only on 7)
|
||||||
|
needed functions:
|
||||||
|
drvthis->set_char (only if the display has usercharacters)
|
||||||
|
drvthis->chr
|
||||||
|
usercharacters (if available) at 0, 1, 2, ..... ,n
|
||||||
|
|
||||||
|
USAGE:
|
||||||
|
|
||||||
|
Just call lib_adv_bignum(drvthis, x, num, height, do_init, customchars)
|
||||||
|
from drvthis->num.
|
||||||
|
The library does everything needed to show bignumbers EXPECT checking or
|
||||||
|
setting the CCMODE variable. The driver has to do this (see serialVFD.c
|
||||||
|
for details).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
|
//#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
//#include <termios.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "adv_bignum.h"
|
||||||
|
|
||||||
|
#include "report.h"
|
||||||
|
#include "lcd_lib.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_2_0 (Driver *drvthis, int x, int num, int height, int do_init);
|
||||||
|
static void adv_bignum_num_2_1 (Driver *drvthis, int x, int num, int height, int do_init);
|
||||||
|
static void adv_bignum_num_2_2 (Driver *drvthis, int x, int num, int height, int do_init);
|
||||||
|
static void adv_bignum_num_2_5 (Driver *drvthis, int x, int num, int height, int do_init);
|
||||||
|
static void adv_bignum_num_2_28 (Driver *drvthis, int x, int num, int height, int do_init);
|
||||||
|
|
||||||
|
static void adv_bignum_num_4_0 (Driver *drvthis, int x, int num, int height, int do_init);
|
||||||
|
static void adv_bignum_num_4_3 (Driver *drvthis, int x, int num, int height, int do_init);
|
||||||
|
|
||||||
|
static void adv_bignum_write_num (Driver *drvthis, char write_num_map[][4][4], int x, int num, int height);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
lib_adv_bignum(Driver *drvthis, int x, int num, int height, int do_init, int customchars)
|
||||||
|
{
|
||||||
|
|
||||||
|
switch (height) {
|
||||||
|
case 2:
|
||||||
|
case 3:
|
||||||
|
if(customchars == 0){
|
||||||
|
adv_bignum_num_2_0 (drvthis, x, num, height, do_init);
|
||||||
|
}
|
||||||
|
else if(customchars ==1 ){
|
||||||
|
adv_bignum_num_2_1 (drvthis, x, num, height, do_init);
|
||||||
|
}
|
||||||
|
else if(customchars < 3){
|
||||||
|
adv_bignum_num_2_2 (drvthis, x, num, height, do_init);
|
||||||
|
}
|
||||||
|
else if(customchars < 28){
|
||||||
|
adv_bignum_num_2_5 (drvthis, x, num, height, do_init);
|
||||||
|
}
|
||||||
|
else { //p->customchars <= 28
|
||||||
|
adv_bignum_num_2_28 (drvthis, x, num, height, do_init);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
if(customchars < 3){
|
||||||
|
adv_bignum_num_4_0 (drvthis, x, num, height, do_init);
|
||||||
|
}
|
||||||
|
else { //p->customchars <= 4
|
||||||
|
adv_bignum_num_4_3 (drvthis, x, num, height, do_init);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
static void adv_bignum_write_num (Driver *drvthis, char write_num_map[][4][4], int x, int num, int height)
|
||||||
|
{
|
||||||
|
int y, dx;
|
||||||
|
for (y = 0; y < height; y++)
|
||||||
|
{
|
||||||
|
if(num == 10)
|
||||||
|
drvthis->chr (drvthis, x, y+1, write_num_map[num][y][0]);
|
||||||
|
else
|
||||||
|
for (dx = 0; dx <3; dx++)
|
||||||
|
drvthis->chr (drvthis, x + dx, y+1, write_num_map[num][y][dx]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// stored usercharacters
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_2_0 (Driver *drvthis, int x, int num, int height, int do_init)
|
||||||
|
{
|
||||||
|
static char num_map[][4][4] = {
|
||||||
|
{ /* 0 */
|
||||||
|
" ||",
|
||||||
|
" ||",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 1 */
|
||||||
|
" |",
|
||||||
|
" |",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 2 */
|
||||||
|
" ]",
|
||||||
|
" [ ",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 3 */
|
||||||
|
" ]",
|
||||||
|
" ]",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 4 */
|
||||||
|
" L|",
|
||||||
|
" |",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 5 */
|
||||||
|
" [ ",
|
||||||
|
" ]",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 6 */
|
||||||
|
" [ ",
|
||||||
|
" []",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 7 */
|
||||||
|
" 7",
|
||||||
|
" |",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 8 */
|
||||||
|
" []",
|
||||||
|
" []",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 9 */
|
||||||
|
" []",
|
||||||
|
" ]",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* colon */
|
||||||
|
".",
|
||||||
|
".",
|
||||||
|
" ",
|
||||||
|
" " }
|
||||||
|
};
|
||||||
|
|
||||||
|
adv_bignum_write_num (drvthis, num_map, x, num, height);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_2_1 (Driver *drvthis, int x, int num, int height, int do_init)
|
||||||
|
{
|
||||||
|
static char num_map[][4][4] = {
|
||||||
|
{ /* 0 */
|
||||||
|
{'|' , 0 , '|',0},
|
||||||
|
{"|_|"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 1 */
|
||||||
|
{" |"},
|
||||||
|
{" |"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 2 */
|
||||||
|
{' ',0,']',0},
|
||||||
|
{" [_"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 3 */
|
||||||
|
{' ',0,']',0},
|
||||||
|
{" _]"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 4 */
|
||||||
|
{" L|"},
|
||||||
|
{" |"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 5 */
|
||||||
|
{' ','[',0,0},
|
||||||
|
{" _]"},
|
||||||
|
{" "},
|
||||||
|
{" " }},
|
||||||
|
{ /* 6 */
|
||||||
|
{' ','[',0,0},
|
||||||
|
{" []"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 7 */
|
||||||
|
{' ',0,'|',0},
|
||||||
|
{" |"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 8 */
|
||||||
|
{" []"},
|
||||||
|
{" []"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* 9 */
|
||||||
|
{" []"},
|
||||||
|
{" _]"},
|
||||||
|
{" "},
|
||||||
|
{" "} },
|
||||||
|
{ /* colon */
|
||||||
|
{"."},
|
||||||
|
{"."},
|
||||||
|
{" "},
|
||||||
|
{" "} }
|
||||||
|
};
|
||||||
|
if (do_init)
|
||||||
|
{
|
||||||
|
static char bignum[1][5 * 8] = {
|
||||||
|
{
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
}};
|
||||||
|
drvthis->set_char (drvthis, 0, &bignum[0][0]);
|
||||||
|
}
|
||||||
|
adv_bignum_write_num (drvthis, num_map, x, num, height);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_2_2 (Driver *drvthis, int x, int num, int height, int do_init)
|
||||||
|
{
|
||||||
|
static char num_map[][4][4] ={
|
||||||
|
{ /* 0 */
|
||||||
|
{'|',0,'|'},
|
||||||
|
"|_|",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 1 */
|
||||||
|
" |",
|
||||||
|
" |",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 2 */
|
||||||
|
{' ',1,'|'},
|
||||||
|
"|_ ",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 3 */
|
||||||
|
{' ',1,'|'},
|
||||||
|
" _|",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 4 */
|
||||||
|
"|_|",
|
||||||
|
" |",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 5 */
|
||||||
|
{'|',1,' '},
|
||||||
|
" _|",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 6 */
|
||||||
|
{'|',0,' '},
|
||||||
|
{'|',1,'|'},
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 7 */
|
||||||
|
{' ',0,'|'},
|
||||||
|
" |",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 8 */
|
||||||
|
{'|',1,'|'},
|
||||||
|
"|_|",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* 9 */
|
||||||
|
{'|',1,'|'},
|
||||||
|
" _|",
|
||||||
|
" ",
|
||||||
|
" " },
|
||||||
|
{ /* colon */
|
||||||
|
".",
|
||||||
|
".",
|
||||||
|
" ",
|
||||||
|
" " }
|
||||||
|
};
|
||||||
|
if (do_init)
|
||||||
|
{
|
||||||
|
static char bignum[2][5 * 8] = {
|
||||||
|
{
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
}};
|
||||||
|
int i;
|
||||||
|
for (i = 0; i <= 2 ; i++) {
|
||||||
|
drvthis->set_char (drvthis, i, &bignum[i][0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adv_bignum_write_num (drvthis, num_map, x, num, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_2_5 (Driver *drvthis, int x, int num, int height, int do_init)
|
||||||
|
{
|
||||||
|
static char num_map[][4][4] =
|
||||||
|
{{{3 ,0 ,2}, /*0*/
|
||||||
|
{3 ,1 ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{' ' ,' ', 2},/*1*/
|
||||||
|
{' ' ,' ', 2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{' ' ,4 ,2},/*2*/
|
||||||
|
{3 ,1 ,' '},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{' ' ,4 ,2},/*3*/
|
||||||
|
{' ' ,1 ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{3 ,1 ,2},/*4*/
|
||||||
|
{' ' ,' ' ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{3 ,4 ,' '},/*5*/
|
||||||
|
{' ' ,1 ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{3 ,0 ,' '},/*6*/
|
||||||
|
{3 ,4 ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{' ' ,0 ,2},/*7*/
|
||||||
|
{' ' ,' ' ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{3 ,4 ,2},/*8*/
|
||||||
|
{3 ,1 ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{3 ,4 ,2},/*9*/
|
||||||
|
{' ' ,1 ,2},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{'.'},/*:*/
|
||||||
|
{'.'},
|
||||||
|
{" "},
|
||||||
|
{" "}}};
|
||||||
|
if (do_init)
|
||||||
|
{
|
||||||
|
static char bignum[5][5 * 8] = {
|
||||||
|
{
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
}};
|
||||||
|
int i;
|
||||||
|
for (i = 0; i <= 5 ; i++) {
|
||||||
|
drvthis->set_char (drvthis, i, &bignum[i][0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adv_bignum_write_num (drvthis, num_map, x, num, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_2_28 (Driver *drvthis, int x, int num, int height, int do_init)
|
||||||
|
{
|
||||||
|
static char num_map[][4][4] =
|
||||||
|
{{{15 ,6 ,2}, /*0*/
|
||||||
|
{14 ,4 ,5},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{' ' ,26 ,' '},/*1*/
|
||||||
|
{' ' ,10 ,' '},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{1 ,6 ,2},/*2*/
|
||||||
|
{7 ,8 ,9},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{0 ,11 ,2},/*3*/
|
||||||
|
{3 ,13 ,5},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{25 ,21 ,23},/*4*/
|
||||||
|
{17 ,22 ,24},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{10 ,11 ,12},/*5*/
|
||||||
|
{3 ,13 ,5},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{15 ,11 ,16},/*6*/
|
||||||
|
{14 ,13 ,5},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{17 ,18 ,19},/*7*/
|
||||||
|
{' ' ,20 ,' '},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{15 ,11 ,2},/*8*/
|
||||||
|
{14 ,13 ,5},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{15 ,11 ,2},/*9*/
|
||||||
|
{3 ,13 ,5},
|
||||||
|
{" "},
|
||||||
|
{" "}},
|
||||||
|
{{27},/*:*/
|
||||||
|
{27},
|
||||||
|
{" "},
|
||||||
|
{" "}}};
|
||||||
|
|
||||||
|
if (do_init)
|
||||||
|
{
|
||||||
|
|
||||||
|
static char bignum[28][5 * 8] = {
|
||||||
|
{ //0
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //1
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //2
|
||||||
|
1, 1, 0, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0
|
||||||
|
},
|
||||||
|
{ //3
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
},
|
||||||
|
{ //4
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //5
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //6
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //7
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //8
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //9
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
},
|
||||||
|
{ //10
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //11
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //12
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //13
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //14
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
},
|
||||||
|
{ //15
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //16
|
||||||
|
1, 1, 0, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //17
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //18
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //19
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //20
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
1, 1, 1, 1, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
},
|
||||||
|
{ //21
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
0, 0, 0, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 0, 1,
|
||||||
|
1, 1, 0, 0, 1,
|
||||||
|
1, 1, 0, 0, 1,
|
||||||
|
},
|
||||||
|
{ //22
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
},
|
||||||
|
{ //23
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //24
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 1, 1, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
1, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{ //25
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
0, 0, 0, 0, 1,
|
||||||
|
},
|
||||||
|
{ //26
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
0, 0, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{ //27
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 1, 1, 0,
|
||||||
|
0, 0, 1, 1, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
int i;
|
||||||
|
for (i = 0; i <= 28 ; i++) {
|
||||||
|
drvthis->set_char (drvthis, i, &bignum[i][0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adv_bignum_write_num (drvthis, num_map, x, num, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_4_0 (Driver *drvthis, int x, int num, int height, int do_init)
|
||||||
|
{
|
||||||
|
static char num_map[][4][4] = {
|
||||||
|
{ /* 0 */
|
||||||
|
" _ ",
|
||||||
|
"| |",
|
||||||
|
"|_|",
|
||||||
|
" " },
|
||||||
|
{ /* 1 */
|
||||||
|
" ",
|
||||||
|
" |",
|
||||||
|
" |",
|
||||||
|
" " },
|
||||||
|
{ /* 2 */
|
||||||
|
" _ ",
|
||||||
|
" _|",
|
||||||
|
"|_ ",
|
||||||
|
" " },
|
||||||
|
{ /* 3 */
|
||||||
|
" _ ",
|
||||||
|
" _|",
|
||||||
|
" _|",
|
||||||
|
" " },
|
||||||
|
{ /* 4 */
|
||||||
|
" ",
|
||||||
|
"|_|",
|
||||||
|
" |",
|
||||||
|
" " },
|
||||||
|
{ /* 5 */
|
||||||
|
" _ ",
|
||||||
|
"|_ ",
|
||||||
|
" _|",
|
||||||
|
" " },
|
||||||
|
{ /* 6 */
|
||||||
|
" _ ",
|
||||||
|
"|_ ",
|
||||||
|
"|_|",
|
||||||
|
" " },
|
||||||
|
{ /* 7 */
|
||||||
|
" _ ",
|
||||||
|
" |",
|
||||||
|
" |",
|
||||||
|
" " },
|
||||||
|
{ /* 8 */
|
||||||
|
" _ ",
|
||||||
|
"|_|",
|
||||||
|
"|_|",
|
||||||
|
" " },
|
||||||
|
{ /* 9 */
|
||||||
|
" _ ",
|
||||||
|
"|_|",
|
||||||
|
" _|",
|
||||||
|
" " },
|
||||||
|
{ /* colon */
|
||||||
|
" ",
|
||||||
|
".",
|
||||||
|
".",
|
||||||
|
" " }
|
||||||
|
};
|
||||||
|
|
||||||
|
adv_bignum_write_num (drvthis, num_map, x, num, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
static void adv_bignum_num_4_3 (Driver *drvthis, int x, int num, int height, int do_init)
|
||||||
|
{
|
||||||
|
static char num_map[][4][4] =
|
||||||
|
{{{3 ,1 ,3}, /*0*/
|
||||||
|
{3 ,' ' ,3},
|
||||||
|
{3 ,' ' ,3},
|
||||||
|
{3 ,2 ,3}},
|
||||||
|
{{' ' ,' ' ,3},/*1*/
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,' ' ,3}},
|
||||||
|
{{' ' ,1 ,3},/*2*/
|
||||||
|
{' ' ,2 ,3},
|
||||||
|
{3 ,' ' ,3},
|
||||||
|
{3 ,2 ,3}},
|
||||||
|
{{' ' ,1 ,3},/*3*/
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,2 ,3},
|
||||||
|
{' ' ,' ' ,3}},
|
||||||
|
{{3 ,2 ,3},/*4*/
|
||||||
|
{3 ,2 ,3},
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,' ' ,3}},
|
||||||
|
{{3 ,1 ,3},/*5*/
|
||||||
|
{3 ,2 ,3},
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,2 ,3}},
|
||||||
|
{{3 ,1 ,3},/*6*/
|
||||||
|
{3 ,' ' ,3},
|
||||||
|
{3 ,1 ,3},
|
||||||
|
{3 ,2 ,3}},
|
||||||
|
{{' ' ,1 ,3},/*7*/
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,' ' ,3}},
|
||||||
|
{{3 ,1 ,3},/*8*/
|
||||||
|
{3 ,2 ,3},
|
||||||
|
{3 ,' ' ,3},
|
||||||
|
{3 ,2 ,3}},
|
||||||
|
{{3 ,1 ,3},/*9*/
|
||||||
|
{3 ,2 ,3},
|
||||||
|
{' ' ,' ' ,3},
|
||||||
|
{' ' ,2 ,3}},
|
||||||
|
{{" "},/*:*/
|
||||||
|
{'.'},
|
||||||
|
{'.'},
|
||||||
|
{" "}}};
|
||||||
|
if (do_init)
|
||||||
|
{
|
||||||
|
static char bignum[5][5 * 8] = {
|
||||||
|
{
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
0, 0, 0, 0, 0,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
1, 1, 1, 1, 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
0, 1, 1, 1, 0,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
int i;
|
||||||
|
for (i = 0; i <= 3 ; i++) {
|
||||||
|
drvthis->set_char (drvthis, i, &bignum[i][0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
adv_bignum_write_num (drvthis, num_map, x, num, height);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
/* This is the bignumber-library used by the serialVFD driver.
|
||||||
|
|
||||||
|
Copyright (C) 2006 Stefan Herdler
|
||||||
|
|
||||||
|
Based on drivers.c and lcd-lib.c.
|
||||||
|
It may contain parts of other drivers of this package too.
|
||||||
|
|
||||||
|
2006-01-26 Version 0.1: everything should work (not all hardware tested!)
|
||||||
|
|
||||||
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef ADV_BIGNUM_H
|
||||||
|
#define ADV_BIGNUM_H
|
||||||
|
|
||||||
|
#include "lcd.h"
|
||||||
|
|
||||||
|
void lib_adv_bignum (Driver *drvthis, int x, int num, int height , int do_init, int customchars);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,70 @@
|
|||||||
|
/* This is the LCDproc driver for various serial VFD Devices
|
||||||
|
|
||||||
|
Copyright (C) 2006 Stefan Herdler
|
||||||
|
|
||||||
|
This driver is based on drv_base.c, wirz-sli.c and hd44780 from LCDproc
|
||||||
|
0.4.5 and the NoritakeVFD driver from this package.
|
||||||
|
It may contain parts of other drivers of this package too.
|
||||||
|
|
||||||
|
2006-01-26 Version 0.1: everything should work (not all hardware tested!)
|
||||||
|
|
||||||
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 */
|
||||||
|
|
||||||
|
#ifndef SERIALVFD_H
|
||||||
|
#define SERIALVFD_H
|
||||||
|
#include "lcd.h"
|
||||||
|
#include "adv_bignum.h"
|
||||||
|
|
||||||
|
#define CCMODE_STANDARD 0 /* only char 0 is used for heartbeat */
|
||||||
|
#define CCMODE_VBAR 1
|
||||||
|
#define CCMODE_HBAR 2
|
||||||
|
#define CCMODE_BIGNUM 3
|
||||||
|
#define CCMODE_BIGCHAR 4
|
||||||
|
#define CCMODE_CUSTOM 5
|
||||||
|
|
||||||
|
|
||||||
|
#define DEFAULT_CELL_WIDTH 5
|
||||||
|
#define DEFAULT_CELL_HEIGHT 7
|
||||||
|
#define DEFAULT_DEVICE "/dev/lcd"
|
||||||
|
#define DEFAULT_SPEED 9600
|
||||||
|
#define DEFAULT_BRIGHTNESS 140
|
||||||
|
#define DEFAULT_SIZE "20x2"
|
||||||
|
#define DEFAULT_DISPLAYTYPE 0
|
||||||
|
|
||||||
|
|
||||||
|
MODULE_EXPORT int serialVFD_init (Driver *drvthis);
|
||||||
|
MODULE_EXPORT void serialVFD_close (Driver *drvthis);
|
||||||
|
MODULE_EXPORT int serialVFD_width (Driver *drvthis);
|
||||||
|
MODULE_EXPORT int serialVFD_height (Driver *drvthis);
|
||||||
|
MODULE_EXPORT int serialVFD_cellwidth (Driver *drvthis);
|
||||||
|
MODULE_EXPORT int serialVFD_cellheight (Driver *drvthis);
|
||||||
|
MODULE_EXPORT void serialVFD_clear (Driver *drvthis);
|
||||||
|
MODULE_EXPORT void serialVFD_flush (Driver *drvthis);
|
||||||
|
MODULE_EXPORT void serialVFD_string (Driver *drvthis, int x, int y, char string[]);
|
||||||
|
MODULE_EXPORT void serialVFD_chr (Driver *drvthis, int x, int y, char c);
|
||||||
|
|
||||||
|
MODULE_EXPORT void serialVFD_vbar (Driver *drvthis, int x, int y, int len, int promille, int options);
|
||||||
|
MODULE_EXPORT void serialVFD_hbar (Driver *drvthis, int x, int y, int len, int promille, int options);
|
||||||
|
MODULE_EXPORT int serialVFD_icon(Driver *drvthis, int x, int y, int icon);
|
||||||
|
|
||||||
|
MODULE_EXPORT void serialVFD_set_char (Driver *drvthis, int n, char *dat);
|
||||||
|
|
||||||
|
MODULE_EXPORT int serialVFD_get_brightness (Driver *drvthis, int state);
|
||||||
|
MODULE_EXPORT void serialVFD_set_brightness (Driver *drvthis, int state, int promille);
|
||||||
|
MODULE_EXPORT void serialVFD_output (Driver *drvthis, int state);
|
||||||
|
MODULE_EXPORT void serialVFD_num (Driver * drvthis, int x, int num);
|
||||||
|
MODULE_EXPORT int serialVFD_get_free_chars (Driver *drvthis);
|
||||||
|
MODULE_EXPORT char * serialVFD_get_info( Driver *drvthis );
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user