📄 vfdshare.h
字号:
/* Copyright 1998, ESS Technology, Inc. *//* SCCSID @(#)vfdshare.h 4.1 11/05/02 *//* Based on vfdshare.h 3.1 08/27/01 *//* * $Log$ */#ifndef _VFDSHARE_H_#define _VFDSHARE_H_/* * This file can be shared by all vfd_tbl.c. This allows easier and * more consistent customization. * * Customization steps: * - Find the VFD anode connection table for your VFD. It looks * something like: * 7G 6G 5G 4G 3G 2G 1G * P1 * P2 x * ... * P16 * * In each grid point, there is a corresponding symbol. Use the * following macros to represent the symbol, e.g. * * #define ICON_x ANODE_G5P2 * * - You may notice that we have * 1 <= P <= 16 and 1 <= G <= 16 * * Unfortunately, some of the VFD's have P equal to 17 or more, e.g. * 7G 6G 5G 4G 3G 2G 1G * P1 * P2 * ... * P16 * P17 a b c d e f g * * In which case, treat * G1P17 to G1P24 as G8P1 to G8P8 * G2P17 to G2P24 as G8P9 to G8P16 * G3P17 to G3P24 as G9P1 to G9P8 * G4P17 to G4P24 as G9P9 to G9P16 * G5P17 to G5P24 as G10P1 to G10P8 * G6P17 to G6P24 as G10P9 to G10P16 * G7P17 to G7P24 as G11P1 to G11P8 * * Graphically, our code "thinks" the VFD looks like: * * 11G 10G 9G 8G 7G 6G 5G 4G 3G 2G 1G * P1 g e c a * P2 * ... * P9 f d b * ... * P16 * * This way, you can still use the same set of macro without having * to redefine them. * * - Customize your REFERSH_ADDRESS table. GxPx corresponds to how * we internally treat the VFD table. However, the actual hardware * may use a different convention. REFRESH_ADDRESS table will link * the two sets together. * * If your P is <= 16, then refresh table is simplying * * unsigned char REFRESH_ADDRESS[] = {0, 1, 2, ..., 2*G-1}; * * If your 17 <= P <= 24, since the way our code represents the VFD * is different from the actual VFD, the refresh table looks like: * * unsigned char REFRESH_ADDRESS[] = { * 0, 1, * 3, 4, * 6, 7, * ... * 3G-3, 3G-2, * 2, * 5, * ... * 3G-1 * }; * * In other words, we use our internal representation to index * the REFERSH_ADDRESS table, while the content of the table gives * the actual VFD address from hardware's point of view. *//* * VFD anode connections. It is usually represented in a 2D grid of G * and P. We'll define macros here so customization can be a direct * translation of G's and P's * * Convention: * In binary format, we have xxxxyzzzzzzzz, where * xxxx: Encoded G-1 * y: 0- P1 to P8 * 1- P9 to P16 * zzzzzzzz: P1 = 0x1; P2 = 0x2; P3 = 0x4; P4 = 0x8; * P5 = 0x10; P6 = 0x20; P7 = 0x40; P8 = 0x80; * */#define ANODE_G1P1 0x0001#define ANODE_G1P2 0x0002#define ANODE_G1P3 0x0004#define ANODE_G1P4 0x0008#define ANODE_G1P5 0x0010#define ANODE_G1P6 0x0020#define ANODE_G1P7 0x0040#define ANODE_G1P8 0x0080#define ANODE_G1P9 0x0101#define ANODE_G1P10 0x0102#define ANODE_G1P11 0x0104#define ANODE_G1P12 0x0108#define ANODE_G1P13 0x0110#define ANODE_G1P14 0x0120#define ANODE_G1P15 0x0140#define ANODE_G1P16 0x0180#define ANODE_G2P1 0x0201#define ANODE_G2P2 0x0202#define ANODE_G2P3 0x0204#define ANODE_G2P4 0x0208#define ANODE_G2P5 0x0210#define ANODE_G2P6 0x0220#define ANODE_G2P7 0x0240#define ANODE_G2P8 0x0280#define ANODE_G2P9 0x0301#define ANODE_G2P10 0x0302#define ANODE_G2P11 0x0304#define ANODE_G2P12 0x0308#define ANODE_G2P13 0x0310#define ANODE_G2P14 0x0320#define ANODE_G2P15 0x0340#define ANODE_G2P16 0x0380#define ANODE_G3P1 0x0401#define ANODE_G3P2 0x0402#define ANODE_G3P3 0x0404#define ANODE_G3P4 0x0408#define ANODE_G3P5 0x0410#define ANODE_G3P6 0x0420#define ANODE_G3P7 0x0440#define ANODE_G3P8 0x0480#define ANODE_G3P9 0x0501#define ANODE_G3P10 0x0502#define ANODE_G3P11 0x0504#define ANODE_G3P12 0x0508#define ANODE_G3P13 0x0510#define ANODE_G3P14 0x0520#define ANODE_G3P15 0x0540#define ANODE_G3P16 0x0580#define ANODE_G4P1 0x0601#define ANODE_G4P2 0x0602#define ANODE_G4P3 0x0604#define ANODE_G4P4 0x0608#define ANODE_G4P5 0x0610#define ANODE_G4P6 0x0620#define ANODE_G4P7 0x0640#define ANODE_G4P8 0x0680#define ANODE_G4P9 0x0701#define ANODE_G4P10 0x0702#define ANODE_G4P11 0x0704#define ANODE_G4P12 0x0708#define ANODE_G4P13 0x0710#define ANODE_G4P14 0x0720#define ANODE_G4P15 0x0740#define ANODE_G4P16 0x0780#define ANODE_G5P1 0x0801#define ANODE_G5P2 0x0802#define ANODE_G5P3 0x0804#define ANODE_G5P4 0x0808#define ANODE_G5P5 0x0810#define ANODE_G5P6 0x0820#define ANODE_G5P7 0x0840#define ANODE_G5P8 0x0880#define ANODE_G5P9 0x0901#define ANODE_G5P10 0x0902#define ANODE_G5P11 0x0904#define ANODE_G5P12 0x0908#define ANODE_G5P13 0x0910#define ANODE_G5P14 0x0920#define ANODE_G5P15 0x0940#define ANODE_G5P16 0x0980#define ANODE_G6P1 0x0a01#define ANODE_G6P2 0x0a02#define ANODE_G6P3 0x0a04#define ANODE_G6P4 0x0a08#define ANODE_G6P5 0x0a10#define ANODE_G6P6 0x0a20#define ANODE_G6P7 0x0a40#define ANODE_G6P8 0x0a80#define ANODE_G6P9 0x0b01#define ANODE_G6P10 0x0b02#define ANODE_G6P11 0x0b04#define ANODE_G6P12 0x0b08#define ANODE_G6P13 0x0b10#define ANODE_G6P14 0x0b20#define ANODE_G6P15 0x0b40#define ANODE_G6P16 0x0b80#define ANODE_G7P1 0x0c01#define ANODE_G7P2 0x0c02#define ANODE_G7P3 0x0c04#define ANODE_G7P4 0x0c08#define ANODE_G7P5 0x0c10#define ANODE_G7P6 0x0c20#define ANODE_G7P7 0x0c40#define ANODE_G7P8 0x0c80#define ANODE_G7P9 0x0d01#define ANODE_G7P10 0x0d02#define ANODE_G7P11 0x0d04#define ANODE_G7P12 0x0d08#define ANODE_G7P13 0x0d10#define ANODE_G7P14 0x0d20#define ANODE_G7P15 0x0d40#define ANODE_G7P16 0x0d80#define ANODE_G8P1 0x0e01#define ANODE_G8P2 0x0e02#define ANODE_G8P3 0x0e04#define ANODE_G8P4 0x0e08#define ANODE_G8P5 0x0e10#define ANODE_G8P6 0x0e20#define ANODE_G8P7 0x0e40#define ANODE_G8P8 0x0e80#define ANODE_G8P9 0x0f01#define ANODE_G8P10 0x0f02#define ANODE_G8P11 0x0f04#define ANODE_G8P12 0x0f08#define ANODE_G8P13 0x0f10#define ANODE_G8P14 0x0f20#define ANODE_G8P15 0x0f40#define ANODE_G8P16 0x0f80#define ANODE_G9P1 0x1001#define ANODE_G9P2 0x1002#define ANODE_G9P3 0x1004#define ANODE_G9P4 0x1008#define ANODE_G9P5 0x1010#define ANODE_G9P6 0x1020#define ANODE_G9P7 0x1040#define ANODE_G9P8 0x1080#define ANODE_G9P9 0x1101#define ANODE_G9P10 0x1102#define ANODE_G9P11 0x1104#define ANODE_G9P12 0x1108#define ANODE_G9P13 0x1110#define ANODE_G9P14 0x1120#define ANODE_G9P15 0x1140#define ANODE_G9P16 0x1180#define ANODE_G10P1 0x1201#define ANODE_G10P2 0x1202#define ANODE_G10P3 0x1204#define ANODE_G10P4 0x1208#define ANODE_G10P5 0x1210#define ANODE_G10P6 0x1220#define ANODE_G10P7 0x1240#define ANODE_G10P8 0x1280#define ANODE_G10P9 0x1301#define ANODE_G10P10 0x1302#define ANODE_G10P11 0x1304#define ANODE_G10P12 0x1308#define ANODE_G10P13 0x1310#define ANODE_G10P14 0x1320#define ANODE_G10P15 0x1340#define ANODE_G10P16 0x1380#define ANODE_G11P1 0x1401#define ANODE_G11P2 0x1402#define ANODE_G11P3 0x1404#define ANODE_G11P4 0x1408#define ANODE_G11P5 0x1410#define ANODE_G11P6 0x1420#define ANODE_G11P7 0x1440#define ANODE_G11P8 0x1480#define ANODE_G11P9 0x1501#define ANODE_G11P10 0x1502#define ANODE_G11P11 0x1504#define ANODE_G11P12 0x1508#define ANODE_G11P13 0x1510#define ANODE_G11P14 0x1520#define ANODE_G11P15 0x1540#define ANODE_G11P16 0x1580#define ANODE_G12P1 0x1601#define ANODE_G12P2 0x1602#define ANODE_G12P3 0x1604#define ANODE_G12P4 0x1608#define ANODE_G12P5 0x1610#define ANODE_G12P6 0x1620#define ANODE_G12P7 0x1640#define ANODE_G12P8 0x1680#define ANODE_G12P9 0x1701#define ANODE_G12P10 0x1702#define ANODE_G12P11 0x1704#define ANODE_G12P12 0x1708#define ANODE_G12P13 0x1710#define ANODE_G12P14 0x1720#define ANODE_G12P15 0x1740#define ANODE_G12P16 0x1780#define ANODE_G13P1 0x1801#define ANODE_G13P2 0x1802#define ANODE_G13P3 0x1804#define ANODE_G13P4 0x1808#define ANODE_G13P5 0x1810#define ANODE_G13P6 0x1820#define ANODE_G13P7 0x1840#define ANODE_G13P8 0x1880#define ANODE_G13P9 0x1901#define ANODE_G13P10 0x1902#define ANODE_G13P11 0x1904#define ANODE_G13P12 0x1908#define ANODE_G13P13 0x1910#define ANODE_G13P14 0x1920#define ANODE_G13P15 0x1940#define ANODE_G13P16 0x1980#define ANODE_G14P1 0x1a01#define ANODE_G14P2 0x1a02#define ANODE_G14P3 0x1a04#define ANODE_G14P4 0x1a08#define ANODE_G14P5 0x1a10#define ANODE_G14P6 0x1a20#define ANODE_G14P7 0x1a40#define ANODE_G14P8 0x1a80#define ANODE_G14P9 0x1b01#define ANODE_G14P10 0x1b02#define ANODE_G14P11 0x1b04#define ANODE_G14P12 0x1b08#define ANODE_G14P13 0x1b10#define ANODE_G14P14 0x1b20#define ANODE_G14P15 0x1b40#define ANODE_G14P16 0x1b80#define ANODE_G15P1 0x1c01#define ANODE_G15P2 0x1c02#define ANODE_G15P3 0x1c04#define ANODE_G15P4 0x1c08#define ANODE_G15P5 0x1c10#define ANODE_G15P6 0x1c20#define ANODE_G15P7 0x1c40#define ANODE_G15P8 0x1c80#define ANODE_G15P9 0x1d01#define ANODE_G15P10 0x1d02#define ANODE_G15P11 0x1d04#define ANODE_G15P12 0x1d08#define ANODE_G15P13 0x1d10#define ANODE_G15P14 0x1d20#define ANODE_G15P15 0x1d40#define ANODE_G15P16 0x1d80#define ANODE_G16P1 0x1e01#define ANODE_G16P2 0x1e02#define ANODE_G16P3 0x1e04#define ANODE_G16P4 0x1e08#define ANODE_G16P5 0x1e10#define ANODE_G16P6 0x1e20#define ANODE_G16P7 0x1e40#define ANODE_G16P8 0x1e80#define ANODE_G16P9 0x1f01#define ANODE_G16P10 0x1f02#define ANODE_G16P11 0x1f04#define ANODE_G16P12 0x1f08#define ANODE_G16P13 0x1f10#define ANODE_G16P14 0x1f20#define ANODE_G16P15 0x1f40#define ANODE_G16P16 0x1f80/* * Base on the xxxxyzzzzzzzz convention, if we just take the upper * byte, we get the following. * * These macros are useful for specifying VFD digits. */#define ANODE_G1L 0x00#define ANODE_G1H 0x01#define ANODE_G2L 0x02#define ANODE_G2H 0x03#define ANODE_G3L 0x04#define ANODE_G3H 0x05#define ANODE_G4L 0x06#define ANODE_G4H 0x07#define ANODE_G5L 0x08#define ANODE_G5H 0x09#define ANODE_G6L 0x0a#define ANODE_G6H 0x0b#define ANODE_G7L 0x0c#define ANODE_G7H 0x0d#define ANODE_G8L 0x0e#define ANODE_G8H 0x0f#define ANODE_G9L 0x10#define ANODE_G9H 0x11#define ANODE_G10L 0x12#define ANODE_G10H 0x13#define ANODE_G11L 0x14#define ANODE_G11H 0x15#define ANODE_G12L 0x16#define ANODE_G12H 0x17#define ANODE_G13L 0x18#define ANODE_G13H 0x19#define ANODE_G14L 0x1a#define ANODE_G14H 0x1b#define ANODE_G15L 0x1c#define ANODE_G15H 0x1d#define ANODE_G16L 0x1e#define ANODE_G16H 0x1f/* * Offset of tt:mm:ss etc in VFD_char_segments table. Some VFD's have * special character such as 100+ minutes and title (for DVD). * * Make sure "VFD_char_segments table" is constructed according to * the following offsets. */#define VFD_TRACK 0 /* Track high, track low */#define VFD_MINUTE 2 /* Minute high, minute low */#define VFD_SECOND 4 /* Second high, second low */#define VFD_MIN100 6 /* 100+ minutes */#define VFD_TITLE 7 /* Title high, title low */#define VFD_CHAPTER 7 /* Chapter high, title low, fut106.vfd use only */#if (defined(VFD_ZEC1301) || defined(VFD_VIALTA))#define VFD_HOUR 9#endif/************************************************************************ * typedef used by mktable and microvfd.c * ************************************************************************//* 7-segment definitions (really 8 segments) for character pairs */typedef struct { unsigned short seg[16]; /* 7 (or 8) segments */ /* now, extends to 16 segments */ } VFD_CHAR_SEGMENTS;/* * 7 segment: * * a * ------- * f | \ | b * | g\ | * ------- * e | \ | c * | h \ | * ------- * d * */#define SEG7_A 0x01#define SEG7_B 0x02#define SEG7_C 0x04#define SEG7_D 0x08#define SEG7_E 0x10#define SEG7_F 0x20#define SEG7_G 0x40#define SEG8_H 0x80/* * 10 segment: * * a * ------- * f | \h k/ | b * | \ / | * ------- * e | g \ | c * | n \ | * ------- * d * */#define SEG10_A 0x01#define SEG10_B 0x02#define SEG10_C 0x04#define SEG10_D 0x08#define SEG10_E 0x10#define SEG10_F 0x20#define SEG10_G 0x40#define SEG10_H 0x80#define SEG10_N 0x100#define SEG10_K 0x200/* * 14 segment: * * a * --------- * f | \h | k/ | b * | \ j / | * -g-----m- * e | / | \ | c * |r/ p \n| * --------- * d * */#define SEG14_A 0x01#define SEG14_B 0x02#define SEG14_C 0x04#define SEG14_D 0x08#define SEG14_E 0x10#define SEG14_F 0x20#define SEG14_G 0x40#define SEG14_M 0x80#define SEG14_J 0x100#define SEG14_P 0x200#define SEG14_N 0x400#define SEG14_H 0x800#define SEG14_K 0x1000#define SEG14_R 0x2000#define CHAR_A (SEG7_F | SEG7_E | SEG7_A | SEG7_B | SEG7_C | SEG7_G)#define CHAR_b (SEG7_F | SEG7_E | SEG7_G | SEG7_C | SEG7_D)#define CHAR_C (SEG7_A | SEG7_F | SEG7_E | SEG7_D)#define CHAR_d (SEG7_G | SEG7_E | SEG7_D | SEG7_B | SEG7_C)#define CHAR_E (SEG7_F | SEG7_E | SEG7_A | SEG7_G | SEG7_D)#define CHAR_F (SEG7_F | SEG7_E | SEG7_A | SEG7_G)#define CHAR_g (SEG7_A | SEG7_F | SEG7_G | SEG7_B | SEG7_C | SEG7_D)#define CHAR_H (SEG7_F | SEG7_E | SEG7_G | SEG7_B | SEG7_C)#define CHAR_I (SEG7_F | SEG7_E)#define CHAR_L (SEG7_F | SEG7_E | SEG7_D)#define CHAR_n (SEG7_F | SEG7_E | SEG7_A | SEG7_B | SEG7_C)#define CHAR_O (SEG7_A | SEG7_B | SEG7_C | SEG7_D | SEG7_E | SEG7_F)#define CHAR_P (SEG7_F | SEG7_E | SEG7_A | SEG7_B | SEG7_G)#define CHAR_q (SEG7_A | SEG7_F | SEG7_G | SEG7_B | SEG7_C)#define CHAR_R (SEG7_E | SEG7_G)#define CHAR_S (SEG7_A | SEG7_F | SEG7_G | SEG7_C | SEG7_D)#define CHAR_t (SEG7_F | SEG7_E | SEG7_D | SEG7_G) #define CHAR_U (SEG7_F | SEG7_E | SEG7_D | SEG7_C | SEG7_B)#define CHAR_y (SEG7_F | SEG7_G | SEG7_B | SEG7_C)#define CHAR__ (SEG7_G)#define CHAR_ 0x00#define CHAR_end (SEG7_A | SEG7_B | SEG7_C | SEG7_D | SEG7_E | SEG7_F | \ SEG7_G | SEG8_H)/* For VFD characters with 8 segments only! */#define CHAR_N (SEG7_F | SEG7_E | SEG8_H | SEG7_C | SEG7_B)#define CHAR_V (SEG8_H | SEG7_C | SEG7_B)/* For VFD characters with 10 segments only! */#define CHAR_NN (SEG7_F | SEG7_E | SEG10_H | SEG10_N | SEG7_C | SEG7_B)#define CHAR_0 CHAR_O#define CHAR_1 (SEG7_B | SEG7_C)#define CHAR_2 (SEG7_A | SEG7_B | SEG7_G | SEG7_E | SEG7_D)#define CHAR_3 (SEG7_A | SEG7_B | SEG7_G | SEG7_C | SEG7_D)#define CHAR_4 (SEG7_F | SEG7_G | SEG7_B | SEG7_C)#define CHAR_5 CHAR_S#define CHAR_6 (SEG7_A | SEG7_F | SEG7_E | SEG7_G | SEG7_C | SEG7_D)#define CHAR_7 (SEG7_A | SEG7_B | SEG7_C)#define CHAR_8 (SEG7_A | SEG7_B | SEG7_C | SEG7_D | SEG7_E | SEG7_F | SEG7_G)#define CHAR_9 CHAR_g#endif /* _VFDSHARE_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -