Driver to control a peripheral circuit being controlled by the operation of a FET. Inbetween the mbed and FET is a single D type latch, used to latch a signal to the driver.
Diff: Latch_FET_Driver.cpp
- Revision:
- 2:9059b675917e
- Parent:
- 1:a0209f182a64
- Child:
- 3:7fcd006e1bc6
--- a/Latch_FET_Driver.cpp Thu Feb 04 14:08:29 2016 +0000 +++ b/Latch_FET_Driver.cpp Sun Feb 07 18:20:55 2016 +0000 @@ -5,12 +5,39 @@ { SetPin = new DigitalOut(set); ResetPin = new DigitalOut(reset); + // Ensure that SR latch does not enter unknown state + Latch_FET_Driver::initialState(); +} + +void Latch_FET_Driver::initialState() +{ + SetPin -> write(LOW); + ResetPin ->write(HIGH); +} + +void Latch_FET_Driver::outputHigh() +{ + ResetPin -> write(LOW); + SetPin -> write(HIGH); } -int Latch_FET_Driver::setOutput() +void Latch_FET_Driver::outputLow() { - ResetPin = LOW; - - return 0; + SetPin -> write(LOW); + ResetPin -> write(HIGH); + } + +//int Latch_FET_Driver::setOutput() +//{ +// ResetPin = LOW; +// +// return 0; +//} +// +//int Latch_FET_Driver::resetOutput() +//{ +// +//} +