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

Dependents:   mbed_PT6312

This library is documented here.

Committer:
wim
Date:
Wed Jan 20 18:50:50 2016 +0000
Revision:
6:d3dc313a6840
Parent:
5:be9ec73af639
Rename Digit/Grid, added DVD462 code, added C2233 code, added fonts.

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 5:be9ec73af639 3 * 2015, v02: WH, Test DVP630
wim 1:c5e247159aa6 4 *
wim 1:c5e247159aa6 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
wim 1:c5e247159aa6 6 * of this software and associated documentation files (the "Software"), to deal
wim 1:c5e247159aa6 7 * in the Software without restriction, including without limitation the rights
wim 1:c5e247159aa6 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
wim 1:c5e247159aa6 9 * copies of the Software, and to permit persons to whom the Software is
wim 1:c5e247159aa6 10 * furnished to do so, subject to the following conditions:
wim 1:c5e247159aa6 11 *
wim 1:c5e247159aa6 12 * The above copyright notice and this permission notice shall be included in
wim 1:c5e247159aa6 13 * all copies or substantial portions of the Software.
wim 1:c5e247159aa6 14 *
wim 1:c5e247159aa6 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
wim 1:c5e247159aa6 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
wim 1:c5e247159aa6 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
wim 1:c5e247159aa6 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
wim 1:c5e247159aa6 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
wim 1:c5e247159aa6 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
wim 1:c5e247159aa6 21 * THE SOFTWARE.
wim 1:c5e247159aa6 22 */
wim 3:156c23d9652a 23 #ifndef MBED_FONT_16SEG_H
wim 3:156c23d9652a 24 #define MBED_FONT_16SEG_H
wim 1:c5e247159aa6 25
wim 5:be9ec73af639 26 // Select one of the testboards for Princeton PT6312 VFD controller
wim 5:be9ec73af639 27 #include "PT6312_Config.h"
wim 5:be9ec73af639 28
wim 5:be9ec73af639 29 #if (DVP630_TEST == 1)
wim 5:be9ec73af639 30 //#if (1)
wim 3:156c23d9652a 31 // Segment bit positions for 14 or 16 Segment display using the Philips DVP630 and DVD737 mapping for PT6312
wim 3:156c23d9652a 32 // Modify this table for different 'bit-to-segment' mappings. The ASCII character defines and the FONT_16S const table below
wim 3:156c23d9652a 33 // will be adapted automatically according to the bit-to-segment mapping. Obviously this will only work when the segment
wim 3:156c23d9652a 34 // mapping is identical for every digit position. This will be the case unless the hardware designer really hates software developers.
wim 3:156c23d9652a 35 //
wim 2:f010b7022803 36 #define S_A1 0x0001 // Assuming 2 part A segment
wim 1:c5e247159aa6 37 #define S_A2 0x0001
wim 2:f010b7022803 38 #define S_J 0x0002 // Assuming linked J and P segments
wim 1:c5e247159aa6 39 #define S_P 0x0002
wim 1:c5e247159aa6 40 #define S_H 0x0004
wim 1:c5e247159aa6 41 #define S_K 0x0008
wim 1:c5e247159aa6 42 #define S_B 0x0010
wim 1:c5e247159aa6 43 #define S_F 0x0020
wim 2:f010b7022803 44 #define S_G2 0x0040 // Assuming 2 part G segment (ie linked G and M segment)
wim 1:c5e247159aa6 45 #define S_G1 0x0080
wim 1:c5e247159aa6 46 #define S_C 0x0100
wim 1:c5e247159aa6 47 #define S_E 0x0200
wim 1:c5e247159aa6 48 #define S_R 0x0400
wim 1:c5e247159aa6 49 #define S_N 0x0800
wim 3:156c23d9652a 50 #define S_D1 0x1000 // Assuming 2 part D segment
wim 1:c5e247159aa6 51 #define S_D2 0x1000
wim 1:c5e247159aa6 52 #define S_S 0x4000
wim 5:be9ec73af639 53
wim 5:be9ec73af639 54 //Icons All Grids
wim 2:f010b7022803 55 //#define S_DP 0x8000 // Assuming single DP segment
wim 2:f010b7022803 56
wim 5:be9ec73af639 57 //Icons Grid 3
wim 5:be9ec73af639 58 #define S_COL3 0x2000
wim 5:be9ec73af639 59
wim 5:be9ec73af639 60 //Icons Grid 5
wim 5:be9ec73af639 61 #define S_COL5 0x2000
wim 5:be9ec73af639 62
wim 2:f010b7022803 63 //Mask for blending out and restoring Icons
wim 3:156c23d9652a 64 //One mask pattern will be sufficient assuming that all digits use the same mapping.
wim 5:be9ec73af639 65 #define S_ICON_MSK (S_COL3)
wim 5:be9ec73af639 66
wim 5:be9ec73af639 67 #endif
wim 2:f010b7022803 68
wim 1:c5e247159aa6 69
wim 2:f010b7022803 70 // ASCII Font definitions for segments in each character
wim 2:f010b7022803 71 //
wim 2:f010b7022803 72 //32 0x20
wim 3:156c23d9652a 73 #define C_SPC (0x0000) //Space
wim 2:f010b7022803 74 #define C_EXC (S_B | S_C) //!
wim 2:f010b7022803 75 #define C_QTE (S_B | S_F) //"
wim 2:f010b7022803 76 #define C_HSH (S_B | S_C | S_D1 | S_D2 | S_G1 | S_G2 | S_J | S_P) //#
wim 2:f010b7022803 77 #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 78 #define C_PCT (S_C | S_F | S_K | S_R | S_S) //%
wim 2:f010b7022803 79 //#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 80 #define C_AMP (S_C | S_D1 | S_D2 | S_E | S_F | S_G1 | S_H | S_N | S_S) //&
wim 2:f010b7022803 81 #define C_ACC (S_B) //'
wim 2:f010b7022803 82 #define C_LBR (S_K | S_N) //(
wim 2:f010b7022803 83 #define C_RBR (S_H | S_R) //)
wim 2:f010b7022803 84 #define C_MLT (S_G1 | S_G2 | S_J | S_P | S_K | S_N | S_H | S_R | S_S) //*
wim 2:f010b7022803 85 #define C_PLS (S_G1 | S_G2 | S_J | S_P | S_S) //+
wim 2:f010b7022803 86 #define C_CMA (S_C) //,
wim 2:f010b7022803 87 #define C_MIN (S_G1 | S_G2 | S_S) //-
wim 2:f010b7022803 88 #define C_DOT (S_C) //.
wim 2:f010b7022803 89 #define C_RS (S_K | S_R | S_S) // /
wim 3:156c23d9652a 90 //48 0x30 digits
wim 2:f010b7022803 91 #define C_0 (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 2:f010b7022803 92 #define C_1 (S_B | S_C)
wim 2:f010b7022803 93 #define C_2 (S_A1 | S_A2 | S_B | S_D1 | S_D2 | S_E | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 94 #define C_3 (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_G2 | S_S)
wim 2:f010b7022803 95 #define C_4 (S_B | S_C | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 96 #define C_5 (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 97 #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 98 #define C_7 (S_A1 | S_A2 | S_B | S_C)
wim 2:f010b7022803 99 #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 100 #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 101 //58 0x3A
wim 2:f010b7022803 102 #define C_COL (S_D1 | S_D2 | S_G1 | S_G2 | S_S) // :
wim 2:f010b7022803 103 #define C_SCL (S_D1 | S_D2 | S_G1 | S_G2 | S_S) // ;
wim 2:f010b7022803 104 #define C_LT (S_K | S_N | S_S) // <
wim 2:f010b7022803 105 #define C_EQ (S_D1 | S_D2 | S_G1 | S_G2 | S_S) // =
wim 2:f010b7022803 106 #define C_GT (S_H | S_R | S_S) // >
wim 2:f010b7022803 107 //#define C_QM (S_A1 | S_A2 | S_B | S_G2 | S_P) // Not correct when J and P are linked
wim 2:f010b7022803 108 #define C_QM (S_A1 | S_A2 | S_B | S_G2 | S_R | S_S) // ?
wim 2:f010b7022803 109 //64 0x40
wim 2:f010b7022803 110 //#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 111 #define C_AT (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_G1 | S_S) // @
wim 3:156c23d9652a 112 #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 113 #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 114 #define C_C (S_A1 | S_A2 | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 115 #define C_D (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 116 #define C_E (S_A1 | S_A2 | S_D1 | S_D2 | S_E | S_F | S_G1 | S_S)
wim 1:c5e247159aa6 117 #define C_F (S_A1 | S_A2 | S_E | S_F | S_G1 | S_S)
wim 1:c5e247159aa6 118 #define C_G (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_E | S_F | S_G2 | S_S)
wim 1:c5e247159aa6 119 #define C_H (S_B | S_C | S_E | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 120 #define C_I (S_A1 | S_A2 | S_D1 | S_D2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 121 #define C_J (S_B | S_C | S_D1 | S_D2 | S_E)
wim 1:c5e247159aa6 122 #define C_K (S_E | S_F | S_G1 | S_K | S_N | S_S)
wim 1:c5e247159aa6 123 #define C_L (S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 124 #define C_M (S_B | S_C | S_E | S_F | S_H | S_K | S_S)
wim 1:c5e247159aa6 125 #define C_N (S_B | S_C | S_E | S_F | S_H | S_N | S_S)
wim 1:c5e247159aa6 126 #define C_O (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 127 #define C_P (S_A1 | S_A2 | S_B | S_E | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 128 #define C_Q (S_A1 | S_A2 | S_B | S_C | S_D1 | S_D2 | S_E | S_F | S_N)
wim 1:c5e247159aa6 129 #define C_R (S_A1 | S_A2 | S_B | S_E | S_F | S_G1 | S_G2 | S_N | S_S)
wim 1:c5e247159aa6 130 #define C_S (S_A1 | S_A2 | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 1:c5e247159aa6 131 #define C_T (S_A1 | S_A2 | S_J | S_P | S_S)
wim 1:c5e247159aa6 132 #define C_U (S_B | S_C | S_D1 | S_D2 | S_E | S_F)
wim 1:c5e247159aa6 133 #define C_V (S_E | S_F | S_R | S_K | S_S)
wim 1:c5e247159aa6 134 #define C_W (S_B | S_C | S_E | S_F | S_N | S_R | S_S)
wim 1:c5e247159aa6 135 #define C_X (S_H | S_K | S_N | S_R | S_S)
wim 1:c5e247159aa6 136 //#define C_Y (S_H | S_K | S_P | S_S) // Not correct when J and P are linked
wim 1:c5e247159aa6 137 #define C_Y (S_B | S_C | S_D1 | S_D2 | S_F | S_G1 | S_G2 | S_S)
wim 2:f010b7022803 138 #define C_Z (S_A1 | S_A2 | S_D1 | S_D2 | S_K | S_R | S_S)
wim 2:f010b7022803 139 //91 0x5B
wim 2:f010b7022803 140 #define C_SBL (S_A1 | S_D1 | S_E | S_F) // [
wim 3:156c23d9652a 141 #define C_LS (S_H | S_N | S_S) // left slash
wim 2:f010b7022803 142 #define C_SBR (S_A2 | S_B | S_C | S_D2) // ]
wim 2:f010b7022803 143 #define C_PWR (S_N | S_R | S_S) // ^
wim 2:f010b7022803 144 #define C_UDS (S_D1 | S_D2)
wim 2:f010b7022803 145 #define C_DSH (S_H) // `
wim 2:f010b7022803 146 //97 0x61
wim 3:156c23d9652a 147 // a...z No defines provided. Just use the Upper case characters again
wim 2:f010b7022803 148 //122
wim 2:f010b7022803 149
wim 2:f010b7022803 150 //123 0x7B
wim 2:f010b7022803 151 #define C_CBL (S_G1 | S_J | S_P | S_S) // {
wim 2:f010b7022803 152 #define C_OR (S_J | S_P | S_S) // |
wim 2:f010b7022803 153 #define C_CBR (S_G2 | S_J | S_P | S_S) // }
wim 2:f010b7022803 154 #define C_TLD (S_B | S_E | S_G1 | S_G2 | S_S) // ~
wim 2:f010b7022803 155 #define C_DEL (0x0000)
wim 3:156c23d9652a 156
wim 3:156c23d9652a 157 //User Defined Characters (some examples)
wim 3:156c23d9652a 158 #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 159
wim 3:156c23d9652a 160 #define UDC_WHEEL0 (S_G1 | S_G2 | S_S) // -
wim 3:156c23d9652a 161 #define UDC_WHEEL1 (S_H | S_N | S_S) /* \ */
wim 3:156c23d9652a 162 #define UDC_WHEEL2 (S_J | S_P | S_S) // |
wim 3:156c23d9652a 163 #define UDC_WHEEL3 (S_K | S_R | S_S) // /
wim 3:156c23d9652a 164 #define UDC_WHEEL4 (S_G1 | S_G2 | S_S) // -
wim 3:156c23d9652a 165 #define UDC_WHEEL5 (S_H | S_N | S_S) /* \ */
wim 3:156c23d9652a 166 #define UDC_WHEEL6 (S_J | S_P | S_S) // |
wim 3:156c23d9652a 167 #define UDC_WHEEL7 (S_K | S_R | S_S) // /
wim 2:f010b7022803 168
wim 2:f010b7022803 169 // Font data selection for transmission to PT6512 memory
wim 2:f010b7022803 170 #define LO(x) ( x & 0xFF)
wim 2:f010b7022803 171 #define HI(x) ((x >> 8) & 0xFF)
wim 2:f010b7022803 172
wim 1:c5e247159aa6 173
wim 3:156c23d9652a 174 // ASCII Font definition table
wim 2:f010b7022803 175 //
wim 2:f010b7022803 176 #define FONT_16S_START 0x20
wim 2:f010b7022803 177 #define FONT_16S_END 0x7F
wim 2:f010b7022803 178 //#define FONT_16S_NR_CHARS (FONT_16S_END - FONT_16S_START + 1)
wim 3:156c23d9652a 179 extern const char FONT_16S[][2];
wim 3:156c23d9652a 180
wim 3:156c23d9652a 181
wim 3:156c23d9652a 182 // Wheel animation definition table
wim 3:156c23d9652a 183 extern const int WHEEL_ANI[];
wim 3:156c23d9652a 184 #endif