summaryrefslogtreecommitdiff
path: root/max7219.h
blob: cfbb84639b576845e1dc5277ac353a128082bd24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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[];