Archived
1
0
This repo is archived. You can view files and clone it, but cannot push or open issues or pull requests.
keybrd/src/Row_ShiftRegisters.h

41 lines
1.3 KiB
C
Raw Normal View History

#ifndef ROW_SHIFTREGISTERS_H
#define ROW_SHIFTREGISTERS_H
2016-07-12 13:23:24 +00:00
#include <Row.h>
#include <Scanner_ShiftRegs74HC165.h>
#include <Debouncer_4Samples.h>
2016-07-02 21:10:02 +00:00
//#include <Debouncer_Not.h>
/* Row_DH_IOE is a row connected to an Input/Output Expander.
Instantiation
-------------
2016-07-12 13:23:24 +00:00
Definition of DELAY_MICROSECONDS is explained in Row.cpp.
Example instantiation of a row:
2016-07-12 13:23:24 +00:00
const unsigned int Row::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
*/
2016-07-12 13:23:24 +00:00
class Row_ShiftRegisters : public Row
{
private:
2016-07-12 13:23:24 +00:00
Scanner_ShiftRegs74HC165 scanner;
Debouncer_4Samples debouncer;
2016-07-04 23:29:24 +00:00
//Debouncer_Not debouncer; //passed test
const uint8_t READ_PIN_COUNT; //number of read pins
public:
Row_ShiftRegisters(const uint8_t STROBE_PIN, uint8_t READ_PIN_COUNT, Key *const ptrsKeys[])
: Row(ptrsKeys), scanner(STROBE_PIN, READ_PIN_COUNT), READ_PIN_COUNT(READ_PIN_COUNT) { }
void begin();
void process();
};
#endif