summaryrefslogtreecommitdiff
path: root/max7219.h
diff options
context:
space:
mode:
Diffstat (limited to 'max7219.h')
-rw-r--r--max7219.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/max7219.h b/max7219.h
new file mode 100644
index 0000000..cfbb846
--- /dev/null
+++ b/max7219.h
@@ -0,0 +1,51 @@
+/************** Ansteuerung des 7-Segment-Treibers MAX7219 **************/
+
+#define BRIGHT 4 // 0 ... 15
+
+// Definitionen
+// 1. Display type
+#define COMMON_CATHODE
+//#define COMMON_ANODE // not implemented
+
+// 2. Pin-Deklaration
+//sbit DISCLK = 0x97; //BIT P1.7
+//sbit DISDAT = 0x95; //BIT P1.5
+//sbit DISSTB = 0x94; //BIT P1.4
+
+// 3. Segment-Order
+#define _A 0x01 // - A -
+#define _B 0x40 // | |
+#define _C 0x02 // F B
+#define _D 0x80 // | |
+#define _E 0x08 // - G -
+#define _F 0x04 // | |
+#define _G 0x10 // E C
+#define _DP 0x20 // | |
+ // - D - P
+#define DPBIT 7
+
+// 4. Digit-Order
+#define DIGITS 8, 128, 4, 16, 1, 32, 2, 64
+
+#define CHAR_SPACE 16
+#define CHAR_MINUS 17
+#define CHAR_GRAD 18
+#define CHAR_C2 19
+#define CHAR_R 20
+#define CHAR_O 21
+#define CHAR_H 22
+#define CHAR_L 23
+#define CHAR__ 24
+#define CHAR_S1 25 // upper "-"
+
+
+#define ATTRIB_DP 0x80 // decimal point attribute, must be ored
+#define ATTRIB_FLASH 0x40 // flash attribute, must be ored
+
+
+void display_init(void);
+void display_out(void);
+void display_clear(void);
+void display_off(void);
+
+extern u8 displaymem[];