Wim Huiskamp / PT6964

Dependents:   mbed_PT6964

Revision:
1:1adf993a3e34
Parent:
0:27f32a087e5a
diff -r 27f32a087e5a -r 1adf993a3e34 Font_7Seg.h
--- a/Font_7Seg.h	Sat Nov 21 16:43:15 2015 +0000
+++ b/Font_7Seg.h	Sat Jan 09 13:40:06 2016 +0000
@@ -1,5 +1,6 @@
 /* mbed LED Font Library, for Princeton PT6964 controller as used in DVD538A
  * Copyright (c) 2015, v01: WH, Initial version
+ *               2016, v02: WH, fonttable changed to short, added symbols
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -27,56 +28,121 @@
 // will be adapted automatically according to the bit-to-segment mapping. Obviously this will only work when the segment
 // mapping is identical for every digit position. This will be the case unless the hardware designer really hates software developers.
 //
-#define S_D    0x0008 
-#define S_C    0x0010
-#define S_B    0x0020
-#define S_A    0x0040 
-#define S_E    0x0080
-#define S_F    0x0100
-#define S_G    0x0200
+#define S7_D    0x0008 
+#define S7_C    0x0010
+#define S7_B    0x0020
+#define S7_A    0x0040 
+#define S7_E    0x0080
+#define S7_F    0x0100
+#define S7_G    0x0200
+
+//Mask for blending out and setting 7 segments digits
+#define MASK_7S_ALL = (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F | S7_G}
 
-#define S_LD2  0x0001
-#define S_LD1  0x0002
-#define S_CD   0x0008
-#define S_DVD  0x0010
-#define S_PSE  0x0020
-#define S_PLY  0x0040
-#define S_COL  0x0080
-#define S_MP4  0x0100
-#define S_MP3  0x0200
+//Icons Grid 1
+#define S7_LD2  0x0001
+#define S7_LD1  0x0002
+#define S7_CD   0x0008
+#define S7_DVD  0x0010
+#define S7_PSE  0x0020
+#define S7_PLY  0x0040
+#define S7_COL2 0x0080
+#define S7_MP4  0x0100
+#define S7_MP3  0x0200
+#define S7_ICON_GR1 (S7_LD2 | S7_LD1 | S7_CD | S7_DVD | S7_PSE | S7_PLY | S7_COL2 | S7_MP4 | S7_MP3)
+
+//Icons Grid 2
+#define S7_ICON_GR2 (0x0000)
+
+//Icons Grid 3
+#define S7_ICON_GR3 (0x0000)
+
+//Icons Grid 4
+#define S7_ICON_GR4 (0x0000)
+
+//Icons Grid 5
+#define S7_ICON_GR5 (0x0000)
+
+//Icons Grid 6
+#define S7_ICON_GR6 (0x0000)
+
+//Icons Grid 7
+#define S7_ICON_GR7 (0x0000)
 
 //Mask for blending out and restoring Icons
 //One mask pattern will be sufficient assuming that all digits use the same mapping.
-#define S_ICON_MSK (0x0000)
+//#define S_ICON_MSK (0x0000)
 
+//Mask for blending out and restoring Icons
+extern const char MASK_ICON_GRID[][2]; 
 
 // ASCII Font definitions for segments in each character
 //
+//32 0x20  Symbols
+#define C7_SPC  (0x0000)
+//#define C_CMA  (S_DP)
+//#define C_DPT  (S_DP)
+#define C7_MIN  (S7_G)
+
 //48 0x30 digits
-#define C_0    (S_A | S_B | S_C | S_D | S_E | S_F)
-#define C_1    (S_B | S_C)
-#define C_2    (S_A | S_B | S_D | S_E | S_G)
-#define C_3    (S_A | S_B | S_C | S_D | S_G)
-#define C_4    (S_B | S_C | S_F | S_G)
-#define C_5    (S_A | S_C | S_D | S_F | S_G)
-#define C_6    (S_A | S_C | S_D | S_E | S_F | S_G)
-#define C_7    (S_A | S_B | S_C)
-#define C_8    (S_A | S_B | S_C | S_D | S_E | S_F | S_G)
-#define C_9    (S_A | S_B | S_C | S_D | S_F | S_G)
+#define C7_0    (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F)
+#define C7_1    (S7_B | S7_C)
+#define C7_2    (S7_A | S7_B | S7_D | S7_E | S7_G)
+#define C7_3    (S7_A | S7_B | S7_C | S7_D | S7_G)
+#define C7_4    (S7_B | S7_C | S7_F | S7_G)
+#define C7_5    (S7_A | S7_C | S7_D | S7_F | S7_G)
+#define C7_6    (S7_A | S7_C | S7_D | S7_E | S7_F | S7_G)
+#define C7_7    (S7_A | S7_B | S7_C)
+#define C7_8    (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F | S7_G)
+#define C7_9    (S7_A | S7_B | S7_C | S7_D | S7_F | S7_G)
 //64 0x40
-#define C_A    (S_A | S_B | S_C | S_E | S_F | S_G )  // Upper case alphabet
-#define C_B    (S_C | S_D | S_E | S_F | S_G)
-#define C_C    (S_A | S_D | S_E | S_F)
-#define C_D    (S_B | S_C | S_D | S_E | S_G)
-#define C_E    (S_A | S_D | S_E | S_F | S_G)
-#define C_F    (S_A | S_E | S_F | S_G)
-//97 0x61
-#define C_a    (S_A | S_B | S_C | S_E | S_F | S_G )  // Lower case alphabet
-#define C_b    (S_C | S_D | S_E | S_F | S_G)
-#define C_c    (S_A | S_D | S_E | S_F)
-#define C_d    (S_B | S_C | S_D | S_E | S_G)
-#define C_e    (S_A | S_D | S_E | S_F | S_G)
-#define C_f    (S_A | S_E | S_F | S_G)
+#define C7_A    (S7_A | S7_B | S7_C | S7_E | S7_F | S7_G )  // Upper case alphabet
+#define C7_B    (S7_C | S7_D | S7_E | S7_F | S7_G)
+#define C7_C    (S7_A | S7_D | S7_E | S7_F)
+#define C7_D    (S7_B | S7_C | S7_D | S7_E | S7_G)
+#define C7_E    (S7_A | S7_D | S7_E | S7_F | S7_G)
+#define C7_F    (S7_A | S7_E | S7_F | S7_G)
+#define C7_G    (S7_A | S7_B | S7_C | S7_F | S7_G)
+#define C7_H    (S7_B | S7_C | S7_E | S7_F | S7_G)
+#define C7_I    (S7_B | S7_C)
+#define C7_J    (S7_B | S7_C | S7_D)
+#define C7_L    (S7_D | S7_E | S7_F)
+#define C7_M    (S7_C | S7_E | S7_G)
+#define C7_N    (S7_C | S7_E | S7_G)
+#define C7_O    (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F)
+#define C7_P    (S7_A | S7_B | S7_E | S7_F | S7_G)
+#define C7_Q    (S7_A | S7_B | S7_C | S7_F | S7_G)
+#define C7_R    (S7_E | S7_G)
+#define C7_S    (S7_A | S7_C | S7_D | S7_F | S7_G)
+#define C7_T    (S7_D | S7_E | S7_F | S7_G)
+#define C7_U    (S7_B | S7_C | S7_D | S7_E | S7_F)
+#define C7_Y    (S7_B | S7_C | S7_D | S7_F | S7_G)
+#define C7_Z    (S7_A | S7_B | S7_D | S7_E | S7_G)
+
+//97 0x61  Lower case alphabet
+#define C7_a     C7_A
+#define C7_b     C7_B
+#define C7_c     C7_C
+#define C7_d     C7_D
+#define C7_e     C7_E
+#define C7_f     C7_H
+#define C7_g     C7_G
+#define C7_h     C7_H
+#define C7_i     C7_I
+#define C7_j     C7_J
+#define C7_l     C7_L
+#define C7_m     C7_M
+#define C7_n     C7_N
+#define C7_o     C7_O
+#define C7_p     C7_P
+#define C7_q     C7_Q
+#define C7_r     C7_R
+#define C7_s     C7_S
+#define C7_t     C7_T
+#define C7_u     C7_U
+#define C7_y     C7_Y
+#define C7_z     C7_Z
+
 
 // Font data selection for transmission to PT6964 memory
 #define LO(x)  ( x & 0xFF)
@@ -88,6 +154,6 @@
 //#define FONT_7S_START     0x20
 //#define FONT_7S_END       0x7F
 //#define FONT_7S_NR_CHARS (FONT_7S_END - FONT_7S_START + 1)
-extern const char FONT_7S[][2]; 
+extern const short FONT_7S[]; 
 
 #endif 
\ No newline at end of file