configuration option ConnectionType for sed1330 (Benjamin Wiedmann)

This commit is contained in:
marschap
2007-01-01 16:00:58 +00:00
parent df7700662d
commit 92d099fb28
5 changed files with 153 additions and 54 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ v.0.5dev (ongoing development)
* make Brightness & OffBrightness run-time configurable in CFontz & MtxOrb * make Brightness & OffBrightness run-time configurable in CFontz & MtxOrb
* add support for Iface and ProcSize screens for OS X / Darwin (Eric Pooch) * add support for Iface and ProcSize screens for OS X / Darwin (Eric Pooch)
* update & fix serialVFD driver (Stefan Herdler) * update & fix serialVFD driver (Stefan Herdler)
+ Hitachi SP14Q002 support & another connection type to sed1330 (Benjamin Wiedmann) + Hitachi SP14Q002 support & ConnectionType setting for sed1330 (Benjamin Wiedmann)
* replace obsolete index() by strchr() (Guillaume LECERF) * replace obsolete index() by strchr() (Guillaume LECERF)
v.0.5.1 v.0.5.1
+4 -1
View File
@@ -701,9 +701,12 @@ Port=0x378
# Note: Currently only tested with G321D & SP14Q002. # Note: Currently only tested with G321D & SP14Q002.
Type=G321D Type=G321D
# Width x Height of a character cell in pixels (legal: 6x7 - 8x16; default: 6x10) # Width x Height of a character cell in pixels [legal: 6x7 - 8x16; default: 6x10]
CellSize=6x10 CellSize=6x10
# Select what type of connection [legal: classic, bitshaker; default: classic]
ConnectionType=classic
## Seiko Epson 1520 driver ## ## Seiko Epson 1520 driver ##
[sed1520] [sed1520]
-4
View File
@@ -6,13 +6,9 @@ Please send a message to the mailing list if you have any question.
Things for the short term: Things for the short term:
- Use centralized command message parsing engine (more secure) - Use centralized command message parsing engine (more secure)
- allow bignum library to use user-defined characters different
from 0 - N but from M - (M+N)
- more features for existing display drivers - more features for existing display drivers
(e.g. adapt them to bignum library) (e.g. adapt them to bignum library)
- documentation (any help is appreciated) - documentation (any help is appreciated)
- ConnectionType configuration parameter for the sed1330 driver to
distinguish between the default and bitshaker (a.k.a. yasedw) wiring
Things for the longer term: Things for the longer term:
+87 -5
View File
@@ -19,7 +19,7 @@ the connections given here are also correct for your display !
</para> </para>
Ordered by LCD pins ConnectionType <literal>classic</literal> ordered by LCD pins
<screen> <screen>
<![CDATA[ <![CDATA[
LCD pin? <---> pin LPT port LCD pin? <---> pin LPT port
@@ -52,7 +52,7 @@ the connections given here are also correct for your display !
]]> ]]>
</screen> </screen>
Or ordered by the LPT port pins: ConnectionType <literal>classic</literal> ordered by LPT port pins
<screen> <screen>
<![CDATA[ <![CDATA[
LCD pin? <---> pin LPT port LCD pin? <---> pin LPT port
@@ -172,6 +172,48 @@ use the following circuit.
</para></listitem> </para></listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term>
<command>ConnectionType=</command>
<arg choice="plain">
<group choice="req">
<arg choice="plain"><literal><emphasis>classic</emphasis></literal></arg>
<arg choice="plain"><literal>bitshaker</literal></arg>
</group>
</arg>
</term>
<listitem>
<para>
Select the type of the wiring.
</para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>ConnectionType</entry>
<entry>Wiring</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>classic</literal></entry>
<entry>^WR = LPT pin 16, A0 = LPT pin 17, ^RESET = LPT pin 1</entry>
</row>
<row>
<entry><literal>bitshaker</literal></entry>
<entry>^WR = LPT pin 1, A0 = LPT pin 14, ^RESET = LPT pin 16</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
If not given, it defaults to <literal>classic</literal>.
</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<command>Port=</command> <command>Port=</command>
@@ -201,17 +243,57 @@ use the following circuit.
</term> </term>
<listitem> <listitem>
<para> <para>
Type of LCD module. Type of LCD module. Besised other things (internal setup) this configuration setting
detrmines the size of the display in pixels.
</para> </para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>Type</entry>
<entry>Size (in pixels)</entry>
</row>
</thead>
<tbody>
<row>
<entry><literal>G321D</literal></entry>
<entry>320 x 200</entry>
</row>
<row>
<entry><literal>G121C</literal></entry>
<entry>128 x 128</entry>
</row>
<row>
<entry><literal>G242C</literal></entry>
<entry>240 x 128</entry>
</row>
<row>
<entry><literal>G191D</literal></entry>
<entry>192 x 192</entry>
</row>
<row>
<entry><literal>G2446</literal></entry>
<entry>240 x 64</entry>
</row>
<row>
<entry><literal>SP14Q002</literal></entry>
<entry>320 x 240</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<note><para> <note><para>
The G321D and SP14Q002 are the only ones that this driver is tested with currently. Currently the G321D and SP14Q002 are the only ones that this driver is tested with.
</para></note> </para></note>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
<para> <para>
Contrary to other drivers the character size of an LCD is not given given directly. Contrary to other drivers the character size of an LCD using the sed1330i
driver is not given directly.
Instead it is determined by the pixel size of the display, which is derived from Instead it is determined by the pixel size of the display, which is derived from
the display type setting and the character cell size. the display type setting and the character cell size.
</para> </para>
+61 -43
View File
@@ -47,9 +47,14 @@
* - built for parport version of this interface: Wallbraun Electronics lcdinterface * - built for parport version of this interface: Wallbraun Electronics lcdinterface
* (specifications here: http://wallbraun-electronics.de/produkte/lcdinterface/index.html) * (specifications here: http://wallbraun-electronics.de/produkte/lcdinterface/index.html)
* - wiring scheme used: "bitshaker" (called "yasedw" in serdisplib) * - wiring scheme used: "bitshaker" (called "yasedw" in serdisplib)
* --> default wiring: wr=16; a0=17; rd=01; cs=14 * --> classic wiring: wr=16; a0=17; rd=01; cs=14
* --> yasedw wiring: wr=01; a0=14; rd=16; cs=17 * --> bitshaker wiring: wr=01; a0=14; rd=16; cs=17
* * December 2006, Benjamin Wiedmann (additional changes, fixup)
* - wiring scheme can now be changed at run time using "ConnectionType" config parameter
* in sed1330 driver section
* Usage of ConnectionType in LCDd.conf:
* ConnectionType=<classic|bitshaker>
* - if no ConnectionType is set it defaults to "classic" wiring
* *
* IMPORTANT: MODULES OTHER THAN G321D * IMPORTANT: MODULES OTHER THAN G321D
* =================================== * ===================================
@@ -187,6 +192,11 @@
* type=G191D * type=G191D
* type=G2446 * type=G2446
* type=SP14Q002 * type=SP14Q002
*
* You can also change the wiring scheme by using the ConnectionType= option:
* ConnectionType=<classic|bitshaker>
* If not set, classic wiring is used.
*
* The port= value should be set to the LPT port address that the LCD is * The port= value should be set to the LPT port address that the LCD is
* connected to. Examples: * connected to. Examples:
* port=0x378 * port=0x378
@@ -218,35 +228,6 @@
#define KEYPAD_AUTOREPEAT_DELAY 500 #define KEYPAD_AUTOREPEAT_DELAY 500
#define KEYPAD_AUTOREPEAT_FREQ 15 #define KEYPAD_AUTOREPEAT_FREQ 15
// LPT lines
// should we use the bitshaker wiring?
//#define WIRING_BITSHAKER
#ifdef WIRING_BITSHAKER
// use BITSHAKER / YASEDW wiring
// pin 14
#define A0 nLF
// pin 16
#define nRESET INIT
// pin 1
#define nWR STRB
#else
// use default wiring
// pin 17
#define A0 SEL
// pin 1
#define nRESET STRB
// pin 16
#define nWR INIT
#endif
// Command definitions // Command definitions
#define CMD_SYSTEM_SET 0x40 #define CMD_SYSTEM_SET 0x40
#define CMD_SLEEP_IN 0x53 #define CMD_SLEEP_IN 0x53
@@ -283,12 +264,23 @@
#define SCR2_H 0x06 #define SCR2_H 0x06
typedef struct p { typedef struct p {
// display type
int type; int type;
// wiring scheme variables to be set by sed1330_init()
int A0;
int nRESET;
int nWR;
// which lpt port to use
int port; int port;
unsigned char * framebuf_text; unsigned char * framebuf_text;
unsigned char * lcd_contents_text; unsigned char * lcd_contents_text;
unsigned char * framebuf_graph; unsigned char * framebuf_graph;
unsigned char * lcd_contents_graph; unsigned char * lcd_contents_graph;
int width, height; int width, height;
int cellwidth, cellheight; int cellwidth, cellheight;
int graph_width, graph_height; int graph_width, graph_height;
@@ -309,7 +301,6 @@ typedef struct p {
struct timeval pressed_key_time; struct timeval pressed_key_time;
int stuckinputs; int stuckinputs;
} PrivateData; } PrivateData;
static char *defaultKeyMapDirect[KEYPAD_MAXX] = { "Enter", "Up", "Down", "Escape", "F1" }; static char *defaultKeyMapDirect[KEYPAD_MAXX] = { "Enter", "Up", "Down", "Escape", "F1" };
@@ -422,6 +413,33 @@ sed1330_init( Driver * drvthis )
} }
report(RPT_INFO, "%s: Using LCD type %s", drvthis->name, s); report(RPT_INFO, "%s: Using LCD type %s", drvthis->name, s);
// Set wiring scheme to be used
//
// Valid ConnectionTypes:
// - classic (default)
// - bitshaker
//
// Get ConnectionType, if no type is set, default to "classic" wiring so it even
// works with config files missing that ConnectionType entry in sed1330 driver section
s = drvthis->config_get_string(drvthis->name, "ConnectionType", 0, "classic");
// Set wiring initialization parameters based on ConnectionType
if (strcmp(s, "classic") == 0) {
// Use classic wiring
p->A0 = SEL; // port 17
p->nRESET = STRB; // port 1
p->nWR = INIT; // port 16
} else if(strcmp(s, "bitshaker") == 0) {
// Use bitshaker wiring
p->A0 = nLF; // port 14
p->nRESET = INIT; // port 16
p->nWR = STRB; // port 1
} else {
report(RPT_ERR, "%s: Unknown ConnectionType %s", drvthis->name, s);
return -1;
}
report(RPT_INFO, "%s: Using ConnectionType %s", drvthis->name, s);
// Keypad ? // Keypad ?
p->have_keypad = drvthis->config_get_bool(drvthis->name, "keypad", 0, 0); p->have_keypad = drvthis->config_get_bool(drvthis->name, "keypad", 0, 0);
@@ -523,12 +541,12 @@ sed1330_init( Driver * drvthis )
// INITIALIZE THE LCD // INITIALIZE THE LCD
// End reset-state // End reset-state
debug(RPT_DEBUG, "%s: initializing LCD", __FUNCTION__); debug(RPT_DEBUG, "%s: initializing LCD", __FUNCTION__);
port_out(p->port+2, (nWR) ^ OUTMASK); // raise ^RD and ^WR port_out(p->port+2, (p->nWR) ^ OUTMASK); // raise ^RD and ^WR
port_out(p->port+2, (nRESET|nWR) ^ OUTMASK); // lower RESET port_out(p->port+2, (p->nRESET|p->nWR) ^ OUTMASK); // lower RESET
uPause(200); uPause(200);
port_out(p->port+2, (nWR) ^ OUTMASK); // raise RESET port_out(p->port+2, (p->nWR) ^ OUTMASK); // raise RESET
uPause(200); uPause(200);
port_out(p->port+2, (nRESET|nWR) ^ OUTMASK); // lower RESET port_out(p->port+2, (p->nRESET|p->nWR) ^ OUTMASK); // lower RESET
uPause(4000); uPause(4000);
switch (p->type) { switch (p->type) {
@@ -596,16 +614,16 @@ sed1330_command( PrivateData * p, char command, int datacount, unsigned char * d
int i; int i;
int port = p->port; int port = p->port;
port_out(port+2, (nRESET|nWR|A0) ^ OUTMASK); // set A0 to indicate command port_out(port+2, (p->nRESET|p->nWR|p->A0) ^ OUTMASK); // set A0 to indicate command
port_out(port, command); // set up p port_out(port, command); // set up p
port_out(port+2, (nRESET|A0) ^ OUTMASK); // activate ^WR port_out(port+2, (p->nRESET|p->A0) ^ OUTMASK); // activate ^WR
port_out(port+2, (nRESET|nWR|A0) ^ OUTMASK); // deactivate ^WR again port_out(port+2, (p->nRESET|p->nWR|p->A0) ^ OUTMASK); // deactivate ^WR again
port_out(port+2, (nRESET|nWR) ^ OUTMASK); // clear A0 to indicate p port_out(port+2, (p->nRESET|p->nWR) ^ OUTMASK); // clear A0 to indicate p
for (i = 0; i < datacount; i++) { for (i = 0; i < datacount; i++) {
port_out(port, data[i]); // set up data port_out(port, data[i]); // set up data
port_out(port+2, (nRESET) ^ OUTMASK); // activate ^WR port_out(port+2, (p->nRESET) ^ OUTMASK); // activate ^WR
port_out(port+2, (nRESET|nWR) ^ OUTMASK); // deactivate ^WR again port_out(port+2, (p->nRESET|p->nWR) ^ OUTMASK); // deactivate ^WR again
} }
} }