Wim Huiskamp / PT6964

Dependents:   mbed_PT6964

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Font_7Seg.h Source File

Font_7Seg.h

00001 /* mbed LED Font Library, for Princeton PT6964 controller as used in DVD538A
00002  * Copyright (c) 2015, v01: WH, Initial version
00003  *               2016, v02: WH, fonttable changed to short, added symbols
00004  *
00005  * Permission is hereby granted, free of charge, to any person obtaining a copy
00006  * of this software and associated documentation files (the "Software"), to deal
00007  * in the Software without restriction, including without limitation the rights
00008  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00009  * copies of the Software, and to permit persons to whom the Software is
00010  * furnished to do so, subject to the following conditions:
00011  *
00012  * The above copyright notice and this permission notice shall be included in
00013  * all copies or substantial portions of the Software.
00014  *
00015  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00016  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00017  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00018  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00019  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00020  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00021  * THE SOFTWARE.
00022  */
00023 #ifndef MBED_FONT_7SEG_H
00024 #define MBED_FONT_7SEG_H
00025 
00026 // Segment bit positions for 7 Segment display using the DVD538A mapping for PT6964
00027 // Modify this table for different 'bit-to-segment' mappings. The ASCII character defines and the FONT_7S const table below 
00028 // will be adapted automatically according to the bit-to-segment mapping. Obviously this will only work when the segment
00029 // mapping is identical for every digit position. This will be the case unless the hardware designer really hates software developers.
00030 //
00031 #define S7_D    0x0008 
00032 #define S7_C    0x0010
00033 #define S7_B    0x0020
00034 #define S7_A    0x0040 
00035 #define S7_E    0x0080
00036 #define S7_F    0x0100
00037 #define S7_G    0x0200
00038 
00039 //Mask for blending out and setting 7 segments digits
00040 #define MASK_7S_ALL = (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F | S7_G}
00041 
00042 //Icons Grid 1
00043 #define S7_LD2  0x0001
00044 #define S7_LD1  0x0002
00045 #define S7_CD   0x0008
00046 #define S7_DVD  0x0010
00047 #define S7_PSE  0x0020
00048 #define S7_PLY  0x0040
00049 #define S7_COL2 0x0080
00050 #define S7_MP4  0x0100
00051 #define S7_MP3  0x0200
00052 #define S7_ICON_GR1 (S7_LD2 | S7_LD1 | S7_CD | S7_DVD | S7_PSE | S7_PLY | S7_COL2 | S7_MP4 | S7_MP3)
00053 
00054 //Icons Grid 2
00055 #define S7_ICON_GR2 (0x0000)
00056 
00057 //Icons Grid 3
00058 #define S7_ICON_GR3 (0x0000)
00059 
00060 //Icons Grid 4
00061 #define S7_ICON_GR4 (0x0000)
00062 
00063 //Icons Grid 5
00064 #define S7_ICON_GR5 (0x0000)
00065 
00066 //Icons Grid 6
00067 #define S7_ICON_GR6 (0x0000)
00068 
00069 //Icons Grid 7
00070 #define S7_ICON_GR7 (0x0000)
00071 
00072 //Mask for blending out and restoring Icons
00073 //One mask pattern will be sufficient assuming that all digits use the same mapping.
00074 //#define S_ICON_MSK (0x0000)
00075 
00076 //Mask for blending out and restoring Icons
00077 extern const char MASK_ICON_GRID[][2]; 
00078 
00079 // ASCII Font definitions for segments in each character
00080 //
00081 //32 0x20  Symbols
00082 #define C7_SPC  (0x0000)
00083 //#define C_CMA  (S_DP)
00084 //#define C_DPT  (S_DP)
00085 #define C7_MIN  (S7_G)
00086 
00087 //48 0x30 digits
00088 #define C7_0    (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F)
00089 #define C7_1    (S7_B | S7_C)
00090 #define C7_2    (S7_A | S7_B | S7_D | S7_E | S7_G)
00091 #define C7_3    (S7_A | S7_B | S7_C | S7_D | S7_G)
00092 #define C7_4    (S7_B | S7_C | S7_F | S7_G)
00093 #define C7_5    (S7_A | S7_C | S7_D | S7_F | S7_G)
00094 #define C7_6    (S7_A | S7_C | S7_D | S7_E | S7_F | S7_G)
00095 #define C7_7    (S7_A | S7_B | S7_C)
00096 #define C7_8    (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F | S7_G)
00097 #define C7_9    (S7_A | S7_B | S7_C | S7_D | S7_F | S7_G)
00098 //64 0x40
00099 #define C7_A    (S7_A | S7_B | S7_C | S7_E | S7_F | S7_G )  // Upper case alphabet
00100 #define C7_B    (S7_C | S7_D | S7_E | S7_F | S7_G)
00101 #define C7_C    (S7_A | S7_D | S7_E | S7_F)
00102 #define C7_D    (S7_B | S7_C | S7_D | S7_E | S7_G)
00103 #define C7_E    (S7_A | S7_D | S7_E | S7_F | S7_G)
00104 #define C7_F    (S7_A | S7_E | S7_F | S7_G)
00105 #define C7_G    (S7_A | S7_B | S7_C | S7_F | S7_G)
00106 #define C7_H    (S7_B | S7_C | S7_E | S7_F | S7_G)
00107 #define C7_I    (S7_B | S7_C)
00108 #define C7_J    (S7_B | S7_C | S7_D)
00109 #define C7_L    (S7_D | S7_E | S7_F)
00110 #define C7_M    (S7_C | S7_E | S7_G)
00111 #define C7_N    (S7_C | S7_E | S7_G)
00112 #define C7_O    (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F)
00113 #define C7_P    (S7_A | S7_B | S7_E | S7_F | S7_G)
00114 #define C7_Q    (S7_A | S7_B | S7_C | S7_F | S7_G)
00115 #define C7_R    (S7_E | S7_G)
00116 #define C7_S    (S7_A | S7_C | S7_D | S7_F | S7_G)
00117 #define C7_T    (S7_D | S7_E | S7_F | S7_G)
00118 #define C7_U    (S7_B | S7_C | S7_D | S7_E | S7_F)
00119 #define C7_Y    (S7_B | S7_C | S7_D | S7_F | S7_G)
00120 #define C7_Z    (S7_A | S7_B | S7_D | S7_E | S7_G)
00121 
00122 //97 0x61  Lower case alphabet
00123 #define C7_a     C7_A
00124 #define C7_b     C7_B
00125 #define C7_c     C7_C
00126 #define C7_d     C7_D
00127 #define C7_e     C7_E
00128 #define C7_f     C7_H
00129 #define C7_g     C7_G
00130 #define C7_h     C7_H
00131 #define C7_i     C7_I
00132 #define C7_j     C7_J
00133 #define C7_l     C7_L
00134 #define C7_m     C7_M
00135 #define C7_n     C7_N
00136 #define C7_o     C7_O
00137 #define C7_p     C7_P
00138 #define C7_q     C7_Q
00139 #define C7_r     C7_R
00140 #define C7_s     C7_S
00141 #define C7_t     C7_T
00142 #define C7_u     C7_U
00143 #define C7_y     C7_Y
00144 #define C7_z     C7_Z
00145 
00146 
00147 // Font data selection for transmission to PT6964 memory
00148 #define LO(x)  ( x & 0xFF)
00149 #define HI(x)  ((x >> 8) & 0xFF)
00150 
00151 
00152 // ASCII Font definition table
00153 //
00154 //#define FONT_7S_START     0x20
00155 //#define FONT_7S_END       0x7F
00156 //#define FONT_7S_NR_CHARS (FONT_7S_END - FONT_7S_START + 1)
00157 extern const short FONT_7S[]; 
00158 
00159 #endif