Project 4  Seven-Segment Display with I2C interface
Neff Site
ht16k33.h
Go to the documentation of this file.
1 
18 #ifndef HT16K33_H_
19 #define HT16K33_H_
20 
21 // Display data address pointer
22 #define HT16K33_DRAM_SIZE 16
23 #define HT16K33_SET_DRAM_ADDR 0x00
24 #define HT16K33_DRAM_ADDR(ADDR) ((ADDR) & 0x0F)
25 
26 // System setup
27 #define HT16K33_SYSTEM_SETUP 0x20
28 #define HT16K33_OSCILLATOR_ON 0x01
29 #define HT16K33_OSCILLATOR_OFF 0x00
30 
31 // Key data address pointer
32 #define HT16K33_READ_KEY_ADDR 0x40
33 
34 // INT flag address pointer
35 #define HT16K33_READ_FLAG_ADDR 0x60
36 
37 // Display setup
38 #define HT16K33_DISPLAY_SETUP 0x80
39 #define HT16K33_BLINK_OFF 0x00
40 #define HT16K33_BLINK_FAST 0x02
41 #define HT16K33_BLINK_MED 0x04
42 #define HT16K33_BLINK_SLOW 0x06
43 #define HT16K33_DISPLAY_OFF 0x00
44 #define HT16K33_DISPLAY_ON 0x01
45 
46 // ROW/INT set
47 #define HT16K33_ROWINT_SET 0xA0
48 #define HT16K33_SET_ROW 0x00
49 #define HT16K33_SET_INT_ACTIVE_LOW 0x1
50 #define HT16K33_SET_INT_ACTIVE_HIW 0x3
51 
52 // Dimming set
53 #define HT16K33_SET_DIMMING 0xE0
54 #define HT16K33_DUTY16(DUTY) (((DUTY)-1) & 0x0F)
55 
56 #endif /* HT16K33_H_ */
Contact