58 template<BOARD::pin_t SCE_PIN,
60 BOARD::pin_t SDIN_PIN,
61 BOARD::pin_t SCLK_PIN>
79 static const uint8_t default_font[] PROGMEM = {
80 0x00, 0x00, 0x00, 0x00, 0x00,
81 0x00, 0x00, 0x5F, 0x00, 0x00,
82 0x00, 0x07, 0x00, 0x07, 0x00,
83 0x14, 0x7F, 0x14, 0x7F, 0x14,
84 0x24, 0x2A, 0x7F, 0x2A, 0x12,
85 0x23, 0x13, 0x08, 0x64, 0x62,
86 0x36, 0x49, 0x56, 0x20, 0x50,
87 0x00, 0x08, 0x07, 0x03, 0x00,
88 0x00, 0x1C, 0x22, 0x41, 0x00,
89 0x00, 0x41, 0x22, 0x1C, 0x00,
90 0x2A, 0x1C, 0x7F, 0x1C, 0x2A,
91 0x08, 0x08, 0x3E, 0x08, 0x08,
92 0x00, 0x80, 0x70, 0x30, 0x00,
93 0x08, 0x08, 0x08, 0x08, 0x08,
94 0x00, 0x00, 0x60, 0x60, 0x00,
95 0x20, 0x10, 0x08, 0x04, 0x02,
96 0x3E, 0x51, 0x49, 0x45, 0x3E,
97 0x00, 0x42, 0x7F, 0x40, 0x00,
98 0x72, 0x49, 0x49, 0x49, 0x46,
99 0x21, 0x41, 0x49, 0x4D, 0x33,
100 0x18, 0x14, 0x12, 0x7F, 0x10,
101 0x27, 0x45, 0x45, 0x45, 0x39,
102 0x3C, 0x4A, 0x49, 0x49, 0x31,
103 0x41, 0x21, 0x11, 0x09, 0x07,
104 0x36, 0x49, 0x49, 0x49, 0x36,
105 0x46, 0x49, 0x49, 0x29, 0x1E,
106 0x00, 0x00, 0x14, 0x00, 0x00,
107 0x00, 0x40, 0x34, 0x00, 0x00,
108 0x00, 0x08, 0x14, 0x22, 0x41,
109 0x14, 0x14, 0x14, 0x14, 0x14,
110 0x00, 0x41, 0x22, 0x14, 0x08,
111 0x02, 0x01, 0x59, 0x09, 0x06,
112 0x3E, 0x41, 0x5D, 0x59, 0x4E,
113 0x7C, 0x12, 0x11, 0x12, 0x7C,
114 0x7F, 0x49, 0x49, 0x49, 0x36,
115 0x3E, 0x41, 0x41, 0x41, 0x22,
116 0x7F, 0x41, 0x41, 0x41, 0x3E,
117 0x7F, 0x49, 0x49, 0x49, 0x41,
118 0x7F, 0x09, 0x09, 0x09, 0x01,
119 0x3E, 0x41, 0x41, 0x51, 0x73,
120 0x7F, 0x08, 0x08, 0x08, 0x7F,
121 0x00, 0x41, 0x7F, 0x41, 0x00,
122 0x20, 0x40, 0x41, 0x3F, 0x01,
123 0x7F, 0x08, 0x14, 0x22, 0x41,
124 0x7F, 0x40, 0x40, 0x40, 0x40,
125 0x7F, 0x02, 0x1C, 0x02, 0x7F,
126 0x7F, 0x04, 0x08, 0x10, 0x7F,
127 0x3E, 0x41, 0x41, 0x41, 0x3E,
128 0x7F, 0x09, 0x09, 0x09, 0x06,
129 0x3E, 0x41, 0x51, 0x21, 0x5E,
130 0x7F, 0x09, 0x19, 0x29, 0x46,
131 0x26, 0x49, 0x49, 0x49, 0x32,
132 0x03, 0x01, 0x7F, 0x01, 0x03,
133 0x3F, 0x40, 0x40, 0x40, 0x3F,
134 0x1F, 0x20, 0x40, 0x20, 0x1F,
135 0x3F, 0x40, 0x38, 0x40, 0x3F,
136 0x63, 0x14, 0x08, 0x14, 0x63,
137 0x03, 0x04, 0x78, 0x04, 0x03,
138 0x61, 0x59, 0x49, 0x4D, 0x43,
139 0x00, 0x7F, 0x41, 0x41, 0x41,
140 0x02, 0x04, 0x08, 0x10, 0x20,
141 0x00, 0x41, 0x41, 0x41, 0x7F,
142 0x04, 0x02, 0x01, 0x02, 0x04,
143 0x40, 0x40, 0x40, 0x40, 0x40,
144 0x00, 0x03, 0x07, 0x08, 0x00,
145 0x20, 0x54, 0x54, 0x78, 0x40,
146 0x7F, 0x28, 0x44, 0x44, 0x38,
147 0x38, 0x44, 0x44, 0x44, 0x28,
148 0x38, 0x44, 0x44, 0x28, 0x7F,
149 0x38, 0x54, 0x54, 0x54, 0x18,
150 0x00, 0x08, 0x7E, 0x09, 0x02,
151 0x18, 0xA4, 0xA4, 0x9C, 0x78,
152 0x7F, 0x08, 0x04, 0x04, 0x78,
153 0x00, 0x44, 0x7D, 0x40, 0x00,
154 0x20, 0x40, 0x40, 0x3D, 0x00,
155 0x7F, 0x10, 0x28, 0x44, 0x00,
156 0x00, 0x41, 0x7F, 0x40, 0x00,
157 0x7C, 0x04, 0x78, 0x04, 0x78,
158 0x7C, 0x08, 0x04, 0x04, 0x78,
159 0x38, 0x44, 0x44, 0x44, 0x38,
160 0xFC, 0x18, 0x24, 0x24, 0x18,
161 0x18, 0x24, 0x24, 0x18, 0xFC,
162 0x7C, 0x08, 0x04, 0x04, 0x08,
163 0x48, 0x54, 0x54, 0x54, 0x24,
164 0x04, 0x04, 0x3F, 0x44, 0x24,
165 0x3C, 0x40, 0x40, 0x20, 0x7C,
166 0x1C, 0x20, 0x40, 0x20, 0x1C,
167 0x3C, 0x40, 0x30, 0x40, 0x3C,
168 0x44, 0x28, 0x10, 0x28, 0x44,
169 0x4C, 0x90, 0x90, 0x90, 0x7C,
170 0x44, 0x64, 0x54, 0x4C, 0x44,
171 0x00, 0x08, 0x36, 0x41, 0x00,
172 0x00, 0x00, 0x77, 0x00, 0x00,
173 0x00, 0x41, 0x36, 0x08, 0x00,
174 0x02, 0x01, 0x02, 0x04, 0x02,
175 0x3C, 0x26, 0x23, 0x26, 0x3C,
177 m_font = font != NULL ? font : default_font;
190 static const uint8_t script[] PROGMEM = {
288 if (x >= WIDTH) x = 0;
289 if (y >= HEIGHT) y = 0;
342 uint8_t width = FONT_WIDTH - 1;
343 const uint8_t* fp =
m_font + ((c -
' ') * width);
378 } __attribute__((packed));
390 SRPO<MSBFIRST, SDIN_PIN, SCLK_PIN>
m_srpo;
404 if (count == 0)
return;
406 do m_srpo.write(value);
while (--count);
421 if (count == 0)
return;
424 do m_srpo.write(pgm_read_byte(buf++));
while (--count);
static const uint8_t HEIGHT
uint8_t m_y
Cursor position y.
virtual size_t write(uint8_t c)
uint8_t m_x
Cursor position x.
void write_command_P(const uint8_t *buf, size_t count)
virtual void display_clear()
static const uint8_t FONT_WIDTH
Extended instruction set control.
static const uint8_t BACKGROUND
virtual void backlight_off()
Sets X-address of RAM (0..83).
void write_command(uint8_t value)
void write_data(uint8_t value)
virtual void cursor_set(uint8_t x, uint8_t y)
Write Vop to register (0..127).
PCD8544(const uint8_t *font=NULL)
virtual void backlight_on()
static const uint8_t WIDTH
virtual void display_contrast(uint8_t level)
Set temperature coefficient (0..3).
Sets Y-address of RAM (0..5).
static const uint8_t FONT_HEIGHT
void write_data(uint8_t value, size_t count)
virtual void display_off()
SRPO< MSBFIRST, SDIN_PIN, SCLK_PIN > m_srpo
virtual void display_normal()
virtual void cursor_home()
virtual void display_on()
virtual void display_inverse()