3 // ****************************************************************************
4 // vfd.h (C) 1992-2003 Christophe de Dinechin (ddd)
6 // ****************************************************************************
10 // Defines for controlling the VFD800 hardware
19 // ****************************************************************************
20 // This document is confidential.
21 // Do not redistribute without written permission
22 // ****************************************************************************
24 // * Revision : $Revision$
26 // ****************************************************************************
29 // ============================================================================
31 // High-level functions
33 // ============================================================================
35 extern int VFD_Init();
36 extern void VFD_EnableScreen(int screen0
, int screen1
);
37 extern void VFD_Brightness(float brightness
);
38 extern void VFD_SetX(int X
);
39 extern void VFD_SetY(int Y
);
40 extern void VFD_SetXY(int X
, int Y
);
41 extern void VFD_Char(char c
);
42 extern void VFD_Text(char *txt
);
46 // ============================================================================
48 // Low-level functions
50 // ============================================================================
52 extern void VFD_Command(int command
);
53 extern void VFD_Data(int data
);
54 extern char VFD_Font
[256][6];
58 // ============================================================================
60 // Low-level command defines
62 // ============================================================================
64 #define DATAPORT 0x378 /* printer port base address */
65 #define CONTROLPORT 0x37A /* print port control address */
72 #define INIT800A 0x5F /* initialization code sequence */
74 #define INIT800C(n) 0x00+n
76 #define CLEARSCREENS 0x5e /* clear all screens (layers) */
77 #define LAYER0ON 0x24 /* screen0 both on */
78 #define LAYER1ON 0x28 /* screen1 both on */
79 #define LAYERSON 0x2c /* both screens both on */
80 #define LAYERSOFF 0x20 /* screens both off */
81 #define ORON 0x40 /* OR screens */
82 #define ANDON 0x48 /* AND screens */
83 #define XORON 0x44 /* XOR screens */
84 #define SETX 0x64 /* set X position */
85 #define SETY 0x60 /* set Y position */
86 #define HSHIFT 0x70 /* set horizontal shift */
88 #define AUTOINCOFF 0x80 /* address auto increment off */
89 #define AUTOINCX 0x84 // Auto-increment X axis
90 #define AUTOINCY 0x82 // Auto-increment Y axis
91 #define AUTOINCXY 0x86 // Auto-increment Y axis
92 #define SETPOSITION 0xff
94 #define MS * 1000 // 1ms = 1000us