Princeton PT6964 LED controller supports 4 Digits @ 13 Segments, 5 Digits @ 12 Segments, 6 Digits @ 11 Segments or 7 Digits @ 10 Segments. Also supports a scanned keyboard of upto 20 keys. SPI bus interface.

Dependents:   mbed_PT6964

Princeton PT6964 LED controller supports 4 Digits @ 13 Segments, 5 Digits @ 12 Segments, 6 Digits @ 11 Segments or 7 Digits @ 10 Segments. Also supports a scanned keyboard of upto 20 keys. SPI bus interface.

See Component page here.

Committer:
wim
Date:
Thu Jan 14 20:09:52 2016 +0000
Revision:
2:eaf2f5d1af34
Parent:
1:1adf993a3e34
Refactored display and keyboard defines

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wim 0:27f32a087e5a 1 /* mbed LED Font Library, for Princeton PT6964 controller as used in DVD538A
wim 0:27f32a087e5a 2 * Copyright (c) 2015, v01: WH, Initial version
wim 1:1adf993a3e34 3 * 2016, v02: WH, fonttable changed to short, added symbols
wim 0:27f32a087e5a 4 *
wim 0:27f32a087e5a 5 * Permission is hereby granted, free of charge, to any person obtaining a copy
wim 0:27f32a087e5a 6 * of this software and associated documentation files (the "Software"), to deal
wim 0:27f32a087e5a 7 * in the Software without restriction, including without limitation the rights
wim 0:27f32a087e5a 8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
wim 0:27f32a087e5a 9 * copies of the Software, and to permit persons to whom the Software is
wim 0:27f32a087e5a 10 * furnished to do so, subject to the following conditions:
wim 0:27f32a087e5a 11 *
wim 0:27f32a087e5a 12 * The above copyright notice and this permission notice shall be included in
wim 0:27f32a087e5a 13 * all copies or substantial portions of the Software.
wim 0:27f32a087e5a 14 *
wim 0:27f32a087e5a 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
wim 0:27f32a087e5a 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
wim 0:27f32a087e5a 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
wim 0:27f32a087e5a 18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
wim 0:27f32a087e5a 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
wim 0:27f32a087e5a 20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
wim 0:27f32a087e5a 21 * THE SOFTWARE.
wim 0:27f32a087e5a 22 */
wim 0:27f32a087e5a 23 #ifndef MBED_FONT_7SEG_H
wim 0:27f32a087e5a 24 #define MBED_FONT_7SEG_H
wim 0:27f32a087e5a 25
wim 0:27f32a087e5a 26 // Segment bit positions for 7 Segment display using the DVD538A mapping for PT6964
wim 0:27f32a087e5a 27 // Modify this table for different 'bit-to-segment' mappings. The ASCII character defines and the FONT_7S const table below
wim 0:27f32a087e5a 28 // will be adapted automatically according to the bit-to-segment mapping. Obviously this will only work when the segment
wim 0:27f32a087e5a 29 // mapping is identical for every digit position. This will be the case unless the hardware designer really hates software developers.
wim 0:27f32a087e5a 30 //
wim 1:1adf993a3e34 31 #define S7_D 0x0008
wim 1:1adf993a3e34 32 #define S7_C 0x0010
wim 1:1adf993a3e34 33 #define S7_B 0x0020
wim 1:1adf993a3e34 34 #define S7_A 0x0040
wim 1:1adf993a3e34 35 #define S7_E 0x0080
wim 1:1adf993a3e34 36 #define S7_F 0x0100
wim 1:1adf993a3e34 37 #define S7_G 0x0200
wim 1:1adf993a3e34 38
wim 1:1adf993a3e34 39 //Mask for blending out and setting 7 segments digits
wim 1:1adf993a3e34 40 #define MASK_7S_ALL = (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F | S7_G}
wim 0:27f32a087e5a 41
wim 1:1adf993a3e34 42 //Icons Grid 1
wim 1:1adf993a3e34 43 #define S7_LD2 0x0001
wim 1:1adf993a3e34 44 #define S7_LD1 0x0002
wim 1:1adf993a3e34 45 #define S7_CD 0x0008
wim 1:1adf993a3e34 46 #define S7_DVD 0x0010
wim 1:1adf993a3e34 47 #define S7_PSE 0x0020
wim 1:1adf993a3e34 48 #define S7_PLY 0x0040
wim 1:1adf993a3e34 49 #define S7_COL2 0x0080
wim 1:1adf993a3e34 50 #define S7_MP4 0x0100
wim 1:1adf993a3e34 51 #define S7_MP3 0x0200
wim 1:1adf993a3e34 52 #define S7_ICON_GR1 (S7_LD2 | S7_LD1 | S7_CD | S7_DVD | S7_PSE | S7_PLY | S7_COL2 | S7_MP4 | S7_MP3)
wim 1:1adf993a3e34 53
wim 1:1adf993a3e34 54 //Icons Grid 2
wim 1:1adf993a3e34 55 #define S7_ICON_GR2 (0x0000)
wim 1:1adf993a3e34 56
wim 1:1adf993a3e34 57 //Icons Grid 3
wim 1:1adf993a3e34 58 #define S7_ICON_GR3 (0x0000)
wim 1:1adf993a3e34 59
wim 1:1adf993a3e34 60 //Icons Grid 4
wim 1:1adf993a3e34 61 #define S7_ICON_GR4 (0x0000)
wim 1:1adf993a3e34 62
wim 1:1adf993a3e34 63 //Icons Grid 5
wim 1:1adf993a3e34 64 #define S7_ICON_GR5 (0x0000)
wim 1:1adf993a3e34 65
wim 1:1adf993a3e34 66 //Icons Grid 6
wim 1:1adf993a3e34 67 #define S7_ICON_GR6 (0x0000)
wim 1:1adf993a3e34 68
wim 1:1adf993a3e34 69 //Icons Grid 7
wim 1:1adf993a3e34 70 #define S7_ICON_GR7 (0x0000)
wim 0:27f32a087e5a 71
wim 0:27f32a087e5a 72 //Mask for blending out and restoring Icons
wim 0:27f32a087e5a 73 //One mask pattern will be sufficient assuming that all digits use the same mapping.
wim 1:1adf993a3e34 74 //#define S_ICON_MSK (0x0000)
wim 0:27f32a087e5a 75
wim 1:1adf993a3e34 76 //Mask for blending out and restoring Icons
wim 1:1adf993a3e34 77 extern const char MASK_ICON_GRID[][2];
wim 0:27f32a087e5a 78
wim 0:27f32a087e5a 79 // ASCII Font definitions for segments in each character
wim 0:27f32a087e5a 80 //
wim 1:1adf993a3e34 81 //32 0x20 Symbols
wim 1:1adf993a3e34 82 #define C7_SPC (0x0000)
wim 1:1adf993a3e34 83 //#define C_CMA (S_DP)
wim 1:1adf993a3e34 84 //#define C_DPT (S_DP)
wim 1:1adf993a3e34 85 #define C7_MIN (S7_G)
wim 1:1adf993a3e34 86
wim 0:27f32a087e5a 87 //48 0x30 digits
wim 1:1adf993a3e34 88 #define C7_0 (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F)
wim 1:1adf993a3e34 89 #define C7_1 (S7_B | S7_C)
wim 1:1adf993a3e34 90 #define C7_2 (S7_A | S7_B | S7_D | S7_E | S7_G)
wim 1:1adf993a3e34 91 #define C7_3 (S7_A | S7_B | S7_C | S7_D | S7_G)
wim 1:1adf993a3e34 92 #define C7_4 (S7_B | S7_C | S7_F | S7_G)
wim 1:1adf993a3e34 93 #define C7_5 (S7_A | S7_C | S7_D | S7_F | S7_G)
wim 1:1adf993a3e34 94 #define C7_6 (S7_A | S7_C | S7_D | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 95 #define C7_7 (S7_A | S7_B | S7_C)
wim 1:1adf993a3e34 96 #define C7_8 (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 97 #define C7_9 (S7_A | S7_B | S7_C | S7_D | S7_F | S7_G)
wim 0:27f32a087e5a 98 //64 0x40
wim 1:1adf993a3e34 99 #define C7_A (S7_A | S7_B | S7_C | S7_E | S7_F | S7_G ) // Upper case alphabet
wim 1:1adf993a3e34 100 #define C7_B (S7_C | S7_D | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 101 #define C7_C (S7_A | S7_D | S7_E | S7_F)
wim 1:1adf993a3e34 102 #define C7_D (S7_B | S7_C | S7_D | S7_E | S7_G)
wim 1:1adf993a3e34 103 #define C7_E (S7_A | S7_D | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 104 #define C7_F (S7_A | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 105 #define C7_G (S7_A | S7_B | S7_C | S7_F | S7_G)
wim 1:1adf993a3e34 106 #define C7_H (S7_B | S7_C | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 107 #define C7_I (S7_B | S7_C)
wim 1:1adf993a3e34 108 #define C7_J (S7_B | S7_C | S7_D)
wim 1:1adf993a3e34 109 #define C7_L (S7_D | S7_E | S7_F)
wim 1:1adf993a3e34 110 #define C7_M (S7_C | S7_E | S7_G)
wim 1:1adf993a3e34 111 #define C7_N (S7_C | S7_E | S7_G)
wim 1:1adf993a3e34 112 #define C7_O (S7_A | S7_B | S7_C | S7_D | S7_E | S7_F)
wim 1:1adf993a3e34 113 #define C7_P (S7_A | S7_B | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 114 #define C7_Q (S7_A | S7_B | S7_C | S7_F | S7_G)
wim 1:1adf993a3e34 115 #define C7_R (S7_E | S7_G)
wim 1:1adf993a3e34 116 #define C7_S (S7_A | S7_C | S7_D | S7_F | S7_G)
wim 1:1adf993a3e34 117 #define C7_T (S7_D | S7_E | S7_F | S7_G)
wim 1:1adf993a3e34 118 #define C7_U (S7_B | S7_C | S7_D | S7_E | S7_F)
wim 1:1adf993a3e34 119 #define C7_Y (S7_B | S7_C | S7_D | S7_F | S7_G)
wim 1:1adf993a3e34 120 #define C7_Z (S7_A | S7_B | S7_D | S7_E | S7_G)
wim 1:1adf993a3e34 121
wim 1:1adf993a3e34 122 //97 0x61 Lower case alphabet
wim 1:1adf993a3e34 123 #define C7_a C7_A
wim 1:1adf993a3e34 124 #define C7_b C7_B
wim 1:1adf993a3e34 125 #define C7_c C7_C
wim 1:1adf993a3e34 126 #define C7_d C7_D
wim 1:1adf993a3e34 127 #define C7_e C7_E
wim 1:1adf993a3e34 128 #define C7_f C7_H
wim 1:1adf993a3e34 129 #define C7_g C7_G
wim 1:1adf993a3e34 130 #define C7_h C7_H
wim 1:1adf993a3e34 131 #define C7_i C7_I
wim 1:1adf993a3e34 132 #define C7_j C7_J
wim 1:1adf993a3e34 133 #define C7_l C7_L
wim 1:1adf993a3e34 134 #define C7_m C7_M
wim 1:1adf993a3e34 135 #define C7_n C7_N
wim 1:1adf993a3e34 136 #define C7_o C7_O
wim 1:1adf993a3e34 137 #define C7_p C7_P
wim 1:1adf993a3e34 138 #define C7_q C7_Q
wim 1:1adf993a3e34 139 #define C7_r C7_R
wim 1:1adf993a3e34 140 #define C7_s C7_S
wim 1:1adf993a3e34 141 #define C7_t C7_T
wim 1:1adf993a3e34 142 #define C7_u C7_U
wim 1:1adf993a3e34 143 #define C7_y C7_Y
wim 1:1adf993a3e34 144 #define C7_z C7_Z
wim 1:1adf993a3e34 145
wim 0:27f32a087e5a 146
wim 0:27f32a087e5a 147 // Font data selection for transmission to PT6964 memory
wim 0:27f32a087e5a 148 #define LO(x) ( x & 0xFF)
wim 0:27f32a087e5a 149 #define HI(x) ((x >> 8) & 0xFF)
wim 0:27f32a087e5a 150
wim 0:27f32a087e5a 151
wim 0:27f32a087e5a 152 // ASCII Font definition table
wim 0:27f32a087e5a 153 //
wim 0:27f32a087e5a 154 //#define FONT_7S_START 0x20
wim 0:27f32a087e5a 155 //#define FONT_7S_END 0x7F
wim 0:27f32a087e5a 156 //#define FONT_7S_NR_CHARS (FONT_7S_END - FONT_7S_START + 1)
wim 1:1adf993a3e34 157 extern const short FONT_7S[];
wim 0:27f32a087e5a 158
wim 0:27f32a087e5a 159 #endif