* Add support for arbitrary bitmaps for TRAB's VFD command

* Patch by Christian Geiinger, 19 May 2002:
  On TRAB: wait until the dummy byte has been completely sent
This commit is contained in:
wdenk 2003-05-20 20:49:01 +00:00
parent 7f70e85309
commit 82226bf4d2
5 changed files with 40 additions and 35 deletions

View File

@ -2,6 +2,11 @@
Changes since U-Boot 0.3.1: 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: * Patch by David Updegraff, 22 Apr 2003:
update for CrayL1 board update for CrayL1 board

View File

@ -328,6 +328,7 @@ static void spi_init(void)
for (i = 0; i < 10; i++) { for (i = 0; i < 10; i++) {
rSPTDAT = 0xFF; rSPTDAT = 0xFF;
} }
wait_transmit_done();
} }
static void wait_transmit_done(void) static void wait_transmit_done(void)

View File

@ -36,11 +36,10 @@
#include <command.h> #include <command.h>
#if (CONFIG_COMMANDS & CFG_CMD_VFD) #if (CONFIG_COMMANDS & CFG_CMD_VFD)
#ifdef VFD_TEST_LOGO
#include <vfd_logo.h> #include <vfd_logo.h>
#define VFD_TEST_LOGO_BMPNR 0 #define VFD_TEST_LOGO_BMPNR 0
#define VFD_REMOTE_LOGO_BMPNR 1 #define VFD_REMOTE_LOGO_BMPNR 1
#endif
extern int transfer_pic(unsigned char, unsigned char *, int, int); extern int transfer_pic(unsigned char, unsigned char *, int, int);
@ -55,26 +54,30 @@ int do_vfd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 1; 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 */ #endif /* CFG_CMD_VFD */
#ifdef CONFIG_VFD #ifdef CONFIG_VFD
int trab_vfd (ulong bitmap) int trab_vfd (ulong bitmap)
{ {
switch (bitmap) { switch (bitmap) {
#ifdef VFD_TEST_LOGO
case VFD_TEST_LOGO_BMPNR: case VFD_TEST_LOGO_BMPNR:
transfer_pic(1, &vfd_test_logo_bitmap[0], transfer_pic(1, &vfd_test_logo_bitmap[0],
VFD_TEST_LOGO_HEIGHT, VFD_TEST_LOGO_WIDTH); VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
return 0; return 0;
case VFD_REMOTE_LOGO_BMPNR: case VFD_REMOTE_LOGO_BMPNR:
transfer_pic(1, &vfd_remote_logo_bitmap[0], transfer_pic(1, &vfd_remote_logo_bitmap[0],
VFD_REMOTE_LOGO_HEIGHT, VFD_REMOTE_LOGO_WIDTH); VFD_LOGO_HEIGHT, VFD_LOGO_WIDTH);
return 0; return 0;
#endif
default: default:
printf("Unknown bitmap %ld\n", bitmap); printf("Unknown bitmap %ld\n", bitmap);
return 1; return 1;

View File

@ -31,8 +31,10 @@
#define CMD_TBL_VFD MK_CMD_TBL_ENTRY( \ #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", \ "vfd - load a bitmap to the VFDs on TRAB\n", \
"N\n" \ "#N\n" \
" - load bitmap N to the VFDs (N is _decimal_ !!!)\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 */ /* Implemented in common/cmd_misc.c */

View File

@ -6,13 +6,13 @@
*/ */
#ifndef __VFD_TEST_LOGO_H__ #ifndef __VFD_LOGO_H__
#define __VFD_TEST_LOGO_H__ #define __VFD_LOGO_H__
#define VFD_TEST_LOGO_WIDTH 112 #define VFD_LOGO_WIDTH 112
#define VFD_TEST_LOGO_HEIGHT 72 #define VFD_LOGO_HEIGHT 72
#define VFD_TEST_LOGO_COLORS 0 #define VFD_LOGO_COLORS 0
#define VFD_TEST_LOGO_OFFSET 0 #define VFD_LOGO_OFFSET 0
unsigned char vfd_test_logo_bitmap[] = { unsigned char vfd_test_logo_bitmap[] = {
@ -522,12 +522,6 @@ unsigned char vfd_test_logo_bitmap[] = {
0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDD, 0xDD, 0xDD, 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[] = { unsigned char vfd_remote_logo_bitmap[] = {
0x99, 0x99, 0x99, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0x99, 0x9F, 0xFF, 0xFF, 0xFF, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 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, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9, 0x99, 0x99, 0x99,
}; };
#endif /* __VFD_TEST_LOGO_H__ */ #endif /* __VFD_LOGO_H__ */