diff options
author | wdenk <wdenk> | 2003-05-20 20:49:01 +0000 |
---|---|---|
committer | wdenk <wdenk> | 2003-05-20 20:49:01 +0000 |
commit | 82226bf4d2fe87076d7f5d7e2677fdd5d0e35fc2 (patch) | |
tree | 5d03167fc333d401f2eea37dcad640b77516d4d3 | |
parent | 7f70e85309c6367138c0ebd14abdd49964b8d50a (diff) |
* Add support for arbitrary bitmaps for TRAB's VFD commandLABEL_2003_05_20_2250
* Patch by Christian Geißinger, 19 May 2002:
On TRAB: wait until the dummy byte has been completely sent
-rw-r--r-- | CHANGELOG | 5 | ||||
-rw-r--r-- | board/trab/trab.c | 5 | ||||
-rw-r--r-- | common/cmd_vfd.c | 37 | ||||
-rw-r--r-- | include/cmd_vfd.h | 8 | ||||
-rw-r--r-- | include/vfd_logo.h | 20 |
5 files changed, 40 insertions, 35 deletions
diff --git a/CHANGELOG b/CHANGELOG index 2a1ce93c103..6341f28ec5f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,6 +2,11 @@ Changes since U-Boot 0.3.1: ====================================================================== +* Add support for arbitrary bitmaps for TRAB's VFD command + +* Patch by Christian Geißinger, 19 May 2002: + On TRAB: wait until the dummy byte has been completely sent + * Patch by David Updegraff, 22 Apr 2003: update for CrayL1 board diff --git a/board/trab/trab.c b/board/trab/trab.c index e3e8553eb79..6c9971f3b60 100644 --- a/board/trab/trab.c +++ b/board/trab/trab.c @@ -33,7 +33,7 @@ #ifdef CFG_BRIGHTNESS static void spi_init(void); static void wait_transmit_done(void); -static void tsc2000_write(unsigned int page, unsigned int reg, +static void tsc2000_write(unsigned int page, unsigned int reg, unsigned int data); static void tsc2000_set_brightness(void); #endif @@ -328,6 +328,7 @@ static void spi_init(void) for (i = 0; i < 10; i++) { rSPTDAT = 0xFF; } + wait_transmit_done(); } static void wait_transmit_done(void) @@ -335,7 +336,7 @@ static void wait_transmit_done(void) while (!(rSPSTA & 0x01)); /* wait until transfer is done */ } -static void tsc2000_write(unsigned int page, unsigned int reg, +static void tsc2000_write(unsigned int page, unsigned int reg, unsigned int data) { unsigned int command; diff --git a/common/cmd_vfd.c b/common/cmd_vfd.c index 49df56c9f04..ac0224c087e 100644 --- a/common/cmd_vfd.c +++ b/common/cmd_vfd.c @@ -36,11 +36,10 @@ #include <command.h> #if (CONFIG_COMMANDS & CFG_CMD_VFD) -#ifdef VFD_TEST_LOGO + #include <vfd_logo.h> #define VFD_TEST_LOGO_BMPNR 0 #define VFD_REMOTE_LOGO_BMPNR 1 -#endif extern int transfer_pic(unsigned char, unsigned char *, int, int); @@ -55,9 +54,15 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } - bitmap = simple_strtoul(argv[1], NULL, 10); + if (argv[1][0] == '#') { /* select bitmap by number */ + bitmap = simple_strtoul(argv[1]+1, NULL, 10); + return (trab_vfd(bitmap)); + } - return (trab_vfd(bitmap)); + /* display bitmap at given address */ + bitmap = simple_strtoul(argv[1], NULL, 16); + transfer_pic(1, (uchar *)bitmap, VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH); + return 0; } #endif /* CFG_CMD_VFD */ @@ -65,19 +70,17 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) int trab_vfd (ulong bitmap) { switch (bitmap) { -#ifdef VFD_TEST_LOGO - case VFD_TEST_LOGO_BMPNR: - transfer_pic(1, &vfd_test_logo_bitmap[0], - VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH); - return 0; - case VFD_REMOTE_LOGO_BMPNR: - transfer_pic(1, &vfd_remote_logo_bitmap[0], - VFD_REMOTE_LOGO_HEIGHT, VFD_REMOTE_LOGO_WIDTH); - return 0; -#endif - default: - printf("Unknown bitmap %ld\n", bitmap); - return 1; + case VFD_TEST_LOGO_BMPNR: + transfer_pic(1, &vfd_test_logo_bitmap[0], + VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH); + return 0; + case VFD_REMOTE_LOGO_BMPNR: + transfer_pic(1, &vfd_remote_logo_bitmap[0], + VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH); + return 0; + default: + printf("Unknown bitmap %ld\n", bitmap); + return 1; } /* NOTREACHED */ } diff --git a/include/cmd_vfd.h b/include/cmd_vfd.h index 40a9b34322b..ad6f21afb05 100644 --- a/include/cmd_vfd.h +++ b/include/cmd_vfd.h @@ -29,10 +29,12 @@ #if (CONFIG_COMMANDS & CFG_CMD_VFD) #define CMD_TBL_VFD MK_CMD_TBL_ENTRY( \ - "vfd", 3, 2, 0, do_vfd, \ + "vfd", 3, 2, 0, do_vfd, \ "vfd - load a bitmap to the VFDs on TRAB\n", \ - "N\n" \ - " - load bitmap N to the VFDs (N is _decimal_ !!!)\n"\ + "#N\n" \ + " - load bitmap no. N to the VFDs (N is _decimal_ !!!)\n" \ + "vfd addr\n" \ + " - load bitmap at address _addr_ to the VFDs\n" \ ), /* Implemented in common/cmd_misc.c */ diff --git a/include/vfd_logo.h b/include/vfd_logo.h index bda20cd0e6e..c41867a8426 100644 --- a/include/vfd_logo.h +++ b/include/vfd_logo.h @@ -6,13 +6,13 @@ */ -#ifndef __VFD_TEST_LOGO_H__ -#define __VFD_TEST_LOGO_H__ +#ifndef __VFD_LOGO_H__ +#define __VFD_LOGO_H__ -#define VFD_TEST_LOGO_WIDTH 112 -#define VFD_TEST_LOGO_HEIGHT 72 -#define VFD_TEST_LOGO_COLORS 0 -#define VFD_TEST_LOGO_OFFSET 0 +#define VFD_LOGO_WIDTH 112 +#define VFD_LOGO_HEIGHT 72 +#define VFD_LOGO_COLORS 0 +#define VFD_LOGO_OFFSET 0 unsigned char vfd_test_logo_bitmap[] = { @@ -522,12 +522,6 @@ unsigned char vfd_test_logo_bitmap[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xDD, 0xDD, }; -#define VFD_REMOTE_LOGO_WIDTH 112 -#define VFD_REMOTE_LOGO_HEIGHT 72 -#define VFD_REMOTE_LOGO_COLORS 0 -#define VFD_REMOTE_LOGO_OFFSET 0 - - unsigned char vfd_remote_logo_bitmap[] = { 0x99, 0x99, 0x99, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, @@ -1035,4 +1029,4 @@ unsigned char vfd_remote_logo_bitmap[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x99, 0x99, 0x99, }; -#endif /* __VFD_TEST_LOGO_H__ */ +#endif /* __VFD_LOGO_H__ */ |