PT6315 VFD driver. Supports DVDR3510.

Dependents:   mbed_PT6315

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Font_16Seg.h Source File

Font_16Seg.h

00001 /* mbed VFD Font Library, for Princeton PT6315 VFD controller as used in DVDR3510
00002  * Copyright (c) 2016, v01: WH, Initial version for DVDR3510
00003  *
00004  * Permission is hereby granted, free of charge, to any person obtaining a copy
00005  * of this software and associated documentation files (the "Software"), to deal
00006  * in the Software without restriction, including without limitation the rights
00007  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00008  * copies of the Software, and to permit persons to whom the Software is
00009  * furnished to do so, subject to the following conditions:
00010  *
00011  * The above copyright notice and this permission notice shall be included in
00012  * all copies or substantial portions of the Software.
00013  *
00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00015  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00019  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00020  * THE SOFTWARE.
00021  */
00022 #ifndef MBED_FONT_16SEG_H
00023 #define MBED_FONT_16SEG_H
00024 
00025 // Select one of the testboards for Princeton PT6315 VFD controller
00026 #include "PT6315_Config.h"
00027 
00028 #if (DVDR3510_TEST == 1) 
00029 //#if (1) 
00030 // Segment bit positions for 14 or 16 Segment display using the DVDR3510 mapping for PT6315
00031 // Modify this table for different 'bit-to-segment' mappings. The ASCII character defines and the FONT_16S const table below 
00032 // will be adapted automatically according to the bit-to-segment mapping. Obviously this will only work when the segment
00033 // mapping is identical for every digit position. This will be the case unless the hardware designer really hates software developers.
00034 //
00035 //           A1   A2
00036 //          ---- ----
00037 //         |H\ J|  /K|     
00038 //       F |  \ | /  | B    
00039 //         |G1 \|/ G2|     
00040 //          --- + ---
00041 //         |   /|\   |     
00042 //       E |  / | \  | C    
00043 //         |N/ M|  \L|     
00044 //          ---- ----    * DP
00045 //           D1   D2
00046 //
00047 #define S16_A1   0x0001  // Assuming 2 part A segment
00048 #define S16_A2   0x0001
00049 #define S16_J    0x0002  // J, M linked 
00050 #define S16_M    0x0002
00051 #define S16_H    0x0004
00052 #define S16_K    0x0008
00053 #define S16_B    0x0010
00054 #define S16_F    0x0020
00055 #define S16_G2   0x0040  // 2 part G segment
00056 #define S16_G1   0x0080
00057 #define S16_C    0x0100
00058 #define S16_E    0x0200
00059 #define S16_N    0x0400
00060 #define S16_L    0x0800
00061 #define S16_D1   0x1000  // Assuming 2 part D segment
00062 #define S16_D2   0x1000
00063 #define S16_S    0x2000  // NA
00064 
00065 //Icons All Grids
00066 //#define S16_DP   0x8000  // Assuming single DP segment
00067 
00068 //Icons Grid 1
00069 #define S16_RCV  0x010000
00070 #define S16_ICON_GR1  (S16_RCV)
00071 
00072 //Icons Grid 2
00073 #define S16_ICON_GR2  (0x000000)
00074 
00075 //Icons Grid 3
00076 #define S16_ICON_GR3  (0x000000)
00077 
00078 //Icons Grid 4
00079 #define S16_ICON_GR4  (0x000000)
00080 
00081 //Icons Grid 5
00082 #define S16_ICON_GR5  (0x000000)
00083 
00084 //Icons Grid 6
00085 #define S16_ICON_GR6  (0x000000)
00086 
00087 //Icons Grid 7
00088 #define S16_ICON_GR7  (0x000000)
00089 
00090 //Icons Grid 8
00091 #define S16_SAT  0x010000
00092 #define S16_ICON_GR8  (S16_SAT)
00093 
00094 //Icons Grid 9
00095 #define S16_DRT  0x004000
00096 #define S16_TV   0x010000
00097 #define S16_ICON_GR9  (S16_DRT | S16_TV)
00098 
00099 //Icons Grid 10
00100 #define S16_COL4 0x004000
00101 #define S16_TMR  0x010000
00102 #define S16_ICON_GR10  (S16_COL4 | S16_TMR)
00103 
00104 //Icons Grid 11
00105 #define S16_COL6 0x004000
00106 #define S16_DP6  0x008000
00107 #define S16_PRS  0x010000
00108 #define S16_ICON_GR11 (S16_COL6 | S16_DP6 | S16_PRS)
00109 
00110 
00111 //Mask for blending out and restoring Icons
00112 extern const char MASK_ICON_GRID[][3]; 
00113 
00114 //One mask pattern will be sufficient assuming that all digits use the same mapping.
00115 //#define S16_ICON_MSK (S16_COL3)
00116 
00117 #endif
00118 
00119 
00120 // ASCII Font definitions for segments in each character
00121 //
00122 //32 0x20
00123 #define C16_SPC  (0x0000)    //Space
00124 #define C16_EXC  (S16_B | S16_C) //!
00125 #define C16_QTE  (S16_B | S16_F) //"
00126 #define C16_HSH  (S16_B | S16_C | S16_D1 | S16_D2 | S16_G1 | S16_G2 | S16_J | S16_M) //#
00127 #define C16_DLR  (S16_A1 | S16_A2 | S16_C | S16_D1 | S16_D2 | S16_F | S16_G1 | S16_G2 | S16_J | S16_M | S16_S) //$
00128 #define C16_PCT  (S16_C | S16_F | S16_K | S16_N | S16_S) //%
00129 //#define C16_AMP    (S16_A1 | S16_C | S16_D1 | S16_D2 | S16_E | S16_G1 | S16_J | S16_H | S16_L) // Not correct when J and M are linked
00130 #define C16_AMP  (S16_A1 | S16_A2 | S16_C | S16_D1 | S16_D2 | S16_H | S16_K | S16_L | S16_N | S16_S) //&
00131 #define C16_ACC  (S16_B) //'
00132 #define C16_LBR  (S16_K | S16_L) //(
00133 #define C16_RBR  (S16_H | S16_N) //)
00134 #define C16_MLT  (S16_G1 | S16_G2 | S16_J | S16_M | S16_K | S16_L | S16_H | S16_N | S16_S)  //*
00135 #define C16_PLS  (S16_G1 | S16_G2 | S16_J | S16_M | S16_S) //+
00136 #define C16_CMA  (S16_C) //,
00137 #define C16_MIN  (S16_G1 | S16_G2 | S16_S) //-
00138 #define C16_DOT  (S16_C) //.
00139 #define C16_RS   (S16_K | S16_N  | S16_S)  // /
00140 //48 0x30 digits
00141 #define C16_0    (S16_A1 | S16_A2 | S16_B | S16_C  | S16_D1 | S16_D2 | S16_E  | S16_F)
00142 #define C16_1    (S16_B  | S16_C)
00143 #define C16_2    (S16_A1 | S16_A2 | S16_B | S16_D1 | S16_D2 | S16_E  | S16_G1 | S16_G2 | S16_S)
00144 #define C16_3    (S16_A1 | S16_A2 | S16_B | S16_C  | S16_D1 | S16_D2 | S16_G2 | S16_S)
00145 #define C16_4    (S16_B  | S16_C  | S16_F | S16_G1 | S16_G2 | S16_S)
00146 #define C16_5    (S16_A1 | S16_A2 | S16_C | S16_D1 | S16_D2 | S16_F | S16_G1 | S16_G2 | S16_S)
00147 #define C16_6    (S16_A1 | S16_A2 | S16_C | S16_D1 | S16_D2 | S16_E | S16_F  | S16_G1 | S16_G2 | S16_S)
00148 #define C16_7    (S16_A1 | S16_A2 | S16_B | S16_C)
00149 #define C16_8    (S16_A1 | S16_A2 | S16_B | S16_C  | S16_D1 | S16_D2 | S16_E | S16_F  | S16_G1 | S16_G2 | S16_S)
00150 #define C16_9    (S16_A1 | S16_A2 | S16_B | S16_C  | S16_D1 | S16_D2 | S16_F | S16_G1 | S16_G2 | S16_S)
00151 //58 0x3A
00152 #define C16_COL  (S16_D1 | S16_D2 | S16_G1 | S16_G2 | S16_S) // :
00153 #define C16_SCL  (S16_D1 | S16_D2 | S16_G1 | S16_G2 | S16_S) // ;
00154 #define C16_LT   (S16_K  | S16_L  | S16_S)               // <
00155 #define C16_EQ   (S16_D1 | S16_D2 | S16_G1 | S16_G2 | S16_S) // =
00156 #define C16_GT   (S16_H  | S16_N  | S16_S)               // >   
00157 //#define C16_QM   (S16_A1 | S16_A2 | S16_B | S16_G2 | S16_M) // Not correct when J and M are linked
00158 #define C16_QM   (S16_A1 | S16_A2 | S16_B | S16_G2 | S16_N | S16_S)  // ?
00159 //64 0x40
00160 //#define C16_AT   (S16_A1 | S16_A2 | S16_B  | S16_C  | S16_D1 | S16_D2 | S16_E | S16_G1  | S16_M | S16_S) // Not correct when J and M are linked
00161 #define C16_AT   (S16_A1 | S16_A2 | S16_B  | S16_C  | S16_D1 | S16_D2 | S16_E  | S16_G1 | S16_S)  // @
00162 #define C16_A    (S16_A1 | S16_A2 | S16_B  | S16_C  | S16_E  | S16_F  | S16_G1 | S16_G2 | S16_S)  // Upper case alphabet
00163 #define C16_B    (S16_A1 | S16_A2 | S16_B  | S16_C  | S16_D1 | S16_D2 | S16_J  | S16_M  | S16_G2 | S16_S)
00164 #define C16_C    (S16_A1 | S16_A2 | S16_D1 | S16_D2 | S16_E  | S16_F)
00165 #define C16_D    (S16_A1 | S16_A2 | S16_B  | S16_C  | S16_D1 | S16_D2 | S16_J  | S16_M  | S16_S)
00166 #define C16_E    (S16_A1 | S16_A2 | S16_D1 | S16_D2 | S16_E  | S16_F  | S16_G1 | S16_S)
00167 #define C16_F    (S16_A1 | S16_A2 | S16_E  | S16_F  | S16_G1 | S16_S)
00168 #define C16_G    (S16_A1 | S16_A2 | S16_C  | S16_D1 | S16_D2 | S16_E  | S16_F  | S16_G2 | S16_S)
00169 #define C16_H    (S16_B  | S16_C  | S16_E  | S16_F  | S16_G1 | S16_G2 | S16_S)
00170 #define C16_I    (S16_A1 | S16_A2 | S16_D1 | S16_D2 | S16_J  | S16_M  | S16_S)
00171 #define C16_J    (S16_B  | S16_C  | S16_D1 | S16_D2 | S16_E)
00172 #define C16_K    (S16_E  | S16_F  | S16_G1 | S16_K  | S16_L  | S16_S)
00173 #define C16_L    (S16_D1 | S16_D2 | S16_E  | S16_F)
00174 #define C16_M    (S16_B  | S16_C  | S16_E  | S16_F  | S16_H  | S16_K  | S16_S)
00175 #define C16_N    (S16_B  | S16_C  | S16_E  | S16_F  | S16_H  | S16_L  | S16_S)
00176 #define C16_O    (S16_A1 | S16_A2 | S16_B  | S16_C  | S16_D1 | S16_D2 | S16_E  | S16_F)
00177 #define C16_P    (S16_A1 | S16_A2 | S16_B  | S16_E  | S16_F  | S16_G1 | S16_G2 | S16_S)
00178 #define C16_Q    (S16_A1 | S16_A2 | S16_B  | S16_C  | S16_D1 | S16_D2 | S16_E  | S16_F  | S16_L)
00179 #define C16_R    (S16_A1 | S16_A2 | S16_B  | S16_E  | S16_F  | S16_G1 | S16_G2 | S16_L  | S16_S)
00180 #define C16_S    (S16_A1 | S16_A2 | S16_C  | S16_D1 | S16_D2 | S16_F  | S16_G1 | S16_G2 | S16_S)
00181 #define C16_T    (S16_A1 | S16_A2 | S16_J  | S16_M  | S16_S)
00182 #define C16_U    (S16_B  | S16_C  | S16_D1 | S16_D2 | S16_E  | S16_F)
00183 #define C16_V    (S16_E  | S16_F  | S16_N  | S16_K  | S16_S)
00184 #define C16_W    (S16_B  | S16_C  | S16_E  | S16_F  | S16_L  | S16_N  | S16_S)
00185 #define C16_X    (S16_H  | S16_K  | S16_L  | S16_N  | S16_S)
00186 //#define C16_Y    (S16_H | S16_K | S16_M | S16_S) // Not correct when J and M are linked
00187 #define C16_Y    (S16_B  | S16_C  | S16_D1 | S16_D2 | S16_F  | S16_G1 | S16_G2 | S16_S)
00188 #define C16_Z    (S16_A1 | S16_A2 | S16_D1 | S16_D2 | S16_K  | S16_N  | S16_S)
00189 //91 0x5B
00190 #define C16_SBL  (S16_A1 | S16_D1 | S16_E  | S16_F)  // [
00191 #define C16_LS   (S16_H  | S16_L  | S16_S)           // left slash
00192 #define C16_SBR  (S16_A2 | S16_B | S16_C | S16_D2)   // ]
00193 #define C16_PWR  (S16_L  | S16_N  | S16_S)           // ^
00194 #define C16_UDS  (S16_D1 | S16_D2)                   // _
00195 #define C16_DSH  (S16_H)                             // `  
00196 //97 0x61
00197 // a...z No defines provided. Just use the Upper case characters again
00198 //122
00199 
00200 //123 0x7B
00201 #define C16_CBL  (S16_G1 | S16_J  | S16_M  | S16_S)          // {
00202 #define C16_OR   (S16_J  | S16_M  | S16_S)                   // |
00203 #define C16_CBR  (S16_G2 | S16_J  | S16_M  | S16_S)          // }
00204 #define C16_TLD  (S16_B  | S16_E  | S16_G1 | S16_G2 | S16_S) // ~
00205 #define C16_DEL  (0x0000)
00206 
00207 //User Defined Characters (some examples)
00208 #define UDC16_SANDHR  (S16_A1 | S16_A2 | S16_D1 | S16_D2 | S16_H  | S16_K | S16_L | S16_N | S16_S)  //Sandhour
00209 #define UDC16_DGR     (S16_A  | S16_B  | S16_F | S16_G)  // degrees
00210 
00211 #if(0)
00212 #define UDC16_WHEEL0  (S16_G1 | S16_G2 | S16_S)  // -
00213 #define UDC16_WHEEL1  (S16_H  | S16_L  | S16_S)  /* \ */
00214 #define UDC16_WHEEL2  (S16_J  | S16_M  | S16_S)  // |
00215 #define UDC16_WHEEL3  (S16_K  | S16_N  | S16_S)  // /
00216 #define UDC16_WHEEL4  (S16_G1 | S16_G2 | S16_S)  // -
00217 #define UDC16_WHEEL5  (S16_H  | S16_L  | S16_S)  /* \ */
00218 #define UDC16_WHEEL6  (S16_J  | S16_M  | S16_S)  // |
00219 #define UDC16_WHEEL7  (S16_K  | S16_N  | S16_S)  // /
00220 #else
00221 #define UDC16_WHEEL0  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_G1 | S16_G2 | S16_S)  // -
00222 #define UDC16_WHEEL1  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_H  | S16_L  | S16_S)  /* \ */
00223 #define UDC16_WHEEL2  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_J  | S16_M  | S16_S)  // |
00224 #define UDC16_WHEEL3  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_K  | S16_N  | S16_S)  // /
00225 #define UDC16_WHEEL4  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_G1 | S16_G2 | S16_S)  // -
00226 #define UDC16_WHEEL5  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_H  | S16_L  | S16_S)  /* \ */
00227 #define UDC16_WHEEL6  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_J  | S16_M  | S16_S)  // |
00228 #define UDC16_WHEEL7  (S16_A1 | S16_A2 | S16_B | S16_C | S16_D1 | S16_D2 | S16_E | S16_F | S16_K  | S16_N  | S16_S)  // /
00229 #endif
00230 
00231 // Font data selection for transmission to PT6311 memory
00232 #define LO(x)  ( x & 0xFF)
00233 #define MD(x)  ((x >>  8) & 0xFF)
00234 #define HI(x)  ((x >> 16) & 0xFF)
00235 
00236 // ASCII Font definition table
00237 //
00238 #define FONT_16S_START     0x20
00239 #define FONT_16S_END       0x7F
00240 //#define FONT_16S16_LR_CHARS (FONT_16S16_END - FONT_16S16_START + 1)
00241 extern const short FONT_16S[]; 
00242 
00243 
00244 // Wheel animation definition table
00245 extern const int WHEEL_ANI[]; 
00246 #endif