From a2095969071780dd67475a43162225c72bc73d33 Mon Sep 17 00:00:00 2001 From: hmilz Date: Tue, 22 Oct 2002 06:54:58 +0000 Subject: [PATCH] *** empty log message *** --- docs/Seetron/CHARS0.BMP | Bin 0 -> 574 bytes docs/Seetron/CHARS1.BMP | Bin 0 -> 574 bytes docs/Seetron/Makefile | 34 +++++++++ docs/Seetron/README | 56 ++++++++++++++ docs/Seetron/TODO | 4 + docs/Seetron/sgxbmp.c | 128 ++++++++++++++++++++++++++++++++ docs/Seetron/vdr-logo-small.bmp | Bin 0 -> 574 bytes 7 files changed, 222 insertions(+) create mode 100644 docs/Seetron/CHARS0.BMP create mode 100644 docs/Seetron/CHARS1.BMP create mode 100644 docs/Seetron/Makefile create mode 100644 docs/Seetron/README create mode 100644 docs/Seetron/TODO create mode 100644 docs/Seetron/sgxbmp.c create mode 100644 docs/Seetron/vdr-logo-small.bmp diff --git a/docs/Seetron/CHARS0.BMP b/docs/Seetron/CHARS0.BMP new file mode 100644 index 0000000000000000000000000000000000000000..72593fbf34f608a268ab37981e2aa54fde447e44 GIT binary patch literal 574 zcmaKnv1=4T6vm%IxGIwF5D#N%d4+IFNCH}G6OXHgMHaD=v$)*}uDjESmAO<#tnv>; z(ijs(S@sW*Y!GkI%iM5mk>Wz83d6CPJl`c2Ld0+Q27Y|==Dm0K{=#KA(*oT$$;;#$ zLQbe)k^l zsYW8z66M?C=vJ{dryeBz{SO6fenxH4mX8E#P5r`oOo>lWBzpZH{X19Hl=PF6C14Mg}U$Zro(kc|kn*dY&(_KzcOn`@w|!FW&y) zK)0b&W3lwF)Q3~FRqkKd|M0fy3S&yUk{7k=5R7c|PgXl@O7_$$s1W}=_;TGota<@) zJGb3g6d1k9b*H`u8;vrUn@@xi*CKB&0Oq{Vx-@RBgAx! zug~()^cw2e>apgLqIt94u}HW0I+{l8fZnf0nC@gJv$mC#fX_2;%TSJ3J`tRF^s;BE T9?^w7n(+Skfc__~E@$u?&W~8Q literal 0 HcmV?d00001 diff --git a/docs/Seetron/CHARS1.BMP b/docs/Seetron/CHARS1.BMP new file mode 100644 index 0000000000000000000000000000000000000000..837240600d41857fa055281a355e21f53dc4f6e4 GIT binary patch literal 574 zcmZ?rwPRuc13Mt80mKzRtN_G}KnMmv`PWLe}X7R8u{QsXO zdnmv3dTi;m|9_9d_^j6xORv}ef3Y7fUyH(Ddp)`L+W-HrVDk5X8o$^7bp=u&zyLDu z2GBlxF!w(Lgo2X{_16!di+x>YP<;<92IT+UI_v8C+u!fkeg}#$@QFX(dp-1??DzY1 s??L?1$?uzbj4S)dgc%AxW=vHd{&AEqD1{|z-C03F4Rp8x;= literal 0 HcmV?d00001 diff --git a/docs/Seetron/Makefile b/docs/Seetron/Makefile new file mode 100644 index 0000000..456b773 --- /dev/null +++ b/docs/Seetron/Makefile @@ -0,0 +1,34 @@ + +# adjust your serial port +PORT=/dev/ttyR1 +# switch your display to 9600 bps i.a.w. the manual first! +SPEED=9600 + +all: sgxbmp load + + +sgxbmp: + cc -o sgxbmp sgxbmp.c -lm + +# make sure your display isn't set to EEPROM write protection +# (see ESC-W command) + +load: sgxbmp + # write CHARS0.BMP to EEPROM page #0 + ./sgxbmp $(PORT) $(SPEED) CHARS0.BMP 0 + sleep 1 + echo -ne "\033X0" > $(PORT) + sleep 1 + # write CHARS1.BMP to EEPROM page #1 + ./sgxbmp $(PORT) $(SPEED) CHARS1.BMP 0 + sleep 1 + echo -ne "\033X1" > $(PORT) + sleep 1 + # write logo to EEPROM page #2 + ./sgxbmp $(PORT) $(SPEED) vdr-logo-small.bmp 0 + sleep 1 + echo -ne "\033X2" > $(PORT) + +clean: + /bin/rm -f sgxbmp *.o core *~ + diff --git a/docs/Seetron/README b/docs/Seetron/README new file mode 100644 index 0000000..2fb30a5 --- /dev/null +++ b/docs/Seetron/README @@ -0,0 +1,56 @@ +This directory contains the custom character font files (CHARS*.BMP) and +a splash logo which can be displayed during powerup (vdr-logo-small.bmp). +Feel free to modify these with your favourite image editor (XV, The GIMP, +etc.) but make sure the fonts are withing the Seetron specification. + +You can compile sgxbmp as follows + +cc -o sgxbmp sgxbpm.c -lm + +usage: ./sgxbmp port speed file mode +where... + port is the port device name + speed is the port speed + file is the filename of bitmap image + mode is 0 for normal and 1 for reverse + +sgxbmp can be found at http://www.seetron.com/lcd_andex.htm + +After uploading the bitmaps to the display you need to store +them permanently in the display as described on the manual page +http://www.seetron.com/sgxmnl.htm. The display uses EEPROM pages 0 and +1 as the default character set so you should just store CHARS1.BMP in +page 1. CHARS0.BMP is unmodified. This way, you can create whatever +custom characters you like, and just use them as "normal" characters. + +Everything is semi-automatized by the supplied Makefile. Set the correct +port speed on the display (9600) and the serial port in the Makefile, +run "make", and you're done. + +You may also want to write protect the EEPROM afterwards, and set some +settings valid on startup (backlight, splash screen, etc.). See the +ESC-W command in the Seetron docs. Basically, you can send all these +ESC commands to the display using + +echo -en "\033..." > + +where \033 is the octal representation of the ESC character and is +the serial device where the display is connected. So - setting backlight +on, display EEPROM page #2 as splash screen and write protect the EEPROM +would be + +echo -en "\033W7" > + +Please mind you need to set the display to the SET position before +(switch on the back). + +The character maps are derived from Seetron's original character maps +found on their web page (www.seetron.com). The additional characters +(German umlauts, heartbeat, ellipsis, horizontal and vertical bars) +were made with The GIMP. You can see the entire set using xv or something. + + +Harald Milz +Oct 2002 + + diff --git a/docs/Seetron/TODO b/docs/Seetron/TODO new file mode 100644 index 0000000..7f18bbc --- /dev/null +++ b/docs/Seetron/TODO @@ -0,0 +1,4 @@ +Oct 22: +- German umlaut character mapping +- Big numbers + diff --git a/docs/Seetron/sgxbmp.c b/docs/Seetron/sgxbmp.c new file mode 100644 index 0000000..47994cf --- /dev/null +++ b/docs/Seetron/sgxbmp.c @@ -0,0 +1,128 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define FLOW_NONE 0 +#define FLOW_SOFTWARE 1 +#define FLOW_HARDWARE 2 + +int die(char *str); +int openRawSerialLine(char *port,int speed,int flow_control,int wrmode); + +char gxbits[480]; + +void bset(int x, int y) { + int index; + double theBitcom; + int theBit; + index = x + 120 * (y / 8); + theBitcom = pow(2, (y % 8)); + theBit = theBitcom; + gxbits[index] = 0+gxbits[index] | theBit; +} + +int main(int ac,char **av) { + int fd, idx, j, i, x, y; + char bmpin[574]; + char str[1024]; + + int filein; + + if (ac!=5) { + printf("usage: %s port speed file mode\n",av[0]); + printf("where...\n"); + printf(" port is the port device name\n"); + printf(" speed is the port speed\n"); + printf(" file is the filename of bitmap image\n"); + printf(" mode is 0 for normal and 1 for reverse\n"); + exit(0); + } + + if (! strcmp(av[2], "-" )) { + fd=open(av[1], O_RDWR|O_APPEND); + } else { + fd=openRawSerialLine(av[1],atoi(av[2]),FLOW_NONE,O_RDWR); + } + + filein=open(av[3], O_RDWR); + + read(filein, bmpin, 62); + + read(filein, bmpin, 512); + close(filein); + + idx=0; + for(j=31;j>-1;j--) { + for(i=0;i<16;i++) { + if (bmpin[idx] & 128) bset((i * 8), j); + if (bmpin[idx] & 64) bset(((i * 8)+ 1), j); + if (bmpin[idx] & 32) bset(((i * 8)+ 2), j); + if (bmpin[idx] & 16) bset(((i * 8)+ 3), j); + if (bmpin[idx] & 8) bset(((i * 8)+ 4), j); + if (bmpin[idx] & 4) bset(((i * 8)+ 5), j); + if (bmpin[idx] & 2) bset(((i * 8)+ 6), j); + if (bmpin[idx] & 1) bset(((i * 8)+ 7), j); + idx++; + } + } + + sprintf(str,"%cDG", 27); + + if(atoi(av[4])==0) { + for (idx=0;idx<480;idx++) { + gxbits[idx]=gxbits[idx] ^ 255; + } + } + write(fd,str,3); + write(fd,&gxbits,480); + close(fd); + exit(0); +} + +int openRawSerialLine(char *port,int speed,int flow_control,int wrmode) { + struct termios flags; + speed_t tioc_speed; + int fd, softwareFlow; + + softwareFlow= (flow_control==FLOW_SOFTWARE) ? 1 : 0; + ((fd=open(port,wrmode|O_NDELAY))>=0) || die("failed opening serial port"); + + ((tcflush(fd, TCIFLUSH))>=0) || die("failed flushing line"); + + flags.c_iflag= IGNBRK | ((flow_control==FLOW_SOFTWARE) ? (IXOFF|IXON) : 0); + flags.c_cflag= CLOCAL | CS8 | ((flow_control==FLOW_HARDWARE) ? CRTSCTS : 0) + | ((wrmode==O_WRONLY || wrmode==O_RDWR) ? CREAD : 0); + flags.c_oflag= flags.c_lflag= 0; + + flags.c_cc[VMIN] = 1; flags.c_cc[VTIME] = 0; + + switch(speed) { + case 50: tioc_speed=B50; break; case 75: tioc_speed=B75; break; + case 110: tioc_speed=B110; break; case 134: tioc_speed=B134; break; + case 150: tioc_speed=B150; break; case 200: tioc_speed=B200; break; + case 300: tioc_speed=B300; break; case 600: tioc_speed=B600; break; + case 1200: tioc_speed=B1200; break; case 1800: tioc_speed=B1800; break; + case 2400: tioc_speed=B2400; break; case 4800: tioc_speed=B4800; break; + case 9600: tioc_speed=B9600; break; case 19200: tioc_speed=B19200; break; + case 38400: tioc_speed=B38400; break; + default: + die("Unknown baud date"); break; + } + + ((cfsetospeed(&flags,tioc_speed))>=0) || die("failed setting output speed"); + ((tcsetattr(fd,TCSANOW,&flags))>=0) || die("failed setting port attribs"); + + return(fd); +} + +int die(char *str) { + perror(str);exit(1); +} + diff --git a/docs/Seetron/vdr-logo-small.bmp b/docs/Seetron/vdr-logo-small.bmp new file mode 100644 index 0000000000000000000000000000000000000000..2f7a5573d691fe4fe64266617e5b48c555761c92 GIT binary patch literal 574 zcmaLTF-`+95Cu?&AT~u{E)cOPDLDXIBYI9igTw`>5t6gogQTFL-ku+e3sXpQ&VMm&n}?%S~su%Joqll zIxhno)A|tT7qw%@Kp$GO=k@9c`YqjFYm4SS%U2qfZeo50J#J~|wceq>m+gbv`s*;9 z$+%HhTA!-ZbO=cLzEUAAxAbwQs0x}`Y_y3~<%bB!|RFnO{$d0?Mr zb8IDIpxKB%#?IqV;A&*r?$di#&bc{5`%_2eGlurB_w>w988y8EN6P%15$KjK+)C=a FegG-}NlyR( literal 0 HcmV?d00001