Library for the Princeton PT6312 Vacuum Fluorescent Display (VFD) driver.

Dependents:   mbed_PT6312

This library is documented here.

Committer:
wim
Date:
Tue Aug 25 20:38:30 2015 +0000
Revision:
1:c5e247159aa6
Child:
2:f010b7022803
First lib version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wim 1:c5e247159aa6 1 /* mbed VFD Font Library, for Princeton PT6312 VFD controller
wim 1:c5e247159aa6 2 * Copyright (c) 2015, v01: WH, Initial version
wim 1:c5e247159aa6 3 *
wim 1:c5e247159aa6 4 * Permission is hereby granted, free of charge, to any person obtaining a copy
wim 1:c5e247159aa6 5 * of this software and associated documentation files (the "Software"), to deal
wim 1:c5e247159aa6 6 * in the Software without restriction, including without limitation the rights
wim 1:c5e247159aa6 7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
wim 1:c5e247159aa6 8 * copies of the Software, and to permit persons to whom the Software is
wim 1:c5e247159aa6 9 * furnished to do so, subject to the following conditions:
wim 1:c5e247159aa6 10 *
wim 1:c5e247159aa6 11 * The above copyright notice and this permission notice shall be included in
wim 1:c5e247159aa6 12 * all copies or substantial portions of the Software.
wim 1:c5e247159aa6 13 *
wim 1:c5e247159aa6 14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
wim 1:c5e247159aa6 15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
wim 1:c5e247159aa6 16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
wim 1:c5e247159aa6 17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
wim 1:c5e247159aa6 18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
wim 1:c5e247159aa6 19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
wim 1:c5e247159aa6 20 * THE SOFTWARE.
wim 1:c5e247159aa6 21 */
wim 1:c5e247159aa6 22
wim 1:c5e247159aa6 23 // Segment bit positions for 14 or 16 Segment display following the Philips DVD625 and DVD737 mapping for PT6312
wim 1:c5e247159aa6 24 // Modify this table for different hardware. The Font definition table below will be automatically adapted.
wim 1:c5e247159aa6 25 #define S_A1 0x0001
wim 1:c5e247159aa6 26 #define S_A2 0x0001
wim 1:c5e247159aa6 27 #define S_J 0x0002
wim 1:c5e247159aa6 28 #define S_P 0x0002
wim 1:c5e247159aa6 29 #define S_H 0x0004
wim 1:c5e247159aa6 30 #define S_K 0x0008
wim 1:c5e247159aa6 31 #define S_B 0x0010
wim 1:c5e247159aa6 32 #define S_F 0x0020
wim 1:c5e247159aa6 33 #define S_G2 0x0040
wim 1:c5e247159aa6 34 #define S_G1 0x0080
wim 1:c5e247159aa6 35 #define S_C 0x0100
wim 1:c5e247159aa6 36 #define S_E 0x0200
wim 1:c5e247159aa6 37 #define S_R 0x0400
wim 1:c5e247159aa6 38 #define S_N 0x0800
wim 1:c5e247159aa6 39 #define S_D1 0x1000
wim 1:c5e247159aa6 40 #define S_D2 0x1000
wim 1:c5e247159aa6 41 #define S_COL 0x2000
wim 1:c5e247159aa6 42 #define S_S 0x4000
wim 1:c5e247159aa6 43 //#define S_DP 0x8000
wim 1:c5e247159aa6 44
wim 1:c5e247159aa6 45 #define LO(x) ( x & 0xFF)
wim 1:c5e247159aa6 46 #define HI(x) ((x >> 8) & 0xFF)
wim 1:c5e247159aa6 47
wim 1:c5e247159aa6 48 // Segment definition for each character
wim 1:c5e247159aa6 49
wim 1:c5e247159aa6 50 #define C_A (S_A1 | S_A2 | S_B | S_C | S_E | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 51 #define C_B (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_J | S_P | S_G2 | S_S)
wim 1:c5e247159aa6 52 #define C_C (S_A1 | S_A2 | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 53 #define C_D (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 54 #define C_E (S_A1 | S_A2 | S_D1 | S_D2 | S_E | S_F | S_G1 | S_S)
wim 1:c5e247159aa6 55 #define C_F (S_A1 | S_A2 | S_E | S_F | S_G1 | S_S)
wim 1:c5e247159aa6 56 #define C_G (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_E | S_F | S_G2 | S_S)
wim 1:c5e247159aa6 57 #define C_H (S_B | S_C | S_E | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 58 #define C_I (S_A1 | S_A2 | S_D1 | S_D2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 59 #define C_J (S_B | S_C | S_D1 | S_D2 | S_E)
wim 1:c5e247159aa6 60 #define C_K (S_E | S_F | S_G1 | S_K | S_N | S_S)
wim 1:c5e247159aa6 61 #define C_L (S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 62 #define C_M (S_B | S_C | S_E | S_F | S_H | S_K | S_S)
wim 1:c5e247159aa6 63 #define C_N (S_B | S_C | S_E | S_F | S_H | S_N | S_S)
wim 1:c5e247159aa6 64 #define C_O (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 65 #define C_P (S_A1 | S_A2 | S_B | S_E | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 66 #define C_Q (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F | S_N)
wim 1:c5e247159aa6 67 #define C_R (S_A1 | S_A2 | S_B | S_E | S_F | S_G1 | S_G2 | S_N | S_S)
wim 1:c5e247159aa6 68 #define C_S (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 69 #define C_T (S_A1 | S_A2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 70 #define C_U (S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 71 #define C_V (S_E | S_F | S_R | S_K | S_S)
wim 1:c5e247159aa6 72 #define C_W (S_B | S_C | S_E | S_F | S_N | S_R | S_S)
wim 1:c5e247159aa6 73 #define C_X (S_H | S_K | S_N | S_R | S_S)
wim 1:c5e247159aa6 74 //#define C_Y (S_H | S_K | S_P | S_S) // Not correct when J and P are linked
wim 1:c5e247159aa6 75 #define C_Y (S_B | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 76 #define C_Z (S_A1 | S_A1 | S_A2 | S_D1 | S_D2 | S_K | S_R | S_S)
wim 1:c5e247159aa6 77
wim 1:c5e247159aa6 78 const char font_16A[][2] = { {LO(C_A), HI(C_A)},
wim 1:c5e247159aa6 79 {LO(C_B), HI(C_B)},
wim 1:c5e247159aa6 80 {LO(C_C), HI(C_C)},
wim 1:c5e247159aa6 81 {LO(C_D), HI(C_D)},
wim 1:c5e247159aa6 82 {LO(C_E), HI(C_E)},
wim 1:c5e247159aa6 83 {LO(C_F), HI(C_F)},
wim 1:c5e247159aa6 84 {LO(C_G), HI(C_G)},
wim 1:c5e247159aa6 85 {LO(C_H), HI(C_H)},
wim 1:c5e247159aa6 86 {LO(C_I), HI(C_I)},
wim 1:c5e247159aa6 87 {LO(C_J), HI(C_J)},
wim 1:c5e247159aa6 88 {LO(C_K), HI(C_K)},
wim 1:c5e247159aa6 89 {LO(C_L), HI(C_L)},
wim 1:c5e247159aa6 90 {LO(C_M), HI(C_M)},
wim 1:c5e247159aa6 91 {LO(C_N), HI(C_N)},
wim 1:c5e247159aa6 92 {LO(C_O), HI(C_O)},
wim 1:c5e247159aa6 93 {LO(C_P), HI(C_P)},
wim 1:c5e247159aa6 94 {LO(C_Q), HI(C_Q)},
wim 1:c5e247159aa6 95 {LO(C_R), HI(C_R)},
wim 1:c5e247159aa6 96 {LO(C_S), HI(C_S)},
wim 1:c5e247159aa6 97 {LO(C_T), HI(C_T)},
wim 1:c5e247159aa6 98 {LO(C_U), HI(C_U)},
wim 1:c5e247159aa6 99 {LO(C_V), HI(C_V)},
wim 1:c5e247159aa6 100 {LO(C_W), HI(C_W)},
wim 1:c5e247159aa6 101 {LO(C_X), HI(C_X)},
wim 1:c5e247159aa6 102 {LO(C_Y), HI(C_Y)},
wim 1:c5e247159aa6 103 {LO(C_Z), HI(C_Z)}};
wim 1:c5e247159aa6 104