summaryrefslogtreecommitdiff
path: root/components/slcd/s7leklcd
diff options
context:
space:
mode:
Diffstat (limited to 'components/slcd/s7leklcd')
-rw-r--r--components/slcd/s7leklcd/s7leklcd.c271
-rw-r--r--components/slcd/s7leklcd/s7leklcd.dir40
-rw-r--r--components/slcd/s7leklcd/s7leklcd.h321
3 files changed, 632 insertions, 0 deletions
diff --git a/components/slcd/s7leklcd/s7leklcd.c b/components/slcd/s7leklcd/s7leklcd.c
new file mode 100644
index 0000000..aa3c894
--- /dev/null
+++ b/components/slcd/s7leklcd/s7leklcd.c
@@ -0,0 +1,271 @@
+/* ----------------------------------------------------------------------------
+ * ATMEL Microcontroller Software Support
+ * ----------------------------------------------------------------------------
+ * Copyright (c) 2008, Atmel Corporation
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the disclaimer below.
+ *
+ * Atmel's name may not be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ----------------------------------------------------------------------------
+ */
+
+//------------------------------------------------------------------------------
+// Headers
+//------------------------------------------------------------------------------
+
+#include "s7leklcd.h"
+#include <board.h>
+#include <utility/assert.h>
+
+//------------------------------------------------------------------------------
+// Local variables
+//------------------------------------------------------------------------------
+
+/// List of the 26 SLCD upper chars ( A ~ Z )
+static const unsigned short pLcdUpperChars[26] = {
+ S7LEKLCD_A, S7LEKLCD_B, S7LEKLCD_C, S7LEKLCD_D,
+ S7LEKLCD_E, S7LEKLCD_F, S7LEKLCD_G, S7LEKLCD_H,
+ S7LEKLCD_I, S7LEKLCD_J, S7LEKLCD_K, S7LEKLCD_L,
+ S7LEKLCD_M, S7LEKLCD_N, S7LEKLCD_O, S7LEKLCD_P,
+ S7LEKLCD_Q, S7LEKLCD_R, S7LEKLCD_S, S7LEKLCD_T,
+ S7LEKLCD_U, S7LEKLCD_V, S7LEKLCD_W, S7LEKLCD_X,
+ S7LEKLCD_Y, S7LEKLCD_Z
+};
+
+/// List of the 26 SLCD lower chars ( a ~ z )
+static const unsigned short pLcdLowerChars[26] = {
+ S7LEKLCD_a, S7LEKLCD_b, S7LEKLCD_c, S7LEKLCD_d,
+ S7LEKLCD_e, S7LEKLCD_f, S7LEKLCD_g, S7LEKLCD_h,
+ S7LEKLCD_i, S7LEKLCD_j, S7LEKLCD_k, S7LEKLCD_l,
+ S7LEKLCD_m, S7LEKLCD_n, S7LEKLCD_o, S7LEKLCD_p,
+ S7LEKLCD_q, S7LEKLCD_r, S7LEKLCD_s, S7LEKLCD_t,
+ S7LEKLCD_u, S7LEKLCD_v, S7LEKLCD_w, S7LEKLCD_x,
+ S7LEKLCD_y, S7LEKLCD_z
+};
+
+/// List of the 10 SLCD numbers ( 0 ~ 9 )
+static const unsigned short pLcdNumbers[10] = {
+ S7LEKLCD_0, S7LEKLCD_1, S7LEKLCD_2, S7LEKLCD_3,
+ S7LEKLCD_4, S7LEKLCD_5, S7LEKLCD_6, S7LEKLCD_7,
+ S7LEKLCD_8, S7LEKLCD_9
+};
+
+//------------------------------------------------------------------------------
+// Local functions
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+/// Returns the LCD character code to display given an input character.
+/// \param c Character to display.
+/// \param dot Indicates if the character should be dotted or not.
+//------------------------------------------------------------------------------
+static unsigned short GetSLcdChar(unsigned char c, unsigned char dot)
+{
+ unsigned short symbol = 0;
+
+ // Add dot if needed
+ if (dot) {
+
+ symbol = S7LEKLCD_DOT;
+ }
+
+ // Find corresponding symbol for character
+ // Space
+ if (c == ' ') {
+
+ symbol |= S7LEKLCD_NONE;
+ }
+ // Single dot
+ else if (c == '.') {
+
+ symbol |= S7LEKLCD_NONE | S7LEKLCD_DOT;
+ }
+ // Number
+ else if ((c >= '0') && (c <= '9')) {
+
+ symbol |= pLcdNumbers[c - '0'];
+ }
+ // Lower-case letter
+ else if ((c >= 'a') && (c <= 'z')) {
+
+ symbol |= pLcdLowerChars[c - 'a'];
+ }
+ // Upper case letter
+ else if ((c >= 'A') && (c <= 'Z')) {
+
+ symbol |= pLcdUpperChars[c - 'A'];
+ }
+ // Special characters
+ else {
+ switch (c) {
+ case '+': symbol |= S7LEKLCD_PLUS; break;
+ case '-': symbol |= S7LEKLCD_MINUS; break;
+ case '=': symbol |= S7LEKLCD_EQUAL; break;
+ case '>': symbol |= S7LEKLCD_LARGE; break;
+ case '<': symbol |= S7LEKLCD_LESS; break;
+ case '\\': symbol |= S7LEKLCD_SLASH; break;
+ case '/': symbol |= S7LEKLCD_BACKSLASH; break;
+ case '$': symbol |= S7LEKLCD_DOLLAR; break;
+ case '|': symbol |= S7LEKLCD_OR; break;
+ case ',': symbol |= S7LEKLCD_COMMA; break;
+ case '\'': symbol |= S7LEKLCD_INVCOMMA1; break;
+ case '"': symbol |= S7LEKLCD_INVCOMMA2; break;
+ case '_': symbol |= D; break;
+ default: symbol = S7LEKLCD_NONE;
+ }
+ }
+
+ return symbol;
+}
+
+//------------------------------------------------------------------------------
+// Global functions
+//------------------------------------------------------------------------------
+
+//------------------------------------------------------------------------------
+/// Switches a symbol of the LCD on or off.
+/// \param symbol Symbol Index in the LCD buffer matrix.
+/// \param set If 1, the symbol is turned on; otherwise it is turned off.
+//------------------------------------------------------------------------------
+void S7LEKLCD_Symbol(unsigned short symbol, unsigned char set)
+{
+ unsigned int common = symbol / 40;
+ unsigned int reg = (symbol % 40) / 32;
+ unsigned int bit = (symbol % 40) % 32;
+
+ if (set) {
+
+ AT91C_BASE_SLCDC->SLCDC_MEM[common * 2 + reg] |= 1 << bit;
+ }
+ else {
+
+ AT91C_BASE_SLCDC->SLCDC_MEM[common * 2 + reg] &= ~(1 << bit);
+ }
+}
+
+//------------------------------------------------------------------------------
+/// Switches a pixel of the matrix on or off.
+/// \param x Horizontal pixel coordinate.
+/// \param y Vertical pixel coordinate.
+/// \param set If true, the pixel is switched on; otherwise it is switched off.
+//------------------------------------------------------------------------------
+void S7LEKLCD_Pixel(unsigned char x, unsigned char y, unsigned char set)
+{
+ SANITY_CHECK(x < 12);
+ SANITY_CHECK(y < 10);
+
+ S7LEKLCD_Symbol((x + 1) + (40 * (9 - y)), set);
+}
+
+//------------------------------------------------------------------------------
+/// Displays a character at the given position on the LCD.
+/// \param c Character definition.
+/// \param index Position of the character on the LCD ([0...11]).
+//------------------------------------------------------------------------------
+void S7LEKLCD_Char(unsigned short c, unsigned char index)
+{
+ SANITY_CHECK(index < 12);
+
+ S7LEKLCD_Symbol((40 * 2) + 37 - index * 2 , (c & A) != 0);
+ S7LEKLCD_Symbol((40 * 4) + 37 - index * 2 , (c & B) != 0);
+ S7LEKLCD_Symbol((40 * 6) + 37 - index * 2 , (c & C) != 0);
+ S7LEKLCD_Symbol((40 * 8) + 38 - index * 2 , (c & D) != 0);
+ S7LEKLCD_Symbol((40 * 6) + 38 - index * 2 , (c & E) != 0);
+ S7LEKLCD_Symbol((40 * 4) + 38 - index * 2 , (c & F) != 0);
+ S7LEKLCD_Symbol((40 * 5) + 38 - index * 2 , (c & G) != 0);
+ S7LEKLCD_Symbol((40 * 5) + 37 - index * 2 , (c & H) != 0);
+ S7LEKLCD_Symbol((40 * 3) + 38 - index * 2 , (c & I) != 0);
+ S7LEKLCD_Symbol((40 * 2) + 38 - index * 2 , (c & J) != 0);
+ S7LEKLCD_Symbol((40 * 3) + 37 - index * 2 , (c & K) != 0);
+ S7LEKLCD_Symbol((40 * 7) + 38 - index * 2 , (c & L) != 0);
+ S7LEKLCD_Symbol((40 * 8) + 37 - index * 2 , (c & M) != 0);
+ S7LEKLCD_Symbol((40 * 7) + 37 - index * 2 , (c & N) != 0);
+ S7LEKLCD_Symbol((40 * 9) + 37 - index * 2 , (c & P) != 0);
+}
+
+//------------------------------------------------------------------------------
+/// Displays a clock number at the given position.
+/// \param c Number definition.
+/// \param index Position of the character to be displayed ([0..3]).
+//------------------------------------------------------------------------------
+void S7LEKLCD_ClockNumber(unsigned short c, unsigned char index)
+{
+ SANITY_CHECK(index < 4);
+
+ S7LEKLCD_Symbol((40 * 0) + 30 - index * 4 , (c & A) != 0);
+ S7LEKLCD_Symbol((40 * 0) + 29 - index * 4 , (c & B) != 0);
+ S7LEKLCD_Symbol((40 * 0) + 27 - index * 4 , (c & C) != 0);
+ S7LEKLCD_Symbol((40 * 1) + 27 - index * 4 , (c & D) != 0);
+ S7LEKLCD_Symbol((40 * 1) + 28 - index * 4 , (c & E) != 0);
+ S7LEKLCD_Symbol((40 * 1) + 29 - index * 4 , (c & F) != 0);
+ S7LEKLCD_Symbol((40 * 0) + 28 - index * 4 , (c & G) != 0);
+}
+
+//------------------------------------------------------------------------------
+/// Displays a string on the SLCD starting at the specified character index.
+/// \param pString String to display.
+/// \param index Starting index of string.
+//------------------------------------------------------------------------------
+void S7LEKLCD_PutString(const char *pString, unsigned char index)
+{
+ unsigned char i;
+ unsigned char j;
+ unsigned char dot;
+
+ // Clear characters before index
+ for (i=0; i < index; i++) {
+
+ S7LEKLCD_Char(S7LEKLCD_NONE, i);
+ }
+
+ // Display string
+ j = 0;
+ dot = 0;
+ while ((i < S7LEKLCD_MAX_CHARS) && (pString[j] != 0)) {
+
+ // Check if next character is a dot
+ if (pString[j+1] == '.') {
+
+ dot = 1;
+ }
+
+ // Skip dots
+ if (pString[j] == '.') {
+
+ j++;
+ }
+ // Display character
+ else {
+
+ S7LEKLCD_Char(GetSLcdChar(pString[j], dot), i);
+ dot = 0;
+ i++;
+ j++;
+ }
+ }
+
+ // Clear characters at end of string
+ for (; i < S7LEKLCD_MAX_CHARS; i++) {
+
+ S7LEKLCD_Char(S7LEKLCD_NONE, i);
+ }
+}
+
diff --git a/components/slcd/s7leklcd/s7leklcd.dir b/components/slcd/s7leklcd/s7leklcd.dir
new file mode 100644
index 0000000..0b88b5d
--- /dev/null
+++ b/components/slcd/s7leklcd/s7leklcd.dir
@@ -0,0 +1,40 @@
+/* ----------------------------------------------------------------------------
+ * ATMEL Microcontroller Software Support
+ * ----------------------------------------------------------------------------
+ * Copyright (c) 2008, Atmel Corporation
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the disclaimer below.
+ *
+ * Atmel's name may not be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ----------------------------------------------------------------------------
+ */
+
+//------------------------------------------------------------------------------
+/// \dir
+///
+/// !!!Purpose
+///
+/// This directory contains APIs for segment LCD display of AT91SAM7L-EK board.
+///
+/// !!!Contents
+///
+/// Contains code for display symbol, pixel of the matrix, char, clock number and string.
+//------------------------------------------------------------------------------ \ No newline at end of file
diff --git a/components/slcd/s7leklcd/s7leklcd.h b/components/slcd/s7leklcd/s7leklcd.h
new file mode 100644
index 0000000..336ee47
--- /dev/null
+++ b/components/slcd/s7leklcd/s7leklcd.h
@@ -0,0 +1,321 @@
+/* ----------------------------------------------------------------------------
+ * ATMEL Microcontroller Software Support
+ * ----------------------------------------------------------------------------
+ * Copyright (c) 2008, Atmel Corporation
+ *
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * - Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the disclaimer below.
+ *
+ * Atmel's name may not be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
+ * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ * ----------------------------------------------------------------------------
+ */
+
+//------------------------------------------------------------------------------
+/// \unit
+///
+/// !!!Purpose
+///
+/// Interface for displaying on segment LCD of AT91SAM7L-EK board..
+///
+/// !!!Usage
+///
+/// -# call corresponding function to display symbol, pixel of the matrix, char,
+/// clock number and string.
+//------------------------------------------------------------------------------
+
+#ifndef _S7LEKLCD_H
+#define _S7LEKLCD_H
+
+//------------------------------------------------------------------------------
+// Global Constants
+//------------------------------------------------------------------------------
+
+/// Maximum number of characters that can be displayed on the LCD.
+#define S7LEKLCD_MAX_CHARS 12
+
+//------------------------------------------------------------------------------
+/// \page "SAM7L-EK SLCD Segments"
+/// This page lists the segment constants used to describe letters on the
+/// SAM7L-EK segment LCD display.
+///
+/// !Constants
+/// - A
+/// - B
+/// - C
+/// - D
+/// - E
+/// - F
+/// - G
+/// - H
+/// - I
+/// - J
+/// - K
+/// - L
+/// - M
+/// - N
+/// - P
+
+/// A segment definition.
+#define A (1 << 0)
+/// B segment definition.
+#define B (1 << 1)
+/// C segment definition.
+#define C (1 << 2)
+/// D segment definition.
+#define D (1 << 3)
+/// E segment definition.
+#define E (1 << 4)
+/// F segment definition.
+#define F (1 << 5)
+/// G segment definition.
+#define G (1 << 6)
+/// H segment definition.
+#define H (1 << 7)
+/// I segment definition.
+#define I (1 << 8)
+/// J segment definition.
+#define J (1 << 9)
+/// K segment definition.
+#define K (1 << 10)
+/// L segment definition.
+#define L (1 << 11)
+/// M segment definition.
+#define M (1 << 12)
+/// N segment definition.
+#define N (1 << 13)
+/// P segment definition.
+#define P (1 << 14)
+//------------------------------------------------------------------------------
+
+/// Enables all the segments of one LCD slot.
+#define S7LEKLCD_ALL (A | B | C | D | E | F | G | H | I |J | K | L | M | N)
+/// Disables all the segments of one LCD slot.
+#define S7LEKLCD_NONE 0
+/// Dot definition.
+#define S7LEKLCD_DOT P
+
+// Upper-case letters.
+#define S7LEKLCD_A (A | B | C | E | F | G | H)
+#define S7LEKLCD_B (A | B | C | D | H | J | M)
+#define S7LEKLCD_C (A | D | E | F)
+#define S7LEKLCD_D (A | B | C | D | J | M)
+#define S7LEKLCD_E (A | D | E | F | G | H)
+#define S7LEKLCD_F (A | E | F | G | H)
+#define S7LEKLCD_G (A | C | D | E | F | H)
+#define S7LEKLCD_H (B | C | E | F | G | H)
+#define S7LEKLCD_I (A | J | M | D)
+#define S7LEKLCD_J (B | C | D | E)
+#define S7LEKLCD_K (E | F | G | K | N)
+#define S7LEKLCD_L (D | E | F )
+#define S7LEKLCD_M (B | C | E | F | I | K )
+#define S7LEKLCD_N (B | C | E | F | I | N)
+#define S7LEKLCD_O (A | B | C | D | E | F)
+#define S7LEKLCD_P (A | B | E | F | G | H)
+#define S7LEKLCD_Q (A | B | C | D | E | F | N)
+#define S7LEKLCD_R (A | B | E | F | G | H | N)
+#define S7LEKLCD_S (A | C | D | F | G | H)
+#define S7LEKLCD_T (A | J | M )
+#define S7LEKLCD_U (B | C | D | E | F)
+#define S7LEKLCD_V (E | F | K | L)
+#define S7LEKLCD_W (B | C | E | F | J | L | N)
+#define S7LEKLCD_X (I | K | L | N)
+#define S7LEKLCD_Y (I | K | M)
+#define S7LEKLCD_Z (A | D | K | L)
+
+// Lower-case letters.
+#define S7LEKLCD_a (D | E | G | M)
+#define S7LEKLCD_b (E | F | G | L)
+#define S7LEKLCD_c (D | E | G )
+#define S7LEKLCD_d (B | C | H | N)
+#define S7LEKLCD_e (D | E | G | L)
+#define S7LEKLCD_f (A | E | F | G)
+#define S7LEKLCD_g (A | B | C | D | H | J)
+#define S7LEKLCD_h (E | F | G | M)
+#define S7LEKLCD_i (M)
+#define S7LEKLCD_j (J | L)
+#define S7LEKLCD_k (J | K | M | N)
+#define S7LEKLCD_l (J | M )
+#define S7LEKLCD_m (C | E | G | H | M)
+#define S7LEKLCD_n (C | E | G | H)
+#define S7LEKLCD_o (C | D | E | G | H)
+#define S7LEKLCD_p (A | E | F | G | K)
+#define S7LEKLCD_q (A | B | C | F | H | I)
+#define S7LEKLCD_r (J | K | M)
+#define S7LEKLCD_s (D | H | N)
+#define S7LEKLCD_t (G | H | J | N)
+#define S7LEKLCD_u (C | D | E)
+#define S7LEKLCD_v (E | H | L)
+#define S7LEKLCD_w (C | E | L | N)
+#define S7LEKLCD_x (I | J | L | N)
+#define S7LEKLCD_y (I | K | L)
+#define S7LEKLCD_z (D | G | L)
+
+// Numbers.
+#define S7LEKLCD_0 (A | B | C | D | E | F)
+#define S7LEKLCD_1 (J | M)
+#define S7LEKLCD_2 (A | B | D | E | G | H)
+#define S7LEKLCD_3 (A | B | C | D | G | H)
+#define S7LEKLCD_4 (F | G | H | J | M)
+#define S7LEKLCD_5 (A | C | D | F | G | H)
+#define S7LEKLCD_6 (A | C | D | E | F | G| H)
+#define S7LEKLCD_7 (A | B | C)
+#define S7LEKLCD_8 (A | B | C | D | E | F | G | H)
+#define S7LEKLCD_9 (A | B | C | D | F | G | H)
+
+// Clock numbers.
+#define S7LEKLCD_C0 (A | B | C | D | E | F)
+#define S7LEKLCD_C1 (B | C)
+#define S7LEKLCD_C2 (A | B | D | E | G )
+#define S7LEKLCD_C3 (A | B | C | D | G )
+#define S7LEKLCD_C4 (B | C | F | G)
+#define S7LEKLCD_C5 (A | C | D | F | G )
+#define S7LEKLCD_C6 (A | C | D | E | F | G)
+#define S7LEKLCD_C7 (A | B | C)
+#define S7LEKLCD_C8 (A | B | C | D | E | F | G )
+#define S7LEKLCD_C9 (A | B | C | D | F | G )
+
+// Symbols
+#define S7LEKLCD_PLUS (G | H | J | M)
+#define S7LEKLCD_MINUS (G | H)
+#define S7LEKLCD_LARGE (I | L)
+#define S7LEKLCD_LESS (K | N)
+#define S7LEKLCD_SLASH (K | L)
+#define S7LEKLCD_BACKSLASH (I | M)
+#define S7LEKLCD_DOLLAR (A | C | D | F | G | H | J | M)
+#define S7LEKLCD_OR (J | M)
+#define S7LEKLCD_COMMA L
+#define S7LEKLCD_UNDERSCORE D
+#define S7LEKLCD_INVCOMMA1 I
+#define S7LEKLCD_INVCOMMA2 K
+#define S7LEKLCD_EQUAL (D | G |H)
+#define S7LEKLCD_MULTIPLY (G | H | I | J | K | L | M | N)
+#define S7LEKLCD_AT (A | B | C | D | E | G |M)
+
+/// Symbols definitions
+/// Each symbol is defined by the bit offset in the 400 bits matrix
+#define S7LEKLCD_ARROW1 (40 * 0 )
+#define S7LEKLCD_ARROW2 (40 * 1 )
+#define S7LEKLCD_ARROW3 (40 * 2 )
+#define S7LEKLCD_Q2 (40 * 3 )
+#define S7LEKLCD_Q1 (40 * 4 )
+#define S7LEKLCD_Q0 (40 * 5 )
+#define S7LEKLCD_Q4 (40 * 6 )
+#define S7LEKLCD_Q3 (40 * 7 )
+#define S7LEKLCD_KEY (40 * 8 )
+#define S7LEKLCD_SOUND (40 * 9 )
+
+#define S7LEKLCD_S0 (40 * 1 + 39)
+#define S7LEKLCD_S1 (40 * 0 + 39)
+#define S7LEKLCD_S2 (40 * 1 + 39)
+#define S7LEKLCD_S3 (40 * 2 + 39)
+#define S7LEKLCD_S4 (40 * 3 + 39)
+#define S7LEKLCD_S5 (40 * 4 + 39)
+#define S7LEKLCD_S6 (40 * 5 + 39)
+#define S7LEKLCD_S7 (40 * 6 + 39)
+#define S7LEKLCD_S8 (40 * 7 + 39)
+#define S7LEKLCD_S9 (40 * 8 + 39)
+#define S7LEKLCD_S10 (40 * 9 + 39)
+#define S7LEKLCD_COLON (40 * 0 + 38)
+#define S7LEKLCD_LINE (40 * 1 + 38)
+#define S7LEKLCD_HEX (40 * 9 + 38)
+
+#define S7LEKLCD_ATMEL (40 * 0 + 37)
+
+#define S7LEKLCD_SNOW (40 * 0 + 36)
+#define S7LEKLCD_FIRE (40 * 1 + 36)
+
+#define S7LEKLCD_BIN (40 * 9 + 36)
+#define S7LEKLCD_DEC (40 * 9 + 34)
+#define S7LEKLCD_AUTO (40 * 9 + 32)
+#define S7LEKLCD_TIME (40 * 9 + 30)
+#define S7LEKLCD_DATE (40 * 9 + 26)
+#define S7LEKLCD_PROG (40 * 9 + 24)
+#define S7LEKLCD_SETUP (40 * 9 + 20)
+#define S7LEKLCD_2NDF (40 * 9 + 16)
+
+#define S7LEKLCD_1P (40 * 9 + 37)
+#define S7LEKLCD_2P (40 * 9 + 35)
+#define S7LEKLCD_3P (40 * 9 + 33)
+#define S7LEKLCD_4P (40 * 9 + 31)
+#define S7LEKLCD_5P (40 * 9 + 29)
+#define S7LEKLCD_6P (40 * 9 + 27)
+#define S7LEKLCD_7P (40 * 9 + 25)
+#define S7LEKLCD_8P (40 * 9 + 23)
+#define S7LEKLCD_9P (40 * 9 + 21)
+#define S7LEKLCD_10P (40 * 9 + 19)
+#define S7LEKLCD_11P (40 * 9 + 17)
+#define S7LEKLCD_12P (40 * 9 + 15)
+
+#define S7LEKLCD_V0 (40 * 0 + 35)
+#define S7LEKLCD_VOL (40 * 1 + 35)
+#define S7LEKLCD_V1 (40 * 0 + 34)
+#define S7LEKLCD_V2 (40 * 1 + 34)
+#define S7LEKLCD_V4 (40 * 0 + 33)
+#define S7LEKLCD_V3 (40 * 1 + 33)
+
+#define S7LEKLCD_CLOCK (40 * 0 + 32)
+#define S7LEKLCD_TOOL (40 * 1 + 32)
+
+#define S7LEKLCD_AM (40 * 0 + 31)
+#define S7LEKLCD_PM (40 * 1 + 31)
+
+#define S7LEKLCD_COL1 (40 * 9 + 28)
+#define S7LEKLCD_COL2 (40 * 9 + 22)
+#define S7LEKLCD_COL3 (40 * 9 + 18)
+#define S7LEKLCD_COL4 (40 * 1 + 30)
+
+#define S7LEKLCD_DMM (40 * 0 + 13)
+#define S7LEKLCD_TMP (40 * 1 + 13)
+#define S7LEKLCD_BARO (40 * 2 + 13)
+#define S7LEKLCD_HZ (40 * 3 + 13)
+#define S7LEKLCD_MHZ (40 * 4 + 13)
+#define S7LEKLCD_INHG (40 * 5 + 13)
+#define S7LEKLCD_KHZ (40 * 6 + 13)
+#define S7LEKLCD_HPA (40 * 7 + 13)
+#define S7LEKLCD_OHM (40 * 8 + 13)
+#define S7LEKLCD_SUN (40 * 9 + 13)
+
+#define S7LEKLCD_CALC (40 * 0 + 14)
+#define S7LEKLCD_FAHRENHEIT (40 * 1 + 14)
+#define S7LEKLCD_CELSIUS (40 * 2 + 14)
+#define S7LEKLCD_PENSENT (40 * 3 + 14)
+#define S7LEKLCD_AMPS (40 * 4 + 14)
+#define S7LEKLCD_VOLTS (40 * 5 + 14)
+#define S7LEKLCD_KWH (40 * 6 + 14)
+#define S7LEKLCD_FINE (40 * 7 + 14)
+#define S7LEKLCD_CLOUD (40 * 8 + 14)
+#define S7LEKLCD_RAIN (40 * 9 + 14)
+
+//------------------------------------------------------------------------------
+// Global functions
+//------------------------------------------------------------------------------
+
+extern void S7LEKLCD_Symbol(unsigned short symbol, unsigned char set);
+
+extern void S7LEKLCD_Pixel(unsigned char x, unsigned char y, unsigned char set);
+
+extern void S7LEKLCD_Char(unsigned short c, unsigned char index);
+
+extern void S7LEKLCD_ClockNumber(unsigned short c, unsigned char index);
+
+extern void S7LEKLCD_PutString(const char *pString, unsigned char index);
+
+#endif //#ifndef _S7LEKLCD_H
+
personal git repositories of Harald Welte. Your mileage may vary