Added new driver for the Toshiba T6963, donated by
Manuel Stahl <mythos@xmythos.de>
This commit is contained in:
@@ -0,0 +1,532 @@
|
||||
/*
|
||||
* Base driver module for Toshiba T6963 based LCD displays. ver 1.0
|
||||
*
|
||||
* Parts of this file are based on the kernel driver by Alexander Frink <Alexander.Frink@Uni-Mainz.DE>
|
||||
*
|
||||
*
|
||||
* This file is released under the GNU General Public License. Refer to the
|
||||
* COPYING file distributed with this package.
|
||||
*
|
||||
* Copyright (c) 2001 Manuel Stahl <mythos@xmythos.de>
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <asm/io.h>
|
||||
#include <sys/perm.h>
|
||||
|
||||
#include "shared/str.h"
|
||||
#include "shared/debug.h"
|
||||
|
||||
#include "lcd.h"
|
||||
#include "t6963.h"
|
||||
#include "t6963_font.h"
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
lcd_logical_driver *t6963;
|
||||
|
||||
static u16 t6963_out_port;
|
||||
static u16 t6963_display_mode;
|
||||
static u8 *t6963_display_buffer1;
|
||||
static u8 *t6963_display_buffer2;
|
||||
static u8 t6963_hbar_len[6];
|
||||
static u8 t6963_graph_line[6];
|
||||
|
||||
int
|
||||
t6963_init (struct lcd_logical_driver *driver, char *args)
|
||||
{
|
||||
char *argv[64];
|
||||
int argc;
|
||||
int i;
|
||||
int tmp;
|
||||
|
||||
debug ("Doing initialization\n");
|
||||
|
||||
t6963_out_port = 0x378;
|
||||
t6963_display_mode = 0;
|
||||
t6963_graph_line[0] = 0x20;
|
||||
t6963_graph_line[1] = 0x30;
|
||||
t6963_graph_line[2] = 0x38;
|
||||
t6963_graph_line[3] = 0x3C;
|
||||
t6963_graph_line[4] = 0x3E;
|
||||
t6963_graph_line[5] = 0x3F;
|
||||
|
||||
t6963 = driver;
|
||||
|
||||
debug ("Reading arguments...\n");
|
||||
argc = get_args (argv, args, 64);
|
||||
|
||||
|
||||
/* for(i=0; i<argc; i++)
|
||||
{
|
||||
printf("Arg(%i): %s\n", i, argv[i]);
|
||||
} */
|
||||
|
||||
|
||||
for (i = 0; i < argc; i++) {
|
||||
//printf("Arg(%i): %s\n", i, argv[i]);
|
||||
if (0 == strcmp (argv[i], "-p") || 0 == strcmp (argv[i], "--port")) {
|
||||
if (i + 1 > argc) {
|
||||
fprintf (stderr, "T6963_init: %s requires an argument\n", argv[i]);
|
||||
return -1;
|
||||
}
|
||||
t6963_out_port = atoi (argv[++i]);
|
||||
} else if (0 == strcmp (argv[i], "-h") || 0 == strcmp (argv[i], "--help")) {
|
||||
printf ("LCDproc Toshiba T6963 LCD driver\n" "\t-p\t--port\tSelect the output port to use [0x378]\n" "\t-t\t--type\t\tSelect the LCD type (size) [20x6]\n" "\t-h\t--help\t\tShow this help information\n");
|
||||
return -1;
|
||||
} else {
|
||||
printf ("Invalid parameter: %s\n", argv[i]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
debug ("Getting permissions to %i...\n", t6963_out_port);
|
||||
|
||||
if(ioperm(t6963_out_port, 3, 1)) {
|
||||
fprintf (stderr, "T6963_init: failed (%s)\n", strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(ioperm(0x80, 1, 1)) {
|
||||
fprintf (stderr, "T6963_init: failed (%s)\n", strerror (errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
debug (" cool, got 'em!\nSetting width and height\n");
|
||||
|
||||
driver->wid = 20;
|
||||
driver->hgt = 6;
|
||||
|
||||
debug ("done\nAllocating memory: %i x %i bytes = %i\n", driver->wid, driver->hgt, driver->wid * driver->hgt);
|
||||
|
||||
// You must use driver->framebuf here, but may use lcd.framebuf later.
|
||||
if (!driver->framebuf)
|
||||
driver->framebuf = malloc (driver->wid * driver->hgt);
|
||||
|
||||
if (!driver->framebuf) {
|
||||
t6963_close ();
|
||||
return -1;
|
||||
}
|
||||
|
||||
t6963_display_buffer1 = malloc (driver->wid * 6);
|
||||
t6963_display_buffer2 = malloc (driver->wid * 6);
|
||||
// Debugging...
|
||||
if(t6963_display_buffer1) memset(t6963_display_buffer1, ' ', driver->wid * 6);
|
||||
if(t6963_display_buffer2) memset(t6963_display_buffer1, ' ', driver->wid * 6);
|
||||
|
||||
driver->cellwid = 6;
|
||||
driver->cellhgt = 8;
|
||||
t6963->cellwid = 6;
|
||||
t6963->cellhgt = 8;
|
||||
|
||||
driver->clear = t6963_clear;
|
||||
driver->string = t6963_string;
|
||||
driver->chr = t6963_chr;
|
||||
driver->vbar = t6963_vbar;
|
||||
driver->init_vbar = NULL;
|
||||
driver->hbar = t6963_hbar;
|
||||
driver->init_hbar = NULL;
|
||||
driver->num = t6963_num;
|
||||
driver->init_num = t6963_init_num;
|
||||
|
||||
driver->init = t6963_init;
|
||||
driver->close = t6963_close;
|
||||
driver->flush = t6963_flush;
|
||||
driver->flush_box = NULL;
|
||||
driver->contrast = t6963_contrast;
|
||||
driver->backlight = t6963_backlight;
|
||||
driver->set_char = t6963_set_char;
|
||||
driver->icon = t6963_icon;
|
||||
driver->draw_frame = t6963_draw_frame;
|
||||
|
||||
driver->getkey = t6963_getkey;
|
||||
|
||||
T6963_CEHI; // disable chip
|
||||
T6963_RDHI; // disable reading from LCD
|
||||
T6963_WRHI; // disable writing to LCD
|
||||
T6963_CDHI; // command/status mode
|
||||
T6963_DATAOUT; // make 8-bit parallel port an output port
|
||||
|
||||
t6963_low_command_word (SET_GRAPHIC_HOME_ADDRESS, ATTRIB_BASE);
|
||||
t6963_low_command_word (SET_GRAPHIC_AREA, driver->wid);
|
||||
t6963_low_command_word (SET_TEXT_HOME_ADDRESS, TEXT_BASE);
|
||||
t6963_low_command_word (SET_TEXT_AREA, driver->wid);
|
||||
|
||||
t6963_low_command (SET_MODE | OR_MODE | EXTERNAL_CG);
|
||||
t6963_low_command_2_bytes (SET_OFFSET_REGISTER, CHARGEN_BASE>>11, 0);
|
||||
t6963_low_command (SET_CURSOR_PATTERN | 7); // cursor is 8 lines high
|
||||
t6963_low_command_2_bytes (SET_CURSOR_POINTER, 0, 0);
|
||||
|
||||
t6963_set_nchar (0, fontdata_6x8, 255);
|
||||
|
||||
t6963_low_enable_mode (TEXT_ON);
|
||||
t6963_low_enable_mode (GRAPHIC_ON);
|
||||
t6963_low_disable_mode (CURSOR_ON);
|
||||
t6963_low_disable_mode (BLINK_ON);
|
||||
|
||||
t6963_clear ();
|
||||
t6963_graphic_clear (0, 0, driver->wid, driver->cellhgt * 6);
|
||||
t6963_flush();
|
||||
debug ("Initialization done!\n");
|
||||
|
||||
return 200; // 200 is arbitrary. (must be 1 or more)
|
||||
}
|
||||
|
||||
// Below here, you may use either lcd.framebuf or driver->framebuf..
|
||||
// lcd.framebuf will be set to the appropriate buffer before calling
|
||||
// your driver.
|
||||
|
||||
void
|
||||
t6963_close ()
|
||||
{
|
||||
debug ("Shutting down!\n");
|
||||
t6963_low_disable_mode (BLINK_ON);
|
||||
|
||||
ioperm(t6963_out_port, 3, 0);
|
||||
if (t6963->framebuf != NULL)
|
||||
free (t6963->framebuf);
|
||||
if (t6963_display_buffer1 != NULL) free (t6963_display_buffer1);
|
||||
if (t6963_display_buffer2 != NULL) free (t6963_display_buffer2);
|
||||
|
||||
t6963->framebuf = NULL;
|
||||
t6963_display_buffer1 = NULL;
|
||||
t6963_display_buffer2 = NULL;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Clears the LCD screen
|
||||
//
|
||||
void
|
||||
t6963_clear ()
|
||||
{
|
||||
int i;
|
||||
|
||||
debug ("Clearing Display of size %i x %i\n", t6963->wid, 6);
|
||||
|
||||
memset (t6963_display_buffer1, ' ', t6963->wid * 6);
|
||||
// for (i=0; i < 6; i++)
|
||||
// if (t6963_hbar_len[i]==0) t6963_graphic_clear(0, i*t6963->cellhgt, t6963->wid, (i+1)*t6963->cellhgt);
|
||||
|
||||
debug ("Done\n");
|
||||
}
|
||||
|
||||
void
|
||||
t6963_graphic_clear (int x1, int y1, int x2, int y2)
|
||||
{
|
||||
int x;
|
||||
|
||||
debug ("Clearing Graphic %i bytes\n", (x2-x1)*(y2-y1));
|
||||
|
||||
for (;y1 < y2; y1++)
|
||||
{
|
||||
t6963_low_command_word(SET_ADDRESS_POINTER, ATTRIB_BASE + y1 * t6963->wid + x1);
|
||||
for (x = x1; x < x2; x++)
|
||||
t6963_low_command_byte(DATA_WRITE_INC, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
// Flushes all output to the lcd...
|
||||
//
|
||||
void
|
||||
t6963_flush ()
|
||||
{
|
||||
int i;
|
||||
debug ("Flushing %i x %i\n", t6963->wid, t6963->hgt);
|
||||
|
||||
for (i = 0; i < (t6963->wid * 6); i++)
|
||||
{
|
||||
debug ("%c%c|", t6963_display_buffer1[i], t6963_display_buffer2[i]);
|
||||
if (t6963_display_buffer1[i] != t6963_display_buffer2[i])
|
||||
{
|
||||
t6963_low_command_word(SET_ADDRESS_POINTER, TEXT_BASE + i);
|
||||
t6963_low_command_byte(DATA_WRITE, t6963_display_buffer1[i]);
|
||||
}
|
||||
}
|
||||
debug ("\n");
|
||||
//t6963->draw_frame(t6963->framebuf);
|
||||
t6963_swap_buffers();
|
||||
t6963_clear();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Send a rectangular area to the display.
|
||||
//
|
||||
// I've just called drv_base_flush() because there's not much point yet
|
||||
// in flushing less than the entire framebuffer.
|
||||
//
|
||||
void
|
||||
t6963_flush_box (int lft, int top, int rgt, int bot)
|
||||
{
|
||||
debug ("flush_box\n");
|
||||
t6963_flush();
|
||||
//drv_base_flush();
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Prints a string on the lcd display, at position (x,y). The
|
||||
// upper-left is (1,1), and the lower right should be (20,6).
|
||||
//
|
||||
void
|
||||
t6963_string (int x, int y, char string[])
|
||||
{
|
||||
int i;
|
||||
|
||||
debug ("String out\n");
|
||||
|
||||
x -= 1; // Convert 1-based coords to 0-based...
|
||||
y -= 1;
|
||||
|
||||
// t6963_low_command_word(SET_ADDRESS_POINTER,TEXT_BASE+POSITION(x,y));
|
||||
if(y * t6963->wid + x + strlen(string) <= t6963->wid * 6);
|
||||
memcpy(&t6963_display_buffer1[y * t6963->wid + x], string, strlen(string));
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Prints a character on the lcd display, at position (x,y). The
|
||||
// upper-left is (1,1), and the lower right should be (20,4).
|
||||
//
|
||||
void
|
||||
t6963_chr (int x, int y, char c)
|
||||
{
|
||||
debug ("Char out\n");
|
||||
y--;
|
||||
x--;
|
||||
if ((y * t6963->wid) + x <= (t6963->wid * 6))
|
||||
t6963_display_buffer1[(y * t6963->wid) + x] = c;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Sets the contrast of the display. Value is 0-255, where 140 is
|
||||
// what I consider "just right".
|
||||
//
|
||||
int
|
||||
t6963_contrast (int contrast)
|
||||
{
|
||||
// printf("Contrast: %i\n", contrast);
|
||||
return -1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Turns the lcd backlight on or off...
|
||||
//
|
||||
void
|
||||
t6963_backlight (int on)
|
||||
{
|
||||
/*
|
||||
if(on)
|
||||
{
|
||||
printf("Backlight ON\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("Backlight OFF\n");
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Tells the driver to get ready for big numbers, if possible.
|
||||
//
|
||||
void
|
||||
t6963_init_num ()
|
||||
{
|
||||
// printf("Big Numbers.\n");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Draws a big (4-row) number.
|
||||
//
|
||||
void
|
||||
t6963_num (int x, int num)
|
||||
{
|
||||
// printf("BigNum(%i, %i)\n", x, num);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Changes the font data of character n.
|
||||
//
|
||||
void
|
||||
t6963_set_nchar (int n, char *dat, int num)
|
||||
{
|
||||
int row, col;
|
||||
char tmp;
|
||||
char letter;
|
||||
|
||||
debug ("Setting char %i", n);
|
||||
|
||||
if (!dat || n+num > 256)
|
||||
return;
|
||||
|
||||
t6963_low_command_word(SET_ADDRESS_POINTER, CHARGEN_BASE + n*8);
|
||||
for (row = 0; row < t6963->cellhgt * num; row++) {
|
||||
letter = 0;
|
||||
for (col = 0; col < t6963->cellwid; col++) {
|
||||
letter <<= 1;
|
||||
letter |= (dat[(row * t6963->cellwid) + col] > 0);
|
||||
}
|
||||
|
||||
t6963_low_command_byte(DATA_WRITE_INC, letter);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
t6963_set_char (int n, char *dat)
|
||||
{
|
||||
t6963_set_nchar (n, dat, 1);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Draws a vertical bar, from the bottom of the screen up.
|
||||
//
|
||||
void
|
||||
t6963_vbar (int x, int len)
|
||||
{
|
||||
int y;
|
||||
|
||||
for (y = 0; y < len/t6963->cellhgt; y++)
|
||||
t6963_chr (x, 6-y, 219);
|
||||
|
||||
if (len % t6963->cellhgt)
|
||||
t6963_chr (x, 6-y, 211 + (len % t6963->cellhgt));
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Draws a horizontal bar to the right.
|
||||
//
|
||||
void
|
||||
t6963_hbar (int x, int y, int len)
|
||||
{
|
||||
int stop = x + len/t6963->cellwid;
|
||||
for (; x <= stop; x++)
|
||||
t6963_chr (x, y, 219);
|
||||
|
||||
if (len % t6963->cellwid)
|
||||
t6963_chr (x, y, 225 - (len % t6963->cellwid));
|
||||
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// Sets character 0 to an icon...
|
||||
//
|
||||
void
|
||||
t6963_icon (int which, char dest)
|
||||
{
|
||||
// printf("Char %i set to icon %i\n", dest, which);
|
||||
}
|
||||
|
||||
void
|
||||
t6963_draw_frame (char *dat)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if(!dat) return;
|
||||
|
||||
for(x=1; x<=t6963->wid; x++)
|
||||
{
|
||||
t6963_chr (x, 1, '-');
|
||||
t6963_chr (x, 6, '-');
|
||||
}
|
||||
|
||||
for(y=0; y<t6963->hgt; y++)
|
||||
{
|
||||
for(x=0; x<t6963->wid; x++)
|
||||
t6963_chr(x+1, y+1, dat[x+(y*t6963->wid)]);
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Tries to read a character from an input device...
|
||||
//
|
||||
// Return 0 for "nothing available".
|
||||
//
|
||||
char
|
||||
t6963_getkey ()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
t6963_low_data (u8 byte)
|
||||
{
|
||||
// lcd_wait_until_ready();
|
||||
|
||||
T6963_CDLO;
|
||||
T6963_WRLO; // activate LCD's write mode
|
||||
outb_p(byte, T6963_DATA_PORT); // write value to data port
|
||||
T6963_CELO; // pulse enable LOW > 80 ns (hah!)
|
||||
T6963_CEHI; // return enable HIGH
|
||||
T6963_WRHI; // restore Write mode to inactive
|
||||
}
|
||||
|
||||
void
|
||||
t6963_low_command (u8 byte)
|
||||
{
|
||||
// lcd_wait_until_ready();
|
||||
|
||||
outb_p(byte, T6963_DATA_PORT); // present data to LCD on PC's port pins
|
||||
|
||||
T6963_CDHI; // control/status mode
|
||||
T6963_RDHI; // make sure LCD read mode is off
|
||||
T6963_WRLO; // activate LCD write mode
|
||||
T6963_CELO; // pulse ChipEnable LOW, > 80 ns, enables LCD I/O
|
||||
T6963_CEHI; // disable LCD I/O
|
||||
T6963_WRHI; // deactivate write mode
|
||||
}
|
||||
|
||||
void
|
||||
t6963_low_command_byte(u8 cmd, u8 byte)
|
||||
{
|
||||
t6963_low_data(byte);
|
||||
t6963_low_command(cmd);
|
||||
}
|
||||
|
||||
void
|
||||
t6963_low_command_2_bytes(u8 cmd, u8 byte1, u8 byte2)
|
||||
{
|
||||
t6963_low_data(byte1);
|
||||
t6963_low_data(byte2);
|
||||
t6963_low_command(cmd);
|
||||
}
|
||||
|
||||
void
|
||||
t6963_low_command_word(u8 cmd, u16 word)
|
||||
{
|
||||
t6963_low_data(word%256);
|
||||
t6963_low_data(word>>8);
|
||||
t6963_low_command(cmd);
|
||||
}
|
||||
|
||||
void
|
||||
t6963_low_enable_mode (u8 mode)
|
||||
{
|
||||
t6963_display_mode |= mode;
|
||||
t6963_low_command(SET_DISPLAY_MODE | t6963_display_mode);
|
||||
}
|
||||
|
||||
void
|
||||
t6963_low_disable_mode (u8 mode)
|
||||
{
|
||||
t6963_display_mode &= ~mode;
|
||||
t6963_low_command(SET_DISPLAY_MODE | t6963_display_mode);
|
||||
}
|
||||
|
||||
void
|
||||
t6963_swap_buffers ()
|
||||
{
|
||||
u8 *tmp_buffer;
|
||||
tmp_buffer = t6963_display_buffer1;
|
||||
t6963_display_buffer1 = t6963_display_buffer2;
|
||||
t6963_display_buffer2 = tmp_buffer;
|
||||
tmp_buffer = NULL;
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* Base driver module for Toshiba T6963 based LCD displays ver 1.0.
|
||||
*
|
||||
* Parts of this file are based on the kernel driver by Alexander Frink <Alexander.Frink@Uni-Mainz.DE>
|
||||
*
|
||||
* This file is released under the GNU General Public License. Refer to the
|
||||
* COPYING file distributed with this package.
|
||||
*
|
||||
* Copyright (c) 2001 Manuel Stahl <mythos@xmythos.de>
|
||||
*/
|
||||
|
||||
#ifndef T6963_H
|
||||
#define T6963_H
|
||||
|
||||
#define SM_UP (1)
|
||||
#define SM_DOWN (2)
|
||||
#define CM_ERASE (2)
|
||||
#define CUR_LOWER_THIRD 3
|
||||
#define CUR_LOWER_HALF 4
|
||||
#define CUR_TWO_THIRDS 5
|
||||
#define CUR_BLOCK 6
|
||||
#define CUR_NONE 1
|
||||
|
||||
// take PC 1 HI
|
||||
#define T6963_CEHI outb_p(inb_p(T6963_CONTROL_PORT) & 0xfe, T6963_CONTROL_PORT)
|
||||
// take PC 1 LO
|
||||
#define T6963_CELO outb_p(inb_p(T6963_CONTROL_PORT) | 0x01, T6963_CONTROL_PORT)
|
||||
|
||||
// take PC 14 HI
|
||||
#define T6963_RDHI outb_p(inb_p(T6963_CONTROL_PORT) & 0xfd, T6963_CONTROL_PORT)
|
||||
// take PC 14 LO
|
||||
#define T6963_RDLO outb_p(inb_p(T6963_CONTROL_PORT) | 0x02, T6963_CONTROL_PORT)
|
||||
|
||||
// take PC 16 HI
|
||||
#define T6963_WRHI outb_p(inb_p(T6963_CONTROL_PORT) | 0x04, T6963_CONTROL_PORT)
|
||||
// take PC 16 LO
|
||||
#define T6963_WRLO outb_p(inb_p(T6963_CONTROL_PORT) & 0xfb, T6963_CONTROL_PORT)
|
||||
|
||||
// take PC 17 HI
|
||||
#define T6963_CDHI outb_p(inb_p(T6963_CONTROL_PORT) & 0xf7, T6963_CONTROL_PORT)
|
||||
// take PC 17 LO
|
||||
#define T6963_CDLO outb_p(inb_p(T6963_CONTROL_PORT) | 0x08, T6963_CONTROL_PORT)
|
||||
|
||||
// 8bit Data input
|
||||
#define T6963_DATAIN outb_p(inb_p(T6963_CONTROL_PORT) | 0x20, T6963_CONTROL_PORT)
|
||||
// 8bit Data output
|
||||
#define T6963_DATAOUT outb_p(inb_p(T6963_CONTROL_PORT) & 0xdf, T6963_CONTROL_PORT)
|
||||
|
||||
#define CHARGEN_BASE 0x0000
|
||||
#define TEXT_BASE 0x0800
|
||||
#define ATTRIB_BASE 0x1000
|
||||
#define ATTRIB_AREA 0x03BF
|
||||
|
||||
#define SET_CURSOR_POINTER 0x21
|
||||
#define SET_OFFSET_REGISTER 0x22
|
||||
#define SET_ADDRESS_POINTER 0x24
|
||||
|
||||
#define SET_TEXT_HOME_ADDRESS 0x40
|
||||
#define SET_TEXT_AREA 0x41
|
||||
#define SET_GRAPHIC_HOME_ADDRESS 0x42
|
||||
#define SET_GRAPHIC_AREA 0x43
|
||||
|
||||
#define SET_MODE 0x80
|
||||
#define OR_MODE 0x00
|
||||
#define EXOR_MODE 0x01
|
||||
#define AND_MODE 0x03
|
||||
#define ATTRIBUTE_MODE 0x04
|
||||
#define INTERNAL_CG 0x00
|
||||
#define EXTERNAL_CG 0x08
|
||||
|
||||
#define SET_DISPLAY_MODE 0x90
|
||||
#define BLINK_ON 0x01
|
||||
#define CURSOR_ON 0x02
|
||||
#define TEXT_ON 0x04
|
||||
#define GRAPHIC_ON 0x08
|
||||
|
||||
#define SET_CURSOR_PATTERN 0xa0
|
||||
|
||||
#define DATA_WRITE_INC 0xc0
|
||||
#define DATA_READ_INC 0xc1
|
||||
#define DATA_WRITE_DEC 0xc2
|
||||
#define DATA_READ_DEC 0xc3
|
||||
#define DATA_WRITE 0xc4
|
||||
#define DATA_READ 0xc5
|
||||
|
||||
#define AUTO_WRITE 0xb0
|
||||
#define AUTO_READ 0xb1
|
||||
#define AUTO_RESET 0xb
|
||||
|
||||
#define POSITION(x,y) ((y)*lcd.wid + (x))
|
||||
|
||||
#define T6963_DATA_PORT (t6963_out_port)
|
||||
#define T6963_STATUS_PORT (t6963_out_port+1)
|
||||
#define T6963_CONTROL_PORT (t6963_out_port+2)
|
||||
|
||||
|
||||
// ****************************************************************************************
|
||||
// * V A R I A B L E S *
|
||||
// ****************************************************************************************
|
||||
|
||||
typedef unsigned short u16;
|
||||
typedef unsigned char u8;
|
||||
|
||||
// ****************************************************************************************
|
||||
// * F U N C T I O N S *
|
||||
// ****************************************************************************************
|
||||
|
||||
extern lcd_logical_driver *t6963;
|
||||
|
||||
int t6963_init (struct lcd_logical_driver *driver, char *args);
|
||||
void t6963_close ();
|
||||
void t6963_clear ();
|
||||
void t6963_graphic_clear ();
|
||||
void t6963_flush ();
|
||||
void t6963_string (int x, int y, char string[]);
|
||||
void t6963_chr (int x, int y, char c);
|
||||
int t6963_contrast (int contrast);
|
||||
void t6963_backlight (int on);
|
||||
void t6963_vbar (int x, int len);
|
||||
void t6963_hbar (int x, int y, int len);
|
||||
void t6963_num (int x, int num);
|
||||
void t6963_init_num ();
|
||||
void t6963_set_nchar (int n, char *dat, int num);
|
||||
void t6963_set_char (int n, char *dat);
|
||||
void t6963_icon (int which, char dest);
|
||||
void t6963_flush_box (int lft, int top, int rgt, int bot);
|
||||
void t6963_draw_frame (char *dat);
|
||||
char t6963_getkey ();
|
||||
|
||||
void t6963_low_data(u8 byte);
|
||||
void t6963_low_command (u8 byte);
|
||||
|
||||
void t6963_low_command_byte(u8 cmd, u8 byte);
|
||||
void t6963_low_command_2_bytes(u8 cmd, u8 byte1, u8 byte2);
|
||||
void t6963_low_command_word(u8 cmd, u16 word);
|
||||
|
||||
void t6963_low_enable_mode (u8 mode);
|
||||
void t6963_low_disable_mode (u8 mode);
|
||||
|
||||
void t6963_swap_buffers();
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user