Tamas Titusz Ban
/
ELEC1620_ExamTemplate_2019
Template for the ELEC1620 End of year exam
ShiftReg/ShiftReg.h@0:54721f063ac8, 2019-03-22 (annotated)
- Committer:
- el16ttb
- Date:
- Fri Mar 22 13:11:07 2019 +0000
- Revision:
- 0:54721f063ac8
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el16ttb | 0:54721f063ac8 | 1 | #ifndef SHIFTREG_H |
el16ttb | 0:54721f063ac8 | 2 | #define SHIFTREG_H |
el16ttb | 0:54721f063ac8 | 3 | |
el16ttb | 0:54721f063ac8 | 4 | #include <mbed.h> |
el16ttb | 0:54721f063ac8 | 5 | |
el16ttb | 0:54721f063ac8 | 6 | /** A simple serial driver for a shift register that uses only three digital out pins. |
el16ttb | 0:54721f063ac8 | 7 | * Based on a fork of Ollie8/ShiftOut |
el16ttb | 0:54721f063ac8 | 8 | */ |
el16ttb | 0:54721f063ac8 | 9 | class ShiftReg { |
el16ttb | 0:54721f063ac8 | 10 | |
el16ttb | 0:54721f063ac8 | 11 | public : |
el16ttb | 0:54721f063ac8 | 12 | |
el16ttb | 0:54721f063ac8 | 13 | ShiftReg(); |
el16ttb | 0:54721f063ac8 | 14 | ~ShiftReg(); |
el16ttb | 0:54721f063ac8 | 15 | void write(int data); |
el16ttb | 0:54721f063ac8 | 16 | |
el16ttb | 0:54721f063ac8 | 17 | private : |
el16ttb | 0:54721f063ac8 | 18 | DigitalOut *clkout; |
el16ttb | 0:54721f063ac8 | 19 | DigitalOut *dataout; |
el16ttb | 0:54721f063ac8 | 20 | DigitalOut *latchout; |
el16ttb | 0:54721f063ac8 | 21 | }; |
el16ttb | 0:54721f063ac8 | 22 | |
el16ttb | 0:54721f063ac8 | 23 | #endif |
el16ttb | 0:54721f063ac8 | 24 |