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.

Latch_FET_Driver.cpp

Committer:
sk398
Date:
2016-02-07
Revision:
2:9059b675917e
Parent:
1:a0209f182a64
Child:
3:7fcd006e1bc6

File content as of revision 2:9059b675917e:

#include "mbed.h"
#include "Latch_FET_Driver.h"

Latch_FET_Driver::Latch_FET_Driver(PinName set,PinName reset)
{
    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); 
}

void Latch_FET_Driver::outputLow()
{
       SetPin -> write(LOW); 
       ResetPin -> write(HIGH);

}


//int Latch_FET_Driver::setOutput()
//{
//    ResetPin = LOW;
//    
//    return 0;
//}
// 
//int Latch_FET_Driver::resetOutput()
//{
//    
//}