From a4cc38d99ae6d086a8d8ecb7fe8054f050b4f0c9 Mon Sep 17 00:00:00 2001 From: wolfv6 Date: Sat, 3 Sep 2016 12:11:17 -0600 Subject: [PATCH] rename PortRead to PortReadInterface, rename PortWrite to PortWriteInterface --- src/{PortRead.h => PortReadInterface.h} | 7 +++---- src/PortRead_MCP23S17.h | 4 ++-- src/PortRead_PCA9655E.h | 4 ++-- src/{PortWrite.h => PortWriteInterface.h} | 7 +++---- src/PortWrite_MCP23S17.h | 4 ++-- src/PortWrite_PCA9655E.h | 4 ++-- src/Row_IOE.h | 8 ++++---- src/Scanner_Port.h | 14 ++++++++------ src/Scanner_ShiftRegs74HC165.h | 4 ++-- src/Scanner_uC.h | 4 ++-- 10 files changed, 30 insertions(+), 30 deletions(-) rename src/{PortRead.h => PortReadInterface.h} (75%) rename src/{PortWrite.h => PortWriteInterface.h} (76%) diff --git a/src/PortRead.h b/src/PortReadInterface.h similarity index 75% rename from src/PortRead.h rename to src/PortReadInterface.h index 1ee233c..18d7080 100644 --- a/src/PortRead.h +++ b/src/PortReadInterface.h @@ -1,16 +1,15 @@ -#ifndef PORTREAD_H -#define PORTREAD_H +#ifndef PORTREADINTERFACE_H +#define PORTREADINTERFACE_H #include #include /* -PortRead is an abstract base class. Port classes are the keybrd library's interface to microcontroller ports or I/O expander ports. If your 8-bit AVR (Teensy 2) is running low on memory, using a smaller read_pins_t type saves SRAM. Details are in config_key.h */ -class PortRead +class PortReadInterface { public: virtual uint8_t read()=0; diff --git a/src/PortRead_MCP23S17.h b/src/PortRead_MCP23S17.h index f000884..8fea235 100644 --- a/src/PortRead_MCP23S17.h +++ b/src/PortRead_MCP23S17.h @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include "PortIOE.h" #include "Scanner_Port.h" @@ -25,7 +25,7 @@ Example instantiation for column port 1, with pins 2 and 3 connected to columns: readPins are read from pin 0 on up. */ -class PortRead_MCP23S17 : public PortRead +class PortRead_MCP23S17 : public PortReadInterface { private: PortIOE& port; diff --git a/src/PortRead_PCA9655E.h b/src/PortRead_PCA9655E.h index 38a25ca..b35eb82 100644 --- a/src/PortRead_PCA9655E.h +++ b/src/PortRead_PCA9655E.h @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include "PortIOE.h" /* One PCA9655E I/O expander port connected to matrix columns. @@ -25,7 +25,7 @@ Example instantiation for column port 1, with pins 2 and 3 connected to columns: readPins are read from pin 0 on up. */ -class PortRead_PCA9655E : public PortRead +class PortRead_PCA9655E : public PortReadInterface { private: PortIOE& port; diff --git a/src/PortWrite.h b/src/PortWriteInterface.h similarity index 76% rename from src/PortWrite.h rename to src/PortWriteInterface.h index 6c57a48..c8f7a52 100644 --- a/src/PortWrite.h +++ b/src/PortWriteInterface.h @@ -1,16 +1,15 @@ -#ifndef PORTWRITE_H -#define PORTWRITE_H +#ifndef PORTWRITEINTERFACE_H +#define PORTWRITEINTERFACE_H #include #include /* -PortWrite is an abstract base class. Port classes are the keybrd library's interface to microcontroller ports or I/O expander ports. If your 8-bit AVR (Teensy 2) is running low on memory, using a smaller read_pins_t type saves SRAM. Details are in config_key.h */ -class PortWrite +class PortWriteInterface { public: virtual void write(const uint8_t pin, const bool level)=0; diff --git a/src/PortWrite_MCP23S17.h b/src/PortWrite_MCP23S17.h index bd3f7da..1e7c973 100644 --- a/src/PortWrite_MCP23S17.h +++ b/src/PortWrite_MCP23S17.h @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include "PortIOE.h" /* One MCP23S17 I/O expander port connected to matrix rows. @@ -33,7 +33,7 @@ MCP23S17 data sheet http://www.onsemi.com/pub_link/Collateral/MCP23S17-D.PDF */ -class PortWrite_MCP23S17 : public PortWrite +class PortWrite_MCP23S17 : public PortWriteInterface { private: PortIOE& port; diff --git a/src/PortWrite_PCA9655E.h b/src/PortWrite_PCA9655E.h index 03daa97..200c3af 100644 --- a/src/PortWrite_PCA9655E.h +++ b/src/PortWrite_PCA9655E.h @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include "PortIOE.h" /* One PCA9655E I/O expander port connected to matrix rows. @@ -33,7 +33,7 @@ PCA9655E data sheet http://www.onsemi.com/pub_link/Collateral/PCA9655E-D.PDF */ -class PortWrite_PCA9655E : public PortWrite +class PortWrite_PCA9655E : public PortWriteInterface { private: PortIOE& port; diff --git a/src/Row_IOE.h b/src/Row_IOE.h index dd3b400..eb8ff60 100644 --- a/src/Row_IOE.h +++ b/src/Row_IOE.h @@ -4,8 +4,8 @@ #include #include #include -class PortWrite; -class PortRead; +class PortWriteInterface; +class PortReadInterface; /* Row_IOE is a row connected to an Input/Output Expander. Configuration and Instantiation instructions are in keybrd/src/Row_IOE.h @@ -17,8 +17,8 @@ class Row_IOE : public Row Debouncer_Samples debouncer; const uint8_t readPinCount; //number of read pins public: - Row_IOE(PortWrite& refPortWrite, const uint8_t strobePin, - PortRead& refPortRead, const uint8_t readPinCount, Key *const ptrsKeys[]) + Row_IOE(PortWriteInterface& refPortWrite, const uint8_t strobePin, + PortReadInterface& refPortRead, const uint8_t readPinCount, Key *const ptrsKeys[]) : Row(ptrsKeys), scanner(refPortWrite, strobePin, refPortRead), readPinCount(readPinCount) { } void process(); diff --git a/src/Scanner_Port.h b/src/Scanner_Port.h index f161b95..a6c92da 100644 --- a/src/Scanner_Port.h +++ b/src/Scanner_Port.h @@ -3,8 +3,8 @@ #include #include -#include -#include +#include +#include /* Scanner_Port uses bit manipulation to read all pins of one port. The ports are normally from an I/O Expander, but could also be ports from an AVR uC. @@ -17,12 +17,14 @@ class Scanner_Port private: static const bool STROBE_ON; //HIGH or LOW logic level of strobe on, active state static const bool STROBE_OFF; //logic level of strobe off, complement of STROBE_ON - PortWrite& refPortWrite; //the IC port containing the strobePin + PortWriteInterface& refPortWrite; //the IC port containing the strobePin const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row - PortRead& refPortRead; //the IC's read port + PortReadInterface& refPortRead; //the IC's read port public: - Scanner_Port(PortWrite &refPortWrite, const uint8_t strobePin, PortRead& refPortRead) - : refPortWrite(refPortWrite), strobePin(strobePin), refPortRead(refPortRead) {} + Scanner_Port(PortWriteInterface &refPortWrite, const uint8_t strobePin, + PortReadInterface& refPortRead) + : refPortWrite(refPortWrite), strobePin(strobePin), + refPortRead(refPortRead) {} uint8_t scan(); }; #endif diff --git a/src/Scanner_ShiftRegs74HC165.h b/src/Scanner_ShiftRegs74HC165.h index 359f4b6..7760ac3 100644 --- a/src/Scanner_ShiftRegs74HC165.h +++ b/src/Scanner_ShiftRegs74HC165.h @@ -5,8 +5,8 @@ #include #include #include -#include -#include +#include +#include /* Scanner_ShiftRegs74HC165 reads shift registers. shift registers 74HC165 are Parallel-In-Serial-Out (PISO) diff --git a/src/Scanner_uC.h b/src/Scanner_uC.h index afc20ae..bc69169 100644 --- a/src/Scanner_uC.h +++ b/src/Scanner_uC.h @@ -4,8 +4,8 @@ #include #include #include -#include -#include +#include +#include /* Scanner_uC class uses Arduino pin numbers (not port pin numbers). Constructor is in Scanner_uC.cpp