Browse Source

remove RowScannerInterface, add KEY_COUNT, change COL_PIN_L_COUNT to KEY_COUNT

tags/v0.5.0
wolfv6 7 years ago
parent
commit
2887eeaa61

+ 1
- 5
doc/keybrd_library_developer_guide.md View File

@@ -19,7 +19,6 @@ The keybrd library is flexible for designing custom Rows
this example illustrates the custom Row classes for a fictional keybrd_Ext extension library
the keybrd_Ext library is for a split keyboard with a matrix on each hand
other custom Row classes would have a similar structure
Row_Ext::keyWasPressed() overrides RowBase::keyWasPressed()
Row_Ext::keyWasPressed() is used to unstick sticky keys
@@ -38,8 +37,6 @@ Class inheritance diagram
Row_Ext_uC Row_Ext_ShiftRegisters (inherit Row_Ext::keyWasPressed() )
RowScannerInterface
/ \
RowScanner_PinsArray RowScanner_SPIShiftRegisters
```
@@ -70,8 +67,7 @@ Keybrd library class inheritance diagram
/ | \
Row_uC Row_ShiftRegisters Row_IOE
_____ RowScannerInterface ______
/ | \
RowScanner_PinsArray RowScanner_PinsBitwise RowScanner_SPIShiftRegisters

+ 0
- 16
src/RowScannerInterface.h View File

@@ -1,16 +0,0 @@
#ifndef ROWSCANNERINTERFACE_H
#define ROWSCANNERINTERFACE_H

#include <Arduino.h>
#include <inttypes.h>
#include <config_keybrd.h>

class RowScannerInterface
{
public:
// virtual read_pins_t scan(read_pins_mask_t& rowEnd)=0;
// todo, remove RowScannerInterface because
// some RowScanners will return ColPort e.g. RowScanner_PinsBitwise
};
#endif


+ 1
- 2
src/RowScanner_PinsArray.h View File

@@ -3,7 +3,6 @@
#include <Arduino.h>
#include <inttypes.h>
#include <config_keybrd.h>
#include <RowScannerInterface.h>
#include <RowPort.h>
#include <ColPort.h>

@@ -11,7 +10,7 @@
The maximum keys per row is 31, because Arduino's largest type is 32 bits and rowEnd consumes the last bit.
Constructor is in RowScanner_PinsArray.cpp
*/
class RowScanner_PinsArray : public RowScannerInterface
class RowScanner_PinsArray
{
private:
static const bool ACTIVE_HIGH; //logic level of strobe pin: 0=activeLow, 1=activeHigh

+ 1
- 2
src/RowScanner_PinsBitwise.h View File

@@ -2,14 +2,13 @@
#define ROWSCANNER_PINSBITWISE_H
#include <Arduino.h>
#include <inttypes.h>
#include <RowScannerInterface.h>
#include <RowPort.h>
#include <ColPort.h>

/* RowScanner_PinsBitwise uses bit manipulation to read all pins of one port.
The maximum keys per row is 8, because ports have a maximum of 8 pins each.
*/
class RowScanner_PinsBitwise : public RowScannerInterface
class RowScanner_PinsBitwise
{
private:
RowPort& refRowPort; //this row's IC port

+ 2
- 2
src/RowScanner_SPIShiftRegisters.h View File

@@ -2,8 +2,8 @@
#define ROWSCANNER_SPI_SHIFTREGISTERS_H
#include <Arduino.h>
#include <inttypes.h>
#include <config_keybrd.h>
#include <SPI.h>
#include <RowScannerInterface.h>
#include <RowPort.h>
#include <ColPort.h>

@@ -28,7 +28,7 @@ The two parts of a split keyboard can be connected by one of:
* Ethernet cable (has 8 wires, good for 3 rows)

*/
class RowScanner_SPIShiftRegisters : public RowScannerInterface
class RowScanner_SPIShiftRegisters
{
private:
static const uint8_t SHIFT_LOAD; //controller's pin number that is connected to shift register's SHIFT_LOAD pin

+ 1
- 1
src/Row_IOE.h View File

@@ -39,7 +39,7 @@ class Row_IOE : public RowBase
Debouncer_4Samples debouncer;
public:
Row_IOE( RowPort& refRowPort, const uint8_t strobePin,
ColPort& refColPort, Key *const ptrsKeys[], const uint8_t KEY_COUNT)
ColPort& refColPort, Key *const ptrsKeys[], const uint8_t KEY_COUNT) //todo if KEY_COUNT is passed in, store it in private
: RowBase(ptrsKeys), scanner(refRowPort, strobePin, refColPort) { }
void process();
uint8_t getRowState(ColPort* ptrColPort, uint8_t& KEY_COUNT);

+ 3
- 3
src/Row_uC.h View File

@@ -32,9 +32,9 @@ class Row_uC : public RowBase
RowScanner_PinsArray scanner;
Debouncer_4Samples debouncer;
public:
Row_uC(const uint8_t strobePin, const uint8_t readPins[], const uint8_t READ_PIN_COUNT,
Key *const ptrsKeys[])
: RowBase(ptrsKeys), scanner(strobePin, readPins, READ_PIN_COUNT) { }
Row_uC(const uint8_t strobePin, const uint8_t readPins[],
Key *const ptrsKeys[], const uint8_t KEY_COUNT)
: RowBase(ptrsKeys), scanner(strobePin, readPins, KEY_COUNT) { }
void process();
};
#endif