Project 2  8×8 Dot-Matrix Display
Neff Site
max7219.h
Go to the documentation of this file.
1 
16 #ifndef MAX7219_H_
17 #define MAX7219_H_
18 
19 #include "spi.h"
20 
21 /**** Pin description *****/
22 
23 #define MAX7219_PORT SPI_PORT
24 #define MAX7219_MODULE SPI_MODULE
25 
26 /* Serial-Data Input */
27 #define MAX7219_DIN_bp SPI_MOSI_bp
28 #define MAX7219_DIN_bm SPI_MOSI_bm
29 
30 /* Serial-Data Output */
31 #define MAX7219_DOUT_bp SPI_MISO_bp
32 #define MAX7219_DOUT_bm SPI_MISO_bm
33 
34 /* Serial-Clock Input */
35 #define MAX7219_CLK_bp SPI_SCK_bp
36 #define MAX7219_CLK_bm SPI_SCK_bm
37 
38 /* Chip-Select Input */
39 #define MAX7219_CS_bp SPI_SS_bp
40 #define MAX7219_CS_bm SPI_SS_bm
41 
42 
43 /**** Register address *****/
44 
45 #define MAX7219_NO_OP 0x00
46 #define MAX7219_DECODE_MODE 0x09
47 #define MAX7219_INTENSITY 0x0A
48 #define MAX7219_SCAN_LIMIT 0x0B
49 
50 /* Shutdown Register Address and Format */
51 #define MAX7219_SHUTDOWN 0x0C
52 #define MAX7219_SHUTDOWN_ON 0x00
53 #define MAX7219_SHUTDOWN_OFF 0x01
54 
55 /* Display-Test Register Address and Format */
56 #define MAX7219_DISPLAY_TEST 0x0F
57 #define MAX7219_DISPLAY_TEST_ON 0x01
58 #define MAX7219_DISPLAY_TEST_OFF 0x0
59 
60 #endif /* MAX7219_H_ */
Header file for the SPI interface.
Contact