-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvariant_2_font.h
More file actions
122 lines (116 loc) · 5.32 KB
/
variant_2_font.h
File metadata and controls
122 lines (116 loc) · 5.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/* PT6312 is an Arduino library for the PT6312 family of Vacuum Fluorescent Display controllers.
* Copyright (C) 2022 Ysard - <ysard@users.noreply.github.com>
*
* Based on the work of 2017 Istrate Liviu - <istrateliviu24@yahoo.com>
* Itself inspired by http://www.instructables.com/id/A-DVD-Player-Hack/
* Also inspired from https://os.mbed.com/users/wim/code/mbed_PT6312/
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef FONT_H
#define FONT_H
#include "PT6312.h"
// Segment numbering for ET16312n VFD driver
// 7
// ---------
// |\ | /|
// 2 | 5 6 4 | 3
// | \ | / |
// -16--9--1--
// | /|\ |
// 14 | 13 6 12 | 15
// | / | \ |
// ---------
// 11
//
// ASCII codes starting to 0x20 offset (space character)
#define VFD_COLON_SYMBOL_BIT 10
const uint8_t FONT[65][2] = {
{0b00000000, 0b00000000}, // space 0x20
{0b00000000, 0b00000000}, // ! N/A
{0b00000000, 0b00000000}, // " N/A
{0b00000000, 0b00000000}, // # N/A
{0b11000101, 0b01100011}, // $ (bits 16, 15, 11, 9, 7, 6, 2, 1)
{0b00000000, 0b00000000}, // % N/A
{0b00000000, 0b00000000}, // & N/A
{0b00000000, 0b00000000}, // ' N/A
{0b00001001, 0b00001000}, // ( (bits 12, 9, 4)
{0b00010001, 0b00010000}, // ) (bits 13, 9, 5)
{0b10011001, 0b00111001}, // * (bits 16, 13, 12, 9, 6, 5, 4, 1)
{0b10000001, 0b00100001}, // + (bits 16, 9, 6, 1)
{0b00000000, 0b00000000}, // , N/A
{0b10000001, 0b00000001}, // - (bits 16, 9, 1)
{0b00000001, 0b00000000}, // . (bit 9)
{0b00010001, 0b00001000}, // / (bits 13, 9, 4)
{0b01110100, 0b01001110}, // 0 (bits 15, 14, 13, 11, 7, 4, 3, 2)
{0b01000000, 0b00001100}, // 1 (bits 15, 4, 3)
{0b10100101, 0b01000101}, // 2 (bits 16, 14, 11, 9, 7, 3, 1)
{0b11000101, 0b01000101}, // 3 (bits 16, 15, 11, 9, 7, 3, 1)
{0b11000001, 0b00000111}, // 4 (bits 16, 15, 9, 3, 2, 1)
{0b11000101, 0b01000011}, // 5 (bits 16, 15, 11, 9, 7, 2, 1)
{0b11100101, 0b01000011}, // 6 (bits 16, 15, 14, 11, 9, 7, 2, 1)
{0b00010001, 0b01001000}, // 7 (bits 13, 9, 7, 4)
{0b11100101, 0b01000111}, // 8 (bits 16, 15, 14, 11, 9, 7, 3, 2, 1)
{0b11000101, 0b01000111}, // 9 (bits 16, 15, 11, 9, 7, 3, 2, 1)
{0b00000010, 0b00000000}, // : (bit 10) available for 3-th and 5-th digits only
{0b00000000, 0b00000000}, // ; N/A
{0b00001000, 0b00001000}, // < (bits 12, 4)
{0b10000101, 0b00000001}, // = (bits 16, 11, 9, 1)
{0b00010000, 0b00010000}, // > (bits 13, 5)
{0b00000000, 0b00000000}, // ? N/A
{0b00000000, 0b00000000}, // @ N/A
{0b11100001, 0b01000111}, // A (bits 16, 15, 14, 9, 7, 3, 2, 1)
{0b01000101, 0b01100101}, // B (bits 15, 11, 9, 7, 6, 3, 1)
{0b00100100, 0b01000010}, // C (bits 14, 11, 7, 2)
{0b01000101, 0b01100100}, // D (bits 15, 11, 9, 7, 6, 3)
{0b10100101, 0b01000011}, // E (bits 16, 14, 11, 9, 7, 2, 1)
{0b10100001, 0b01000010}, // F (bits 16, 14, 9, 7, 2)
{0b01100100, 0b01000011}, // G (bits 15, 14, 11, 7, 2, 1)
{0b11100001, 0b00000111}, // H (bits 16, 15, 14, 9, 3, 2, 1)
{0b00000001, 0b00100000}, // I (bits 9, 6)
{0b01100100, 0b00000100}, // J (bits 15, 14, 11, 3)
{0b10101001, 0b00001010}, // K (bits 16, 14, 12, 9, 4, 2)
{0b00100100, 0b00000010}, // L (bits 14, 11, 2)
{0b01100000, 0b00011110}, // M (bits 15, 14, 5, 4, 3, 2)
{0b01101001, 0b00010110}, // N (bits 15, 14, 12, 9, 5, 3, 2)
{0b01100100, 0b01000110}, // O (bits 15, 14, 11, 7, 3, 2)
{0b10100001, 0b01000111}, // P (bits 16, 14, 9, 7, 3, 2, 1)
{0b01101100, 0b01000110}, // Q (bits 15, 14, 12, 11, 7, 3, 2)
{0b10101001, 0b01000111}, // R (bits 16, 14, 12, 9, 7, 3, 2, 1)
{0b11000101, 0b01000011}, // S (bits 16, 15, 11, 9, 7, 2, 1)
{0b00000001, 0b01100000}, // T (bits 9, 7, 6)
{0b01100100, 0b00000110}, // U (bits 15, 14, 11, 3, 2)
{0b00110000, 0b00001010}, // V (bits 14, 13, 4, 2)
{0b01111001, 0b00000110}, // W (bits 15, 14, 13, 12, 9, 3, 2)
{0b00011001, 0b00011000}, // X (bits 13, 12, 9, 5, 4)
{0b00010001, 0b00011000}, // Y (bits 13, 9, 5, 4)
{0b00010101, 0b01001000}, // Z (bits 13, 11, 9, 7, 4)
{0b00100100, 0b01000010}, // [ (bits 14, 11, 7, 2)
{0b00001001, 0b00010000}, // \ (bits 12, 9, 5)
{0b01000100, 0b01000100}, // ] (bits 15, 11, 7, 3)
{0b00000000, 0b00000000}, // ^ N/A
{0b00000100, 0b00000000}, // _ (bits 11)
//Special non-standard symbols
{0b10000001, 0b01000111} // degree (bits 16, 9, 7, 3, 2, 1) (index 64)
};
// Shortcuts refering to the indexes in the table ICONS_FONT
#define ICON_COLON_1 0
#define ICON_COLON_2 1
// LSB: grid number starting from 0
// MSB: segment number starting from 0
const uint8_t ICONS_FONT[] = {
0b10010011, // Index 0: Grid 3; 9; Colon
0b00010101, // Index 13: Grid 5; 9; Colon
};
#endif