Browse Source

remove ReadPort::getColPins() and StrobePort::setActivePinHigh() setActivePinLow()

tags/v0.5.0
wolfv6 7 years ago
parent
commit
f76ec3002d
6 changed files with 4 additions and 52 deletions
  1. 0
    7
      src/ReadPort.cpp
  2. 0
    1
      src/ReadPort.h
  3. 0
    16
      src/Scanner_Port.cpp
  4. 0
    2
      src/StrobePort.h
  5. 4
    24
      src/StrobePort_PCA9655E.cpp
  6. 0
    2
      src/StrobePort_PCA9655E.h

+ 0
- 7
src/ReadPort.cpp View File

@@ -1,7 +0,0 @@
#include "ReadPort.h"
uint8_t ReadPort::getColPins()
{
return readPins;
}

+ 0
- 1
src/ReadPort.h View File

@@ -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

+ 0
- 16
src/Scanner_Port.cpp View File

@@ -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;

+ 0
- 2
src/StrobePort.h View File

@@ -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

+ 4
- 24
src/StrobePort_PCA9655E.cpp View File

@@ -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);

+ 0
- 2
src/StrobePort_PCA9655E.h View File

@@ -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