2016-06-18 22:32:21 +00:00
|
|
|
#ifndef ROW_SHIFTREGISTERS_H
|
|
|
|
#define ROW_SHIFTREGISTERS_H
|
|
|
|
|
|
|
|
#include <RowBase.h>
|
|
|
|
#include <RowScanner_SPIShiftRegisters.h>
|
|
|
|
#include <Debouncer_4Samples.h>
|
2016-07-02 21:10:02 +00:00
|
|
|
//#include <Debouncer_Not.h>
|
2016-06-18 22:32:21 +00:00
|
|
|
|
|
|
|
/* Row_DH_IOE is a row connected to an Input/Output Expander.
|
|
|
|
|
|
|
|
Instantiation
|
|
|
|
-------------
|
|
|
|
Definition of DELAY_MICROSECONDS is explained in RowBase.cpp.
|
|
|
|
Example instantiation of a row:
|
|
|
|
|
|
|
|
const unsigned int RowBase::DELAY_MICROSECONDS = 1000;
|
|
|
|
|
|
|
|
todo
|
|
|
|
|
|
|
|
Key* const ptrsKeys_0[] = { &k_00, &k_01, &k_02, &k_03, &k_04, &k_05 };
|
|
|
|
Row_ShiftRegisters row_0(uint8_t BYTE_COUNT, ptrsKeys_0);
|
|
|
|
|
|
|
|
Number of pins in colPort0 should equal number of keys in ptrsKeys_0[] array.
|
|
|
|
if a pin is missing, a key will be unresposive
|
|
|
|
if a Key pointer is missing, the keyboard will fail in an unprdictable way
|
|
|
|
*/
|
|
|
|
class Row_ShiftRegisters : public RowBase
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
RowScanner_SPIShiftRegisters scanner;
|
|
|
|
Debouncer_4Samples debouncer;
|
2016-07-02 21:10:02 +00:00
|
|
|
//Debouncer_Not debouncer; //tested
|
2016-06-18 22:32:21 +00:00
|
|
|
public:
|
2016-07-02 09:58:41 +00:00
|
|
|
Row_ShiftRegisters(const uint8_t STROBE_PIN, Key *const ptrsKeys[], uint8_t KEY_COUNT)
|
|
|
|
: RowBase(ptrsKeys), scanner(STROBE_PIN, KEY_COUNT) { }
|
2016-06-18 22:32:21 +00:00
|
|
|
void begin();
|
2016-07-04 03:54:00 +00:00
|
|
|
void process();
|
2016-06-18 22:32:21 +00:00
|
|
|
};
|
|
|
|
#endif
|