@@ -1,7 +0,0 @@ | |||
#include "ReadPort.h" | |||
uint8_t ReadPort::getColPins() | |||
{ | |||
return readPins; | |||
} | |||
@@ -17,6 +17,5 @@ class ReadPort | |||
//read port and store it's pins values in portState | |||
virtual uint8_t read()=0; | |||
uint8_t getColPins(); | |||
}; | |||
#endif |
@@ -6,14 +6,6 @@ uint8_t Scanner_Port::scan() | |||
{ | |||
uint8_t readState; | |||
/*if (STROBE_ON == LOW) //if activeLow | |||
{ | |||
refStrobePort.setActivePinLow(strobePin); | |||
} | |||
else //if activeHigh | |||
{ | |||
refStrobePort.setActivePinHigh(strobePin); | |||
}*/ | |||
//strobe row on | |||
refStrobePort.write(STROBE_PIN, STROBE_ON); | |||
delayMicroseconds(3); //time to stablize voltage | |||
@@ -23,14 +15,6 @@ uint8_t Scanner_Port::scan() | |||
//strobe row off | |||
refStrobePort.write(STROBE_PIN, STROBE_OFF); | |||
/*if (STROBE_ON == LOW) //if activeLow | |||
{ | |||
refStrobePort.setActivePinHigh(strobePin); | |||
} | |||
else //if activeHigh | |||
{ | |||
refStrobePort.setActivePinLow(strobePin); | |||
}*/ | |||
//return refReadPort.getPortState(); | |||
return readState; |
@@ -10,8 +10,6 @@ Port classes are the keybrd library's interface to microcontoller ports or I/O e | |||
class StrobePort | |||
{ | |||
public: | |||
virtual void setActivePinHigh(const uint8_t activePin)=0; | |||
virtual void setActivePinLow(const uint8_t activePin)=0; | |||
virtual void write(const uint8_t pin, const bool level)=0; | |||
}; | |||
#endif |
@@ -15,38 +15,18 @@ void StrobePort_PCA9655E::begin() | |||
} | |||
/* | |||
sets activePin pin output to low, does not reset the other pins because they might be used by LEDs. | |||
activePin is port mask, where active pin is 1. | |||
pin is bitwise, where pin being strobed is 1. | |||
level is HIGH or LOW. | |||
*/ | |||
void StrobePort_PCA9655E::setActivePinLow(const uint8_t activePin) | |||
{ | |||
Wire.beginTransmission(port.ADDR); | |||
Wire.write(outputByteCommand); | |||
Wire.write(port.outputVal &= ~activePin); | |||
Wire.endTransmission(); | |||
} | |||
/* | |||
sets activePin pin output to high. | |||
activePin is port mask, where active pin is 1. | |||
*/ | |||
void StrobePort_PCA9655E::setActivePinHigh(const uint8_t activePin) | |||
{ | |||
Wire.beginTransmission(port.ADDR); | |||
Wire.write(outputByteCommand); | |||
Wire.write(port.outputVal |= activePin); | |||
Wire.endTransmission(); | |||
//todo delayMicroseconds(1500); still 4*bb w/o debouncer prints IOE rows sporadically | |||
} | |||
void StrobePort_PCA9655E::write(const uint8_t pin, const bool level) | |||
{ | |||
if (level == LOW) | |||
{ | |||
port.outputVal &= ~pin; | |||
port.outputVal &= ~pin; //set pin output to low, do not reset the other pins because LEDs | |||
} | |||
else | |||
{ | |||
port.outputVal |= pin; | |||
port.outputVal |= pin; //set pin output to high | |||
} | |||
Wire.beginTransmission(port.ADDR); |
@@ -44,8 +44,6 @@ class StrobePort_PCA9655E : public StrobePort | |||
StrobePort_PCA9655E(IOEPort& port); | |||
void begin(); | |||
virtual void setActivePinLow(const uint8_t activePin); //activePin is a port mask todo delete | |||
virtual void setActivePinHigh(const uint8_t activePin); //todo delete also in StrobePort.h | |||
virtual void write(const uint8_t pin, const bool level); | |||
}; | |||
#endif |