ShiftReg library (74HC595, NUJ3711)
ShiftReg.h@0:5f1670338bef, 2015-10-24 (annotated)
- Committer:
- kysiki
- Date:
- Sat Oct 24 16:30:11 2015 +0000
- Revision:
- 0:5f1670338bef
- Child:
- 1:3741bc0fbba8
first commit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kysiki | 0:5f1670338bef | 1 | #ifndef MBED_SHIFTREG_H |
kysiki | 0:5f1670338bef | 2 | #define MBED_SHIFTREG_H |
kysiki | 0:5f1670338bef | 3 | #define HC595 |
kysiki | 0:5f1670338bef | 4 | //#define NJU3711 |
kysiki | 0:5f1670338bef | 5 | #include "mbed.h" |
kysiki | 0:5f1670338bef | 6 | |
kysiki | 0:5f1670338bef | 7 | class ShiftReg { |
kysiki | 0:5f1670338bef | 8 | public: |
kysiki | 0:5f1670338bef | 9 | ShiftReg(PinName dataPin, PinName stbPin, PinName clkPin, PinName clrPin); |
kysiki | 0:5f1670338bef | 10 | void send_data(uint8_t data); |
kysiki | 0:5f1670338bef | 11 | |
kysiki | 0:5f1670338bef | 12 | private: |
kysiki | 0:5f1670338bef | 13 | DigitalOut DATA; |
kysiki | 0:5f1670338bef | 14 | DigitalOut STB; |
kysiki | 0:5f1670338bef | 15 | DigitalOut CLK; |
kysiki | 0:5f1670338bef | 16 | DigitalOut CLR; |
kysiki | 0:5f1670338bef | 17 | void shiftOut(uint8_t data); |
kysiki | 0:5f1670338bef | 18 | }; |
kysiki | 0:5f1670338bef | 19 | |
kysiki | 0:5f1670338bef | 20 | #endif |