From 31fed09b6be6d760f933f7089e36a1a0f6635513 Mon Sep 17 00:00:00 2001 From: wolfv6 Date: Sat, 5 Nov 2016 14:07:56 -0600 Subject: [PATCH] document --- src/PortInterface.h | 4 +++- src/PortWriteInterface.h | 2 ++ src/Scanner_ShiftRegsReadStrobed.cpp | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/PortInterface.h b/src/PortInterface.h index 0f37b1f..5295b92 100644 --- a/src/PortInterface.h +++ b/src/PortInterface.h @@ -9,13 +9,15 @@ Port classes are the keybrd library's interface to microcontroller ports or I/O Port classes that can read and write, inherit from PortInterface. Port classes that can only write, inherit from PortWriteInterface. + +write() interface emulates Arduino's digitalWrite(). */ class PortInterface : public PortWriteInterface { public: virtual void beginProtocol()=0; //SPI bus or I2C bus virtual void begin(const uint8_t strobeOn)=0; //configure GPIO pins - virtual void write(const uint8_t strobePin, const bool pinLogicLevel)=0; + virtual void write(const uint8_t pin, const bool pinLogicLevel)=0; virtual uint8_t read()=0; }; #endif diff --git a/src/PortWriteInterface.h b/src/PortWriteInterface.h index b7e3815..98ee81c 100644 --- a/src/PortWriteInterface.h +++ b/src/PortWriteInterface.h @@ -8,6 +8,8 @@ Port classes are the keybrd library's interface to MOSI shift registers i.e. Por Port classes that can read & write, inherit from PortInterface. Port classes that can only write, inherit from PortWriteInterface. + +write() interface emulates Arduino's digitalWrite(). */ class PortWriteInterface { diff --git a/src/Scanner_ShiftRegsReadStrobed.cpp b/src/Scanner_ShiftRegsReadStrobed.cpp index 7f7d505..c58915f 100644 --- a/src/Scanner_ShiftRegsReadStrobed.cpp +++ b/src/Scanner_ShiftRegsReadStrobed.cpp @@ -48,7 +48,8 @@ read_pins_t Scanner_ShiftRegsReadStrobed::scan(const uint8_t strobePin) //SPI.beginTransaction( SPISettings(5000000, MSBFIRST, SPI_MODE0) ); //control SPI bus, 5 MHz - delayMicroseconds(20); //photo-transistor at 3.3v needs 20 ms to stablize + //photo-transistor at 3.3v needs 20 ms to stabilize + delayMicroseconds(20); //monitor trackball here digitalWrite(slaveSelect, HIGH); //shift the data toward a serial output