diff --git a/src/LED_Port.cpp b/src/LED_Port.cpp index 75df535..7034927 100644 --- a/src/LED_Port.cpp +++ b/src/LED_Port.cpp @@ -2,10 +2,10 @@ void LED_Port::on() { - refPort.setHigh(pin); + refPort.writeHigh(pin); } void LED_Port::off() { - refPort.setLow(pin); + refPort.writeLow(pin); } diff --git a/src/PortInterface.h b/src/PortInterface.h index 8932e08..fdf6cf7 100644 --- a/src/PortInterface.h +++ b/src/PortInterface.h @@ -17,8 +17,8 @@ class PortInterface : public PortWriteInterface public: virtual void beginProtocol()=0; //SPI bus or I2C bus virtual void begin(const uint8_t activeState)=0; //configure GPIO pins - virtual void setLow(const uint8_t pin)=0; - virtual void setHigh(const uint8_t pin)=0; + virtual void writeLow(const uint8_t pin)=0; + virtual void writeHigh(const uint8_t pin)=0; virtual uint8_t read()=0; }; #endif diff --git a/src/PortWriteInterface.h b/src/PortWriteInterface.h index 0cd35c9..ff9cdbe 100644 --- a/src/PortWriteInterface.h +++ b/src/PortWriteInterface.h @@ -14,7 +14,7 @@ write() interface emulates Arduino's digitalWrite(). class PortWriteInterface { public: - virtual void setLow(const uint8_t pin)=0; - virtual void setHigh(const uint8_t pin)=0; + virtual void writeLow(const uint8_t pin)=0; + virtual void writeHigh(const uint8_t pin)=0; }; #endif diff --git a/src/Port_MCP23018.cpp b/src/Port_MCP23018.cpp index 08a017b..8a2a43c 100644 --- a/src/Port_MCP23018.cpp +++ b/src/Port_MCP23018.cpp @@ -39,10 +39,10 @@ void Port_MCP23018::begin(const uint8_t activeState) Wire.endTransmission(); } -/* setLow() sets pin output LOW. +/* writeLow() sets pin output LOW. pin is bit pattern, where pin being set is 1. */ -void Port_MCP23018::setLow(const uint8_t pin) +void Port_MCP23018::writeLow(const uint8_t pin) { outputVal &= ~pin; //set pin output to low @@ -52,10 +52,10 @@ void Port_MCP23018::setLow(const uint8_t pin) Wire.endTransmission(); } -/* setHigh() sets pin output HIGH. +/* writeHigh() sets pin output HIGH. pin is bit pattern, where pin being set is 1. */ -void Port_MCP23018::setHigh(const uint8_t pin) +void Port_MCP23018::writeHigh(const uint8_t pin) { outputVal |= pin; //set pin output to high diff --git a/src/Port_MCP23018.h b/src/Port_MCP23018.h index b756db5..279c588 100644 --- a/src/Port_MCP23018.h +++ b/src/Port_MCP23018.h @@ -42,8 +42,8 @@ class Port_MCP23018 : public PortInterface : deviceAddr(deviceAddr), portNum(portNum), outputVal(0), readPins(readPins) {} void beginProtocol(); void begin(const uint8_t activeState); - virtual void setLow(const uint8_t pin); - virtual void setHigh(const uint8_t pin); + virtual void writeLow(const uint8_t pin); + virtual void writeHigh(const uint8_t pin); virtual uint8_t read(); }; #endif diff --git a/src/Port_MCP23S17.cpp b/src/Port_MCP23S17.cpp index b1aa307..0a68660 100644 --- a/src/Port_MCP23S17.cpp +++ b/src/Port_MCP23S17.cpp @@ -52,19 +52,19 @@ void Port_MCP23S17::begin(const uint8_t activeState) transfer(deviceAddr << 1, portNum + 0x0C, pullUp); //configure GPPU } -/* setLow() sets pin output LOW. +/* writeLow() sets pin output LOW. pin is bit pattern, where pin being set is 1. */ -void Port_MCP23S17::setLow(const uint8_t pin) +void Port_MCP23S17::writeLow(const uint8_t pin) { outputVal &= ~pin; //set pin output to low transfer(deviceAddr << 1, portNum + 0x12, outputVal); //set GPIO port to outputVal } -/* setHigh() sets pin output HIGH. +/* writeHigh() sets pin output HIGH. pin is bit pattern, where pin being set is 1. */ -void Port_MCP23S17::setHigh(const uint8_t pin) +void Port_MCP23S17::writeHigh(const uint8_t pin) { outputVal |= pin; //set pin output to high transfer(deviceAddr << 1, portNum + 0x12, outputVal); //set GPIO port to outputVal diff --git a/src/Port_MCP23S17.h b/src/Port_MCP23S17.h index ed1e146..4130c17 100644 --- a/src/Port_MCP23S17.h +++ b/src/Port_MCP23S17.h @@ -46,8 +46,8 @@ class Port_MCP23S17 : public PortInterface : deviceAddr(deviceAddr), portNum(portNum), outputVal(0), readPins(readPins) {} void beginProtocol(); void begin(const uint8_t activeState); - virtual void setLow(const uint8_t pin); - virtual void setHigh(const uint8_t pin); + virtual void writeLow(const uint8_t pin); + virtual void writeHigh(const uint8_t pin); virtual uint8_t read(); }; #endif diff --git a/src/Port_PCA9655E.cpp b/src/Port_PCA9655E.cpp index 6df649b..fa79cc3 100644 --- a/src/Port_PCA9655E.cpp +++ b/src/Port_PCA9655E.cpp @@ -25,10 +25,10 @@ void Port_PCA9655E::begin(const uint8_t activeState) Wire.endTransmission(); } -/* setLow() sets pin output LOW. +/* writeLow() sets pin output LOW. pin is bit pattern, where pin being set is 1. */ -void Port_PCA9655E::setLow(const uint8_t pin) +void Port_PCA9655E::writeLow(const uint8_t pin) { outputVal &= ~pin; //set pin output to low @@ -38,10 +38,10 @@ void Port_PCA9655E::setLow(const uint8_t pin) Wire.endTransmission(); } -/* setHigh() sets pin output HIGH. +/* writeHigh() sets pin output HIGH. pin is bit pattern, where pin being set is 1. */ -void Port_PCA9655E::setHigh(const uint8_t pin) +void Port_PCA9655E::writeHigh(const uint8_t pin) { outputVal |= pin; //set pin output to high diff --git a/src/Port_PCA9655E.h b/src/Port_PCA9655E.h index 876a273..3630a55 100644 --- a/src/Port_PCA9655E.h +++ b/src/Port_PCA9655E.h @@ -46,8 +46,8 @@ class Port_PCA9655E : public PortInterface : deviceAddr(deviceAddr), portNum(portNum), outputVal(0), readPins(readPins) {} void beginProtocol(); void begin(const uint8_t activeState); - virtual void setLow(const uint8_t pin); - virtual void setHigh(const uint8_t pin); + virtual void writeLow(const uint8_t pin); + virtual void writeHigh(const uint8_t pin); virtual uint8_t read(); }; #endif diff --git a/src/Port_ShiftRegs.cpp b/src/Port_ShiftRegs.cpp index 3b438f3..03565f2 100644 --- a/src/Port_ShiftRegs.cpp +++ b/src/Port_ShiftRegs.cpp @@ -14,10 +14,10 @@ void Port_ShiftRegs::begin() SPI.begin(); } -/* setLow() sets pin output LOW. +/* writeLow() sets pin output LOW. pin is bit pattern, where pin being set is 1. */ -void Port_ShiftRegs::setLow(const uint8_t pin) +void Port_ShiftRegs::writeLow(const uint8_t pin) { outputVal &= ~pin; //set pin output to low @@ -26,10 +26,10 @@ void Port_ShiftRegs::setLow(const uint8_t pin) digitalWrite (slaveSelect, HIGH); } -/* setHigh() sets pin output HIGH. +/* writeHigh() sets pin output HIGH. pin is bit pattern, where pin being set is 1. */ -void Port_ShiftRegs::setHigh(const uint8_t pin) +void Port_ShiftRegs::writeHigh(const uint8_t pin) { outputVal |= pin; //set pin output to high diff --git a/src/Port_ShiftRegs.h b/src/Port_ShiftRegs.h index 00c3620..e464425 100644 --- a/src/Port_ShiftRegs.h +++ b/src/Port_ShiftRegs.h @@ -16,7 +16,7 @@ class Port_ShiftRegs : public PortWriteInterface public: Port_ShiftRegs(const uint8_t slaveSelect); void begin(); - void setLow(const uint8_t pin); - void setHigh(const uint8_t pin); + void writeLow(const uint8_t pin); + void writeHigh(const uint8_t pin); }; #endif diff --git a/src/Scanner_IOE.cpp b/src/Scanner_IOE.cpp index 40b037e..56a6b44 100644 --- a/src/Scanner_IOE.cpp +++ b/src/Scanner_IOE.cpp @@ -28,11 +28,11 @@ read_pins_t Scanner_IOE::scan(const uint8_t strobePin) //strobe on if (activeState == LOW) //if active low { - refPortWrite.setLow(strobePin); + refPortWrite.writeLow(strobePin); } else //if active high { - refPortWrite.setHigh(strobePin); + refPortWrite.writeHigh(strobePin); } delayMicroseconds(3); //time to stabilize voltage @@ -42,12 +42,12 @@ read_pins_t Scanner_IOE::scan(const uint8_t strobePin) //strobe off if (activeState == LOW) //if active low { - refPortWrite.setHigh(strobePin); + refPortWrite.writeHigh(strobePin); readState = ~readState; } else //if active high { - refPortWrite.setLow(strobePin); + refPortWrite.writeLow(strobePin); } return readState;