1 |
595 |
jeremybenn |
/**************************************************************************//**
|
2 |
|
|
* @file
|
3 |
|
|
* @brief LCD Controller font and display layout for EFM32 development MCU
|
4 |
|
|
* module
|
5 |
|
|
* @author Energy Micro AS
|
6 |
|
|
* @version 1.0.1
|
7 |
|
|
******************************************************************************
|
8 |
|
|
* @section License
|
9 |
|
|
* <b>(C) Copyright 2009 Energy Micro AS, http://www.energymicro.com</b>
|
10 |
|
|
******************************************************************************
|
11 |
|
|
*
|
12 |
|
|
* This source code is the property of Energy Micro AS. The source and compiled
|
13 |
|
|
* code may only be used on Energy Micro "EFM32" microcontrollers.
|
14 |
|
|
*
|
15 |
|
|
* This copyright notice may not be removed from the source code nor changed.
|
16 |
|
|
*
|
17 |
|
|
* DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no
|
18 |
|
|
* obligation to support this Software. Energy Micro AS is providing the
|
19 |
|
|
* Software "AS IS", with no express or implied warranties of any kind,
|
20 |
|
|
* including, but not limited to, any implied warranties of merchantability
|
21 |
|
|
* or fitness for any particular purpose or warranties against infringement
|
22 |
|
|
* of any proprietary rights of a third party.
|
23 |
|
|
*
|
24 |
|
|
* Energy Micro AS will not be liable for any consequential, incidental, or
|
25 |
|
|
* special damages, or any other relief, or for any claim by any third party,
|
26 |
|
|
* arising from your use of this Software.
|
27 |
|
|
*
|
28 |
|
|
****************************************************************************/
|
29 |
|
|
|
30 |
|
|
#ifndef _LCDDISPLAY_H
|
31 |
|
|
#define _LCDDISPLAY_H
|
32 |
|
|
|
33 |
|
|
#include <stdint.h>
|
34 |
|
|
/**************************************************************************//**
|
35 |
|
|
* @brief
|
36 |
|
|
* Defines each text symbol's segment in terms of COM and BIT numbers,
|
37 |
|
|
* in a way that we can enumerate each bit for each text segment in the
|
38 |
|
|
* following bit pattern:
|
39 |
|
|
* @verbatim
|
40 |
|
|
* -------0------
|
41 |
|
|
*
|
42 |
|
|
* | \7 |8 /9 |
|
43 |
|
|
* |5 \ | / |1
|
44 |
|
|
*
|
45 |
|
|
* --6--- ---10--
|
46 |
|
|
*
|
47 |
|
|
* | / | \11 |
|
48 |
|
|
* |4 /13 |12 \ |2
|
49 |
|
|
*
|
50 |
|
|
* -------3------
|
51 |
|
|
* @endverbatim
|
52 |
|
|
* E.g.: First text character bit pattern #3 (above) is
|
53 |
|
|
* Segment 1D for Display
|
54 |
|
|
* Location COM 3, BIT 0
|
55 |
|
|
*****************************************************************************/
|
56 |
|
|
typedef struct
|
57 |
|
|
{
|
58 |
|
|
uint32_t com[14]; /**< LCD COM line (for multiplexing) */
|
59 |
|
|
uint32_t bit[14]; /**< LCD bit number */
|
60 |
|
|
} CHAR_TypeDef;
|
61 |
|
|
|
62 |
|
|
|
63 |
|
|
/**************************************************************************//**
|
64 |
|
|
* @brief Defines segment COM and BIT fields numeric display
|
65 |
|
|
*****************************************************************************/
|
66 |
|
|
typedef struct
|
67 |
|
|
{
|
68 |
|
|
uint32_t com[7];
|
69 |
|
|
uint32_t bit[7];
|
70 |
|
|
} NUMBER_TypeDef;
|
71 |
|
|
|
72 |
|
|
/**************************************************************************//**
|
73 |
|
|
* @brief Defines segment COM and BIT fields for Energy Modes on display
|
74 |
|
|
*****************************************************************************/
|
75 |
|
|
typedef struct
|
76 |
|
|
{
|
77 |
|
|
uint32_t com[5]; /**< LCD COM line (for multiplexing) */
|
78 |
|
|
uint32_t bit[5]; /**< LCD bit number */
|
79 |
|
|
} EM_TypeDef;
|
80 |
|
|
|
81 |
|
|
/**************************************************************************//**
|
82 |
|
|
* @brief Defines segment COM and BIT fields for A-wheel (suited for Anim)
|
83 |
|
|
*****************************************************************************/
|
84 |
|
|
typedef struct
|
85 |
|
|
{
|
86 |
|
|
uint32_t com[8]; /**< LCD COM line (for multiplexing) */
|
87 |
|
|
uint32_t bit[8]; /**< LCD bit number */
|
88 |
|
|
} ARING_TypeDef;
|
89 |
|
|
|
90 |
|
|
/**************************************************************************//**
|
91 |
|
|
* @brief Defines segment COM and BIT fields for A-wheel (suited for Anim)
|
92 |
|
|
*****************************************************************************/
|
93 |
|
|
typedef struct
|
94 |
|
|
{
|
95 |
|
|
uint32_t com[4]; /**< LCD COM line (for multiplexing) */
|
96 |
|
|
uint32_t bit[4]; /**< LCD bit number */
|
97 |
|
|
} BATTERY_TypeDef;
|
98 |
|
|
|
99 |
|
|
/**************************************************************************//**
|
100 |
|
|
* @brief Defines prototype for all segments in display
|
101 |
|
|
*****************************************************************************/
|
102 |
|
|
typedef struct
|
103 |
|
|
{
|
104 |
|
|
CHAR_TypeDef Text[7];
|
105 |
|
|
NUMBER_TypeDef Number[4];
|
106 |
|
|
EM_TypeDef EMode;
|
107 |
|
|
ARING_TypeDef ARing;
|
108 |
|
|
BATTERY_TypeDef Battery;
|
109 |
|
|
} MCU_DISPLAY;
|
110 |
|
|
|
111 |
|
|
/**************************************************************************//**
|
112 |
|
|
* @brief Working instance of LCD display
|
113 |
|
|
*****************************************************************************/
|
114 |
|
|
MCU_DISPLAY EFMDisplay = {
|
115 |
|
|
.Text = {
|
116 |
|
|
{ /* 1 */
|
117 |
|
|
.com[0] = 3, .com[1] = 3, .com[2] = 1, .com[3] = 0,
|
118 |
|
|
.bit[0] = 10, .bit[1] = 12, .bit[2] = 12, .bit[3] = 10,
|
119 |
|
|
|
120 |
|
|
.com[4] = 1, .com[5] = 3, .com[6] = 2, .com[7] = 2,
|
121 |
|
|
.bit[4] = 9, .bit[5] = 9, .bit[6] = 9, .bit[7] = 10,
|
122 |
|
|
|
123 |
|
|
.com[8] = 2, .com[9] = 3, .com[10] = 2, .com[11] = 0,
|
124 |
|
|
.bit[8] = 11, .bit[9] = 11, .bit[10] = 12, .bit[11] = 11,
|
125 |
|
|
|
126 |
|
|
.com[12] = 1, .com[13] = 1,
|
127 |
|
|
.bit[12] = 11, .bit[13] = 10
|
128 |
|
|
},
|
129 |
|
|
{ /* 2 */
|
130 |
|
|
.com[0] = 3, .com[1] = 3, .com[2] = 1, .com[3] = 0,
|
131 |
|
|
.bit[0] = 14, .bit[1] = 16, .bit[2] = 16, .bit[3] = 14,
|
132 |
|
|
|
133 |
|
|
.com[4] = 1, .com[5] = 3, .com[6] = 2, .com[7] = 2,
|
134 |
|
|
.bit[4] = 13, .bit[5] = 13, .bit[6] = 13, .bit[7] = 14,
|
135 |
|
|
|
136 |
|
|
.com[8] = 2, .com[9] = 3, .com[10] = 2, .com[11] = 0,
|
137 |
|
|
.bit[8] = 15, .bit[9] = 15, .bit[10] = 16, .bit[11] = 15,
|
138 |
|
|
|
139 |
|
|
.com[12] = 1, .com[13] = 1,
|
140 |
|
|
.bit[12] = 15, .bit[13] = 14
|
141 |
|
|
},
|
142 |
|
|
{ /* 3 */
|
143 |
|
|
.com[0] = 3, .com[1] = 3, .com[2] = 1, .com[3] = 0,
|
144 |
|
|
.bit[0] = 18, .bit[1] = 20, .bit[2] = 20, .bit[3] = 18,
|
145 |
|
|
|
146 |
|
|
.com[4] = 1, .com[5] = 3, .com[6] = 2, .com[7] = 2,
|
147 |
|
|
.bit[4] = 17, .bit[5] = 17, .bit[6] = 17, .bit[7] = 18,
|
148 |
|
|
|
149 |
|
|
.com[8] = 2, .com[9] = 3, .com[10] = 2, .com[11] = 0,
|
150 |
|
|
.bit[8] = 19, .bit[9] = 19, .bit[10] = 20, .bit[11] = 19,
|
151 |
|
|
|
152 |
|
|
.com[12] = 1, .com[13] = 1,
|
153 |
|
|
.bit[12] = 19, .bit[13] = 18
|
154 |
|
|
},
|
155 |
|
|
{ /* 4 */
|
156 |
|
|
.com[0] = 3, .com[1] = 3, .com[2] = 1, .com[3] = 0,
|
157 |
|
|
.bit[0] = 22, .bit[1] = 24, .bit[2] = 24, .bit[3] = 22,
|
158 |
|
|
|
159 |
|
|
.com[4] = 1, .com[5] = 3, .com[6] = 2, .com[7] = 2,
|
160 |
|
|
.bit[4] = 21, .bit[5] = 21, .bit[6] = 21, .bit[7] = 22,
|
161 |
|
|
|
162 |
|
|
.com[8] = 2, .com[9] = 3, .com[10] = 2, .com[11] = 0,
|
163 |
|
|
.bit[8] = 23, .bit[9] = 23, .bit[10] = 24, .bit[11] = 23,
|
164 |
|
|
|
165 |
|
|
.com[12] = 1, .com[13] = 1,
|
166 |
|
|
.bit[12] = 23, .bit[13] = 22
|
167 |
|
|
},
|
168 |
|
|
{ /* 5 */
|
169 |
|
|
.com[0] = 3, .com[1] = 3, .com[2] = 1, .com[3] = 0,
|
170 |
|
|
.bit[0] = 25, .bit[1] = 6, .bit[2] = 6, .bit[3] = 25,
|
171 |
|
|
|
172 |
|
|
.com[4] = 1, .com[5] = 3, .com[6] = 2, .com[7] = 2,
|
173 |
|
|
.bit[4] = 7, .bit[5] = 7, .bit[6] = 7, .bit[7] = 25,
|
174 |
|
|
|
175 |
|
|
.com[8] = 2, .com[9] = 3, .com[10] = 2, .com[11] = 0,
|
176 |
|
|
.bit[8] = 26, .bit[9] = 26, .bit[10] = 6, .bit[11] = 26,
|
177 |
|
|
|
178 |
|
|
.com[12] = 1, .com[13] = 1,
|
179 |
|
|
.bit[12] = 26, .bit[13] = 25
|
180 |
|
|
},
|
181 |
|
|
{ /* 6 */
|
182 |
|
|
.com[0] = 3, .com[1] = 3, .com[2] = 1, .com[3] = 0,
|
183 |
|
|
.bit[0] = 27, .bit[1] = 04, .bit[2] = 04, .bit[3] = 27,
|
184 |
|
|
|
185 |
|
|
.com[4] = 1, .com[5] = 3, .com[6] = 2, .com[7] = 2,
|
186 |
|
|
.bit[4] = 5, .bit[5] = 5, .bit[6] = 5, .bit[7] = 27,
|
187 |
|
|
|
188 |
|
|
.com[8] = 2, .com[9] = 3, .com[10] = 2, .com[11] = 0,
|
189 |
|
|
.bit[8] = 28, .bit[9] = 28, .bit[10] = 4, .bit[11] = 28,
|
190 |
|
|
|
191 |
|
|
.com[12] = 1, .com[13] = 1,
|
192 |
|
|
.bit[12] = 28, .bit[13] = 27
|
193 |
|
|
},
|
194 |
|
|
{ /* 7 */
|
195 |
|
|
.com[0] = 3, .com[1] = 3, .com[2] = 1, .com[3] = 0,
|
196 |
|
|
.bit[0] = 29, .bit[1] = 2, .bit[2] = 2, .bit[3] = 29,
|
197 |
|
|
|
198 |
|
|
.com[4] = 1, .com[5] = 3, .com[6] = 2, .com[7] = 2,
|
199 |
|
|
.bit[4] = 03, .bit[5] = 3, .bit[6] = 3, .bit[7] = 29,
|
200 |
|
|
|
201 |
|
|
.com[8] = 2, .com[9] = 3, .com[10] = 2, .com[11] = 0,
|
202 |
|
|
.bit[8] = 30, .bit[9] = 30, .bit[10] = 2, .bit[11] = 30,
|
203 |
|
|
|
204 |
|
|
.com[12] = 1, .com[13] = 1,
|
205 |
|
|
.bit[12] = 30, .bit[13] = 29
|
206 |
|
|
}
|
207 |
|
|
},
|
208 |
|
|
.Number = {
|
209 |
|
|
{
|
210 |
|
|
.com[0] = 3, .com[1] = 2, .com[2] = 1, .com[3] = 0,
|
211 |
|
|
.bit[0] = 31, .bit[1] = 31, .bit[2] = 31, .bit[3] = 31,
|
212 |
|
|
|
213 |
|
|
.com[4] = 5, .com[5] = 7, .com[6] = 6,
|
214 |
|
|
.bit[4] = 0, .bit[5] = 0, .bit[6] = 0,
|
215 |
|
|
},
|
216 |
|
|
{
|
217 |
|
|
.com[0] = 7, .com[1] = 6, .com[2] = 5, .com[3] = 4,
|
218 |
|
|
.bit[0] = 1, .bit[1] = 1, .bit[2] = 1, .bit[3] = 1,
|
219 |
|
|
|
220 |
|
|
.com[4] = 5, .com[5] = 7, .com[6] = 6,
|
221 |
|
|
.bit[4] = 3, .bit[5] = 3, .bit[6] = 3,
|
222 |
|
|
},
|
223 |
|
|
{
|
224 |
|
|
.com[0] = 7, .com[1] = 6, .com[2] = 5, .com[3] = 4,
|
225 |
|
|
.bit[0] = 4, .bit[1] = 4, .bit[2] = 4, .bit[3] = 4,
|
226 |
|
|
|
227 |
|
|
.com[4] = 5, .com[5] = 7, .com[6] = 6,
|
228 |
|
|
.bit[4] = 5, .bit[5] = 5, .bit[6] = 5,
|
229 |
|
|
},
|
230 |
|
|
{
|
231 |
|
|
.com[0] = 7, .com[1] = 6, .com[2] = 5, .com[3] = 4,
|
232 |
|
|
.bit[0] = 6, .bit[1] = 6, .bit[2] = 6, .bit[3] = 6,
|
233 |
|
|
|
234 |
|
|
.com[4] = 5, .com[5] = 7, .com[6] = 6,
|
235 |
|
|
.bit[4] = 7, .bit[5] = 7, .bit[6] = 7,
|
236 |
|
|
},
|
237 |
|
|
},
|
238 |
|
|
.EMode = {
|
239 |
|
|
.com[0] = 1, .bit[0] = 1,
|
240 |
|
|
.com[1] = 2, .bit[1] = 1,
|
241 |
|
|
.com[2] = 1, .bit[2] = 0,
|
242 |
|
|
.com[3] = 2, .bit[3] = 0,
|
243 |
|
|
.com[4] = 3, .bit[4] = 0,
|
244 |
|
|
},
|
245 |
|
|
.ARing = {
|
246 |
|
|
.com[0] = 0, .bit[0] = 0,
|
247 |
|
|
.com[1] = 0, .bit[1] = 1,
|
248 |
|
|
.com[2] = 0, .bit[2] = 2,
|
249 |
|
|
.com[3] = 0, .bit[3] = 3,
|
250 |
|
|
|
251 |
|
|
.com[4] = 0, .bit[4] = 4,
|
252 |
|
|
.com[5] = 0, .bit[5] = 5,
|
253 |
|
|
.com[6] = 0, .bit[6] = 6,
|
254 |
|
|
.com[7] = 0, .bit[7] = 7,
|
255 |
|
|
},
|
256 |
|
|
.Battery = {
|
257 |
|
|
.com[0] = 0, .bit[0] = 12,
|
258 |
|
|
.com[1] = 0, .bit[1] = 17,
|
259 |
|
|
.com[2] = 0, .bit[2] = 20,
|
260 |
|
|
.com[3] = 0, .bit[3] = 13,
|
261 |
|
|
}
|
262 |
|
|
};
|
263 |
|
|
|
264 |
|
|
/**************************************************************************//**
|
265 |
|
|
* @brief
|
266 |
|
|
* Defines higlighted segments for the alphabet, starting from "blank" (SPACE)
|
267 |
|
|
* Uses bit pattern as defined for text segments above.
|
268 |
|
|
* E.g. a capital O, would have bits 0 1 2 3 4 5 => 0x003f defined
|
269 |
|
|
*****************************************************************************/
|
270 |
|
|
uint16_t EM_alphabet[] = {
|
271 |
|
|
0x0000, /* space */
|
272 |
|
|
0x1100, /* ! */
|
273 |
|
|
0x0280, /* " */
|
274 |
|
|
0x0000, /* # */
|
275 |
|
|
0x0000, /* $ */
|
276 |
|
|
0x0000, /* % */
|
277 |
|
|
0x0000, /* & */
|
278 |
|
|
0x0000, /* £ */
|
279 |
|
|
0x0039, /* ( */
|
280 |
|
|
0x000f, /* ) */
|
281 |
|
|
0x0000, /* * */
|
282 |
|
|
0x1540, /* + */
|
283 |
|
|
0x0000, /* , */
|
284 |
|
|
0x0440, /* - */
|
285 |
|
|
0x0000, /* . */
|
286 |
|
|
0x2200, /* / */
|
287 |
|
|
|
288 |
|
|
0x003f, /* 0 */
|
289 |
|
|
0x0006, /* 1 */
|
290 |
|
|
0x045b, /* 2 */
|
291 |
|
|
0x044f, /* 3 */
|
292 |
|
|
0x0466, /* 4 */
|
293 |
|
|
0x046d, /* 5 */
|
294 |
|
|
0x047d, /* 6 */
|
295 |
|
|
0x0007, /* 7 */
|
296 |
|
|
0x047f, /* 8 */
|
297 |
|
|
0x046f, /* 9 */
|
298 |
|
|
|
299 |
|
|
0x0000, /* : */
|
300 |
|
|
0x0000, /* ; */
|
301 |
|
|
0x0a00, /* < */
|
302 |
|
|
0x0000, /* = */
|
303 |
|
|
0x2080, /* > */
|
304 |
|
|
0x0000, /* ? */
|
305 |
|
|
0xffff, /* @ */
|
306 |
|
|
|
307 |
|
|
0x0477, /* A */
|
308 |
|
|
0x0a79, /* B */
|
309 |
|
|
0x0039, /* C */
|
310 |
|
|
0x20b0, /* D */
|
311 |
|
|
0x0079, /* E */
|
312 |
|
|
0x0071, /* F */
|
313 |
|
|
0x047d, /* G */
|
314 |
|
|
0x0476, /* H */
|
315 |
|
|
0x0006, /* I */
|
316 |
|
|
0x000e, /* J */
|
317 |
|
|
0x0a70, /* K */
|
318 |
|
|
0x0038, /* L */
|
319 |
|
|
0x02b6, /* M */
|
320 |
|
|
0x08b6, /* N */
|
321 |
|
|
0x003f, /* O */
|
322 |
|
|
0x0473, /* P */
|
323 |
|
|
0x083f, /* Q */
|
324 |
|
|
0x0c73, /* R */
|
325 |
|
|
0x046d, /* S */
|
326 |
|
|
0x1101, /* T */
|
327 |
|
|
0x003e, /* U */
|
328 |
|
|
0x2230, /* V */
|
329 |
|
|
0x2836, /* W */
|
330 |
|
|
0x2a80, /* X */
|
331 |
|
|
0x046e, /* Y */
|
332 |
|
|
0x2209, /* Z */
|
333 |
|
|
|
334 |
|
|
0x0039, /* [ */
|
335 |
|
|
0x0880, /* backslash */
|
336 |
|
|
0x000f, /* ] */
|
337 |
|
|
0x0001, /* ^ */
|
338 |
|
|
0x0008, /* _ */
|
339 |
|
|
0x0100, /* ` */
|
340 |
|
|
|
341 |
|
|
0x1058, /* a */
|
342 |
|
|
0x047c, /* b */
|
343 |
|
|
0x0058, /* c */
|
344 |
|
|
0x045e, /* d */
|
345 |
|
|
0x2058, /* e */
|
346 |
|
|
0x0471, /* f */
|
347 |
|
|
0x0c0c, /* g */
|
348 |
|
|
0x0474, /* h */
|
349 |
|
|
0x0004, /* i */
|
350 |
|
|
0x000e, /* j */
|
351 |
|
|
0x0c70, /* k */
|
352 |
|
|
0x0038, /* l */
|
353 |
|
|
0x1454, /* m */
|
354 |
|
|
0x0454, /* n */
|
355 |
|
|
0x045c, /* o */
|
356 |
|
|
0x0473, /* p */
|
357 |
|
|
0x0467, /* q */
|
358 |
|
|
0x0450, /* r */
|
359 |
|
|
0x0c08, /* s */
|
360 |
|
|
0x0078, /* t */
|
361 |
|
|
0x001c, /* u */
|
362 |
|
|
0x2010, /* v */
|
363 |
|
|
0x2814, /* w */
|
364 |
|
|
0x2a80, /* x */
|
365 |
|
|
0x080c, /* y */
|
366 |
|
|
0x2048, /* z */
|
367 |
|
|
|
368 |
|
|
0x0000,
|
369 |
|
|
};
|
370 |
|
|
|
371 |
|
|
/**************************************************************************//**
|
372 |
|
|
* @brief
|
373 |
|
|
* Defines higlighted segments for the numeric display
|
374 |
|
|
*****************************************************************************/
|
375 |
|
|
uint16_t EM_Numbers[] =
|
376 |
|
|
{
|
377 |
|
|
0x003f, /* 0 */
|
378 |
|
|
0x0006, /* 1 */
|
379 |
|
|
0x005b, /* 2 */
|
380 |
|
|
0x004f, /* 3 */
|
381 |
|
|
0x0066, /* 4 */
|
382 |
|
|
0x006d, /* 5 */
|
383 |
|
|
0x007d, /* 6 */
|
384 |
|
|
0x0007, /* 7 */
|
385 |
|
|
0x007f, /* 8 */
|
386 |
|
|
0x006f, /* 9 */
|
387 |
|
|
0x0040, /* - */
|
388 |
|
|
};
|
389 |
|
|
|
390 |
|
|
#endif
|
391 |
|
|
|