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

Dependents:   mbed_PT6312

This library is documented here.

Committer:
wim
Date:
Thu Sep 10 18:40:51 2015 +0000
Revision:
3:156c23d9652a
Parent:
2:f010b7022803
Child:
5:be9ec73af639
First Release

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wim 2:f010b7022803 1 /* mbed VFD Font Library, for Princeton PT6312 VFD controller as used in Philips DVP630
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 3:156c23d9652a 22 #ifndef MBED_FONT_16SEG_H
wim 3:156c23d9652a 23 #define MBED_FONT_16SEG_H
wim 1:c5e247159aa6 24
wim 3:156c23d9652a 25 // Segment bit positions for 14 or 16 Segment display using the Philips DVP630 and DVD737 mapping for PT6312
wim 3:156c23d9652a 26 // Modify this table for different 'bit-to-segment' mappings. The ASCII character defines and the FONT_16S const table below
wim 3:156c23d9652a 27 // will be adapted automatically according to the bit-to-segment mapping. Obviously this will only work when the segment
wim 3:156c23d9652a 28 // mapping is identical for every digit position. This will be the case unless the hardware designer really hates software developers.
wim 3:156c23d9652a 29 //
wim 2:f010b7022803 30 #define S_A1 0x0001 // Assuming 2 part A segment
wim 1:c5e247159aa6 31 #define S_A2 0x0001
wim 2:f010b7022803 32 #define S_J 0x0002 // Assuming linked J and P segments
wim 1:c5e247159aa6 33 #define S_P 0x0002
wim 1:c5e247159aa6 34 #define S_H 0x0004
wim 1:c5e247159aa6 35 #define S_K 0x0008
wim 1:c5e247159aa6 36 #define S_B 0x0010
wim 1:c5e247159aa6 37 #define S_F 0x0020
wim 2:f010b7022803 38 #define S_G2 0x0040 // Assuming 2 part G segment (ie linked G and M segment)
wim 1:c5e247159aa6 39 #define S_G1 0x0080
wim 1:c5e247159aa6 40 #define S_C 0x0100
wim 1:c5e247159aa6 41 #define S_E 0x0200
wim 1:c5e247159aa6 42 #define S_R 0x0400
wim 1:c5e247159aa6 43 #define S_N 0x0800
wim 3:156c23d9652a 44 #define S_D1 0x1000 // Assuming 2 part D segment
wim 1:c5e247159aa6 45 #define S_D2 0x1000
wim 1:c5e247159aa6 46 #define S_COL 0x2000
wim 1:c5e247159aa6 47 #define S_S 0x4000
wim 2:f010b7022803 48 //#define S_DP 0x8000 // Assuming single DP segment
wim 2:f010b7022803 49
wim 2:f010b7022803 50 //Mask for blending out and restoring Icons
wim 3:156c23d9652a 51 //One mask pattern will be sufficient assuming that all digits use the same mapping.
wim 2:f010b7022803 52 #define S_ICON_MSK (S_COL)
wim 2:f010b7022803 53
wim 1:c5e247159aa6 54
wim 2:f010b7022803 55 // ASCII Font definitions for segments in each character
wim 2:f010b7022803 56 //
wim 2:f010b7022803 57 //32 0x20
wim 3:156c23d9652a 58 #define C_SPC (0x0000) //Space
wim 2:f010b7022803 59 #define C_EXC (S_B | S_C) //!
wim 2:f010b7022803 60 #define C_QTE (S_B | S_F) //"
wim 2:f010b7022803 61 #define C_HSH (S_B | S_C | S_D1 | S_D2 | S_G1 | S_G2 | S_J | S_P) //#
wim 2:f010b7022803 62 #define C_DLR (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_J | S_P | S_S) //$
wim 2:f010b7022803 63 #define C_PCT (S_C | S_F | S_K | S_R | S_S) //%
wim 2:f010b7022803 64 //#define C_AMP (S_A1 | S_C | S_D1 | S_D2 | S_E | S_G1 | S_J | S_H | S_N) // Not correct when J and P are linked
wim 2:f010b7022803 65 #define C_AMP (S_C | S_D1 | S_D2 | S_E | S_F | S_G1 | S_H | S_N | S_S) //&
wim 2:f010b7022803 66 #define C_ACC (S_B) //'
wim 2:f010b7022803 67 #define C_LBR (S_K | S_N) //(
wim 2:f010b7022803 68 #define C_RBR (S_H | S_R) //)
wim 2:f010b7022803 69 #define C_MLT (S_G1 | S_G2 | S_J | S_P | S_K | S_N | S_H | S_R | S_S) //*
wim 2:f010b7022803 70 #define C_PLS (S_G1 | S_G2 | S_J | S_P | S_S) //+
wim 2:f010b7022803 71 #define C_CMA (S_C) //,
wim 2:f010b7022803 72 #define C_MIN (S_G1 | S_G2 | S_S) //-
wim 2:f010b7022803 73 #define C_DOT (S_C) //.
wim 2:f010b7022803 74 #define C_RS (S_K | S_R | S_S) // /
wim 3:156c23d9652a 75 //48 0x30 digits
wim 2:f010b7022803 76 #define C_0 (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 2:f010b7022803 77 #define C_1 (S_B | S_C)
wim 2:f010b7022803 78 #define C_2 (S_A1 | S_A2 | S_B | S_D1 | S_D2 | S_E | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 79 #define C_3 (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_G2 | S_S)
wim 2:f010b7022803 80 #define C_4 (S_B | S_C | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 81 #define C_5 (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 82 #define C_6 (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_E | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 83 #define C_7 (S_A1 | S_A2 | S_B | S_C)
wim 2:f010b7022803 84 #define C_8 (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 85 #define C_9 (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 86 //58 0x3A
wim 2:f010b7022803 87 #define C_COL (S_D1 | S_D2 | S_G1 | S_G2 | S_S) // :
wim 2:f010b7022803 88 #define C_SCL (S_D1 | S_D2 | S_G1 | S_G2 | S_S) // ;
wim 2:f010b7022803 89 #define C_LT (S_K | S_N | S_S) // <
wim 2:f010b7022803 90 #define C_EQ (S_D1 | S_D2 | S_G1 | S_G2 | S_S) // =
wim 2:f010b7022803 91 #define C_GT (S_H | S_R | S_S) // >
wim 2:f010b7022803 92 //#define C_QM (S_A1 | S_A2 | S_B | S_G2 | S_P) // Not correct when J and P are linked
wim 2:f010b7022803 93 #define C_QM (S_A1 | S_A2 | S_B | S_G2 | S_R | S_S) // ?
wim 2:f010b7022803 94 //64 0x40
wim 2:f010b7022803 95 //#define C_AT (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_G1 | S_P | S_S) // Not correct when J and P are linked
wim 2:f010b7022803 96 #define C_AT (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_G1 | S_S) // @
wim 3:156c23d9652a 97 #define C_A (S_A1 | S_A2 | S_B | S_C | S_E | S_F | S_G1 | S_G2 | S_S) // Upper case alphabet
wim 1:c5e247159aa6 98 #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 99 #define C_C (S_A1 | S_A2 | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 100 #define C_D (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 101 #define C_E (S_A1 | S_A2 | S_D1 | S_D2 | S_E | S_F | S_G1 | S_S)
wim 1:c5e247159aa6 102 #define C_F (S_A1 | S_A2 | S_E | S_F | S_G1 | S_S)
wim 1:c5e247159aa6 103 #define C_G (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_E | S_F | S_G2 | S_S)
wim 1:c5e247159aa6 104 #define C_H (S_B | S_C | S_E | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 105 #define C_I (S_A1 | S_A2 | S_D1 | S_D2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 106 #define C_J (S_B | S_C | S_D1 | S_D2 | S_E)
wim 1:c5e247159aa6 107 #define C_K (S_E | S_F | S_G1 | S_K | S_N | S_S)
wim 1:c5e247159aa6 108 #define C_L (S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 109 #define C_M (S_B | S_C | S_E | S_F | S_H | S_K | S_S)
wim 1:c5e247159aa6 110 #define C_N (S_B | S_C | S_E | S_F | S_H | S_N | S_S)
wim 1:c5e247159aa6 111 #define C_O (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 112 #define C_P (S_A1 | S_A2 | S_B | S_E | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 113 #define C_Q (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F | S_N)
wim 1:c5e247159aa6 114 #define C_R (S_A1 | S_A2 | S_B | S_E | S_F | S_G1 | S_G2 | S_N | S_S)
wim 1:c5e247159aa6 115 #define C_S (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 116 #define C_T (S_A1 | S_A2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 117 #define C_U (S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 118 #define C_V (S_E | S_F | S_R | S_K | S_S)
wim 1:c5e247159aa6 119 #define C_W (S_B | S_C | S_E | S_F | S_N | S_R | S_S)
wim 1:c5e247159aa6 120 #define C_X (S_H | S_K | S_N | S_R | S_S)
wim 1:c5e247159aa6 121 //#define C_Y (S_H | S_K | S_P | S_S) // Not correct when J and P are linked
wim 1:c5e247159aa6 122 #define C_Y (S_B | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 123 #define C_Z (S_A1 | S_A2 | S_D1 | S_D2 | S_K | S_R | S_S)
wim 2:f010b7022803 124 //91 0x5B
wim 2:f010b7022803 125 #define C_SBL (S_A1 | S_D1 | S_E | S_F) // [
wim 3:156c23d9652a 126 #define C_LS (S_H | S_N | S_S) // left slash
wim 2:f010b7022803 127 #define C_SBR (S_A2 | S_B | S_C | S_D2) // ]
wim 2:f010b7022803 128 #define C_PWR (S_N | S_R | S_S) // ^
wim 2:f010b7022803 129 #define C_UDS (S_D1 | S_D2)
wim 2:f010b7022803 130 #define C_DSH (S_H) // `
wim 2:f010b7022803 131 //97 0x61
wim 3:156c23d9652a 132 // a...z No defines provided. Just use the Upper case characters again
wim 2:f010b7022803 133 //122
wim 2:f010b7022803 134
wim 2:f010b7022803 135 //123 0x7B
wim 2:f010b7022803 136 #define C_CBL (S_G1 | S_J | S_P | S_S) // {
wim 2:f010b7022803 137 #define C_OR (S_J | S_P | S_S) // |
wim 2:f010b7022803 138 #define C_CBR (S_G2 | S_J | S_P | S_S) // }
wim 2:f010b7022803 139 #define C_TLD (S_B | S_E | S_G1 | S_G2 | S_S) // ~
wim 2:f010b7022803 140 #define C_DEL (0x0000)
wim 3:156c23d9652a 141
wim 3:156c23d9652a 142 //User Defined Characters (some examples)
wim 3:156c23d9652a 143 #define UDC_SANDHR (S_A1 | S_A2 | S_D1 | S_D2 | S_H | S_K | S_N | S_R | S_S) //Sandhour
wim 3:156c23d9652a 144
wim 3:156c23d9652a 145 #define UDC_WHEEL0 (S_G1 | S_G2 | S_S) // -
wim 3:156c23d9652a 146 #define UDC_WHEEL1 (S_H | S_N | S_S) /* \ */
wim 3:156c23d9652a 147 #define UDC_WHEEL2 (S_J | S_P | S_S) // |
wim 3:156c23d9652a 148 #define UDC_WHEEL3 (S_K | S_R | S_S) // /
wim 3:156c23d9652a 149 #define UDC_WHEEL4 (S_G1 | S_G2 | S_S) // -
wim 3:156c23d9652a 150 #define UDC_WHEEL5 (S_H | S_N | S_S) /* \ */
wim 3:156c23d9652a 151 #define UDC_WHEEL6 (S_J | S_P | S_S) // |
wim 3:156c23d9652a 152 #define UDC_WHEEL7 (S_K | S_R | S_S) // /
wim 2:f010b7022803 153
wim 2:f010b7022803 154 // Font data selection for transmission to PT6512 memory
wim 2:f010b7022803 155 #define LO(x) ( x & 0xFF)
wim 2:f010b7022803 156 #define HI(x) ((x >> 8) & 0xFF)
wim 2:f010b7022803 157
wim 1:c5e247159aa6 158
wim 3:156c23d9652a 159 // ASCII Font definition table
wim 2:f010b7022803 160 //
wim 2:f010b7022803 161 #define FONT_16S_START 0x20
wim 2:f010b7022803 162 #define FONT_16S_END 0x7F
wim 2:f010b7022803 163 //#define FONT_16S_NR_CHARS (FONT_16S_END - FONT_16S_START + 1)
wim 3:156c23d9652a 164 extern const char FONT_16S[][2];
wim 3:156c23d9652a 165
wim 3:156c23d9652a 166
wim 3:156c23d9652a 167 // Wheel animation definition table
wim 3:156c23d9652a 168 extern const int WHEEL_ANI[];
wim 3:156c23d9652a 169 #endif