165 lines
5.1 KiB
C
165 lines
5.1 KiB
C
/*
|
|
* font3x6.c
|
|
*
|
|
* Created: 4/8/2015 11:31:21 AM
|
|
* Author: Baron Williams
|
|
*/
|
|
|
|
#if defined(__K64F__)
|
|
#include <stdio.h>
|
|
#include <ctype.h>
|
|
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <unistd.h>
|
|
#include <stdarg.h>
|
|
#include <core_pins.h>
|
|
#include <usb_serial.h>
|
|
#include <Arduino.h>
|
|
#include "k64f_soc.h"
|
|
#include <../../libraries/include/stdmisc.h>
|
|
#elif defined(__ZPU__)
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#include "zpu_soc.h"
|
|
#include <stdlib.h>
|
|
#include <ctype.h>
|
|
#include <stdmisc.h>
|
|
#else
|
|
#error "Target CPU not defined, use __ZPU__ or __K64F__"
|
|
#endif
|
|
|
|
#include "fonts.h"
|
|
|
|
#define FONT_CHAR_FIRST 32
|
|
#define FONT_CHAR_LAST 127
|
|
#define FONT_CHARS 96
|
|
#define FONT_WIDTH 3
|
|
#define FONT_HEIGHT 6
|
|
#define FONT_SPACING 1
|
|
|
|
static const uint8_t fontData3x6[FONT_CHARS][FONT_WIDTH]= {
|
|
{ 0x00, 0x00, 0x00, }, // ' ' 32
|
|
{ 0x00, 0x17, 0x00, }, // '!' 33
|
|
{ 0x03, 0x00, 0x03, }, // '"' 34
|
|
{ 0x1F, 0x0A, 0x1F, }, // '#' 35
|
|
{ 0x16, 0x1F, 0x0D, }, // '$' 36
|
|
{ 0x19, 0x04, 0x13, }, // '%' 37
|
|
{ 0x1A, 0x15, 0x0A, }, // '&' 38
|
|
{ 0x00, 0x03, 0x00, }, // ''' 39
|
|
{ 0x0E, 0x11, 0x00, }, // '(' 40
|
|
{ 0x00, 0x11, 0x0E, }, // ')' 41
|
|
{ 0x0A, 0x04, 0x0A, }, // '*' 42
|
|
{ 0x04, 0x0E, 0x04, }, // '+' 43
|
|
{ 0x10, 0x08, 0x00, }, // ',' 44
|
|
{ 0x04, 0x04, 0x04, }, // '-' 45
|
|
{ 0x00, 0x10, 0x00, }, // '.' 46
|
|
{ 0x18, 0x04, 0x03, }, // '/' 47
|
|
{ 0x1F, 0x11, 0x1F, }, // '0' 48
|
|
{ 0x12, 0x1F, 0x10, }, // '1' 49
|
|
{ 0x1D, 0x15, 0x17, }, // '2' 50
|
|
{ 0x11, 0x15, 0x1F, }, // '3' 51
|
|
{ 0x07, 0x04, 0x1F, }, // '4' 52
|
|
{ 0x17, 0x15, 0x1D, }, // '5' 53
|
|
{ 0x1F, 0x15, 0x1D, }, // '6' 54
|
|
{ 0x19, 0x05, 0x03, }, // '7' 55
|
|
{ 0x1F, 0x15, 0x1F, }, // '8' 56
|
|
{ 0x17, 0x15, 0x1F, }, // '9' 57
|
|
{ 0x00, 0x0A, 0x00, }, // ':' 58
|
|
{ 0x10, 0x0A, 0x00, }, // ';' 59
|
|
{ 0x04, 0x0A, 0x11, }, // '<' 60
|
|
{ 0x0A, 0x0A, 0x0A, }, // '=' 61
|
|
{ 0x11, 0x0A, 0x04, }, // '>' 62
|
|
{ 0x01, 0x15, 0x03, }, // '?' 63
|
|
{ 0x0E, 0x11, 0x16, }, // '@' 64
|
|
{ 0x1F, 0x05, 0x1F, }, // 'A' 65
|
|
{ 0x1F, 0x15, 0x1B, }, // 'B' 66
|
|
{ 0x0E, 0x11, 0x11, }, // 'C' 67
|
|
{ 0x1F, 0x11, 0x0E, }, // 'D' 68
|
|
{ 0x1F, 0x15, 0x15, }, // 'E' 69
|
|
{ 0x1F, 0x05, 0x05, }, // 'F' 70
|
|
{ 0x0E, 0x11, 0x1D, }, // 'G' 71
|
|
{ 0x1F, 0x04, 0x1F, }, // 'H' 72
|
|
{ 0x11, 0x1F, 0x11, }, // 'I' 73
|
|
{ 0x08, 0x11, 0x0F, }, // 'J' 74
|
|
{ 0x1F, 0x04, 0x1B, }, // 'K' 75
|
|
{ 0x1F, 0x10, 0x10, }, // 'L' 76
|
|
{ 0x1F, 0x02, 0x1F, }, // 'M' 77
|
|
{ 0x1F, 0x01, 0x1E, }, // 'N' 78
|
|
{ 0x0E, 0x11, 0x0E, }, // 'O' 79
|
|
{ 0x1F, 0x05, 0x06, }, // 'P' 80
|
|
{ 0x0E, 0x19, 0x1F, }, // 'Q' 81
|
|
{ 0x1F, 0x05, 0x1B, }, // 'R' 82
|
|
{ 0x12, 0x15, 0x09, }, // 'S' 83
|
|
{ 0x01, 0x1F, 0x01, }, // 'T' 84
|
|
{ 0x0F, 0x10, 0x1F, }, // 'U' 85
|
|
{ 0x0F, 0x10, 0x0F, }, // 'V' 86
|
|
{ 0x1F, 0x0C, 0x1F, }, // 'W' 87
|
|
{ 0x1B, 0x04, 0x1B, }, // 'X' 88
|
|
{ 0x03, 0x1C, 0x03, }, // 'Y' 89
|
|
{ 0x19, 0x15, 0x13, }, // 'Z' 90
|
|
{ 0x00, 0x1F, 0x11, }, // '[' 91
|
|
{ 0x03, 0x04, 0x18, }, // '\' 92
|
|
{ 0x11, 0x1F, 0x00, }, // ']' 93
|
|
{ 0x02, 0x01, 0x02, }, // '^' 94
|
|
{ 0x10, 0x10, 0x10, }, // '_' 95
|
|
{ 0x01, 0x02, 0x00, }, // '`' 96
|
|
{ 0x0C, 0x12, 0x1E, }, // 'a' 97
|
|
{ 0x1F, 0x12, 0x0C, }, // 'b' 98
|
|
{ 0x0C, 0x12, 0x12, }, // 'c' 99
|
|
{ 0x0C, 0x12, 0x1F, }, // 'd' 100
|
|
{ 0x0C, 0x1A, 0x16, }, // 'e' 101
|
|
{ 0x1E, 0x09, 0x02, }, // 'f' 102
|
|
{ 0x24, 0x2A, 0x1E, }, // 'g' 103
|
|
{ 0x1F, 0x04, 0x18, }, // 'h' 104
|
|
{ 0x00, 0x1D, 0x00, }, // 'i' 105
|
|
{ 0x20, 0x20, 0x1D, }, // 'j' 106
|
|
{ 0x1F, 0x04, 0x1A, }, // 'k' 107
|
|
{ 0x00, 0x0F, 0x10, }, // 'l' 108
|
|
{ 0x1E, 0x04, 0x1E, }, // 'm' 109
|
|
{ 0x1E, 0x02, 0x1C, }, // 'n' 110
|
|
{ 0x0C, 0x12, 0x0C, }, // 'o' 111
|
|
{ 0x3E, 0x0A, 0x04, }, // 'p' 112
|
|
{ 0x04, 0x0A, 0x3E, }, // 'q' 113
|
|
{ 0x1E, 0x04, 0x02, }, // 'r' 114
|
|
{ 0x14, 0x16, 0x1A, }, // 's' 115
|
|
{ 0x02, 0x0F, 0x12, }, // 't' 116
|
|
{ 0x0E, 0x10, 0x1E, }, // 'u' 117
|
|
{ 0x0E, 0x10, 0x0E, }, // 'v' 118
|
|
{ 0x1E, 0x08, 0x1E, }, // 'w' 119
|
|
{ 0x1A, 0x04, 0x1A, }, // 'x' 120
|
|
{ 0x26, 0x28, 0x1E, }, // 'y' 121
|
|
{ 0x1A, 0x1E, 0x16, }, // 'z' 122
|
|
{ 0x04, 0x1F, 0x11, }, // '{' 123
|
|
{ 0x00, 0x1F, 0x00, }, // '|' 124
|
|
{ 0x11, 0x1F, 0x04, }, // '}' 125
|
|
{ 0x01, 0x03, 0x02, }, // '~' 126
|
|
{ 0x0E, 0x09, 0x0E }, // delete 127
|
|
};
|
|
|
|
/*
|
|
*
|
|
* Font: font3x6
|
|
* Set: ASCII printable characters (codes 32-127)
|
|
* Size: 3x6
|
|
* Spacing: required horizontally
|
|
* Format: Vertical, 1 byte per column, top bit is 0
|
|
*
|
|
* The extended ASCII codes (character code 128-255) are
|
|
* not included because they contain many characters that
|
|
* not possible to represent using a 3x6 grid.
|
|
*
|
|
* Characters: 96 (ASCII 32-127).
|
|
* Bit format: vertical
|
|
* Memory: 288 bytes (96x3)
|
|
*/
|
|
const fontStruct font3x6 = {
|
|
(byte *) fontData3x6,
|
|
FONT_CHARS,
|
|
FONT_CHAR_FIRST,
|
|
FONT_CHAR_LAST,
|
|
FONT_WIDTH,
|
|
FONT_HEIGHT,
|
|
FONT_SPACING,
|
|
true
|
|
};
|