diff options
author | David Lamparter <equinox@diac24.net> | 2012-04-01 00:20:25 +0200 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-04-01 00:20:25 +0200 |
commit | 75a61c57fb0402f777bfa828dd71818a97ed54a4 (patch) | |
tree | daa218546b1b744a28cbed9c05e8e405af2caf38 /max7219.h | |
parent | 6061b632e87645e79c17b7de8a927836300afb4f (diff) |
original dcf77 C code
Diffstat (limited to 'max7219.h')
-rw-r--r-- | max7219.h | 51 |
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[];
|