29 lines
762 B
C
29 lines
762 B
C
|
|
#ifndef _IC74HC595_H_
|
||
|
|
#define _IC74HC595_H_
|
||
|
|
|
||
|
|
// We save 4 pins by updating all 3 shift registers at once
|
||
|
|
// with one clock and one update signal. Each shift register
|
||
|
|
// only needs its own data line.
|
||
|
|
#define PIN_74HC595_SCOREBOARD_CLOCK 11
|
||
|
|
#define PIN_74HC595_MATRIX_CLOCK 12
|
||
|
|
|
||
|
|
#define PIN_74HC595_MATRIX_UPDATE 8
|
||
|
|
#define PIN_74HC595_SCOREBOARD_UPDATE 17
|
||
|
|
|
||
|
|
#define PIN_74HC595_MATRIX_DATA 18
|
||
|
|
#define PIN_74HC595_SCOREBOARD_DATA 14
|
||
|
|
|
||
|
|
typedef struct IC74HC595 {
|
||
|
|
uint8_t updatepin;
|
||
|
|
uint8_t datapin;
|
||
|
|
uint8_t clockpin;
|
||
|
|
} IC74HC595;
|
||
|
|
|
||
|
|
extern IC74HC595 matrixcols;
|
||
|
|
extern IC74HC595 scoreboard;
|
||
|
|
|
||
|
|
int init74HC595(IC74HC595 *sr);
|
||
|
|
int writeIC74HC595Char(IC74HC595 *sr, uint8_t value, uint8_t order);
|
||
|
|
|
||
|
|
#endif // _IC74HC595_H_
|