diff options
author | Reinhard Tartler <siretart@tauware.de> | 2007-04-30 09:35:54 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2007-04-30 09:35:54 +0200 |
commit | 874ef72c5b807b61bc53dbaa0fa623b40bff1736 (patch) | |
tree | 3c44151e2132fa82d3e7eef2aa82eee1c9e1369d /drv_Trefon.c | |
parent | cbaf3ad73900f63eae0add0e33439a1bf04b5a1e (diff) | |
download | lcd4linux-874ef72c5b807b61bc53dbaa0fa623b40bff1736.tar.gz |
new upstream version
Diffstat (limited to 'drv_Trefon.c')
-rw-r--r-- | drv_Trefon.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/drv_Trefon.c b/drv_Trefon.c index 4baf94e..9bffa8b 100644 --- a/drv_Trefon.c +++ b/drv_Trefon.c @@ -1,4 +1,4 @@ -/* $Id: drv_Trefon.c 728 2007-01-14 11:14:38Z michael $ +/* $Id: drv_Trefon.c 773 2007-02-25 12:39:09Z michael $ * $URL: https://ssl.bulix.org/svn/lcd4linux/branches/0.10.1/drv_Trefon.c $ * * driver for TREFON USB LCD displays - http://www.trefon.de @@ -126,22 +126,22 @@ static int drv_TF_close(void) } -static void drv_TF_send(char *data, int size) +static void drv_TF_send(unsigned char *data, int size) { - char buffer[64]; + unsigned char buffer[64]; /* the controller always wants a 64-byte packet */ memset(buffer, 0, 64); memcpy(buffer, data, size); - // Endpoint hardcoded to 2 - usb_bulk_write(lcd, 2, buffer, 64, 2000); + /* Endpoint hardcoded to 2 */ + usb_bulk_write(lcd, 2, (char *) buffer, 64, 2000); } static void drv_TF_command(const unsigned char cmd) { - char buffer[4] = { PKT_START, PKT_CTRL, 0, PKT_END }; + unsigned char buffer[4] = { PKT_START, PKT_CTRL, 0, PKT_END }; buffer[2] = cmd; drv_TF_send(buffer, 4); } @@ -155,27 +155,27 @@ static void drv_TF_clear(void) static void drv_TF_write(const int row, const int col, const char *data, const int len) { - char buffer[64]; - char *p; + unsigned char buffer[64]; + unsigned char *p; int pos = 0; - if (DCOLS == 8 && DROWS == 1) { // 8x1 Characters + if (DCOLS == 8 && DROWS == 1) { /* 8x1 Characters */ pos = row * 0x40 + col; - } else if (DCOLS == 16 && DROWS == 2) { // 16x2 Characters + } else if (DCOLS == 16 && DROWS == 2) { /* 16x2 Characters */ pos = row * 0x40 + col; - } else if (DCOLS == 20 && DROWS == 4) { // 20x4 Characters + } else if (DCOLS == 20 && DROWS == 4) { /* 20x4 Characters */ pos = row * 0x20 + col; } else { error("%s: internal error: DCOLS=%d DROWS=%d", Name, DCOLS, DROWS); return; } - // combine the GOTO and the data into one packet + /* combine the GOTO and the data into one packet */ p = buffer; *p++ = PKT_START; - *p++ = PKT_CTRL; // Goto + *p++ = PKT_CTRL; /* Goto */ *p++ = 0x80 | pos; - *p++ = PKT_DATA; // Data + *p++ = PKT_DATA; /* Data */ *p++ = (char) len; for (pos = 0; pos < len; pos++) { *p++ = *data++; @@ -189,8 +189,8 @@ static void drv_TF_write(const int row, const int col, const char *data, const i static void drv_TF_defchar(const int ascii, const unsigned char *matrix) { - char buffer[14]; - char *p; + unsigned char buffer[14]; + unsigned char *p; int i; p = buffer; @@ -210,7 +210,7 @@ static void drv_TF_defchar(const int ascii, const unsigned char *matrix) static int drv_TF_backlight(int backlight) { - char buffer[4] = { PKT_START, PKT_BACKLIGHT, 0, PKT_END }; + unsigned char buffer[4] = { PKT_START, PKT_BACKLIGHT, 0, PKT_END }; if (backlight < 0) backlight = 0; @@ -224,7 +224,7 @@ static int drv_TF_backlight(int backlight) } -// test for existing resolutions from TREFON USB-LCDs (TEXT-Mode only) +/* test for existing resolutions from TREFON USB-LCDs (TEXT-Mode only) */ int drv_TF_valid_resolution(int rows, int cols) { @@ -326,7 +326,7 @@ int drv_TF_init(const char *section, const int quiet) int asc255bug; int ret; - info("%s: %s", Name, "$Rev: 728 $"); + info("%s: %s", Name, "$Rev: 773 $"); /* display preferences */ XRES = 5; /* pixel width of one char */ @@ -411,8 +411,8 @@ int drv_TF_quit(const int quiet) DRIVER drv_Trefon = { - name:Name, - list:drv_TF_list, - init:drv_TF_init, - quit:drv_TF_quit, + .name = Name, + .list = drv_TF_list, + .init = drv_TF_init, + .quit = drv_TF_quit, }; |