2016-06-02 15:58:33 +00:00
|
|
|
#ifndef ROW_H
|
|
|
|
#define ROW_H
|
|
|
|
|
|
|
|
#include <RowBase.h>
|
2016-06-09 19:29:31 +00:00
|
|
|
#include <RowScanner_PinsArray.h>
|
2016-06-03 06:12:29 +00:00
|
|
|
#include <Debouncer_4Samples.h>
|
2016-06-02 15:58:33 +00:00
|
|
|
|
2016-06-11 02:12:56 +00:00
|
|
|
/* Row_uC is a row connected to a micro controller.
|
2016-06-02 15:58:33 +00:00
|
|
|
Configuration
|
|
|
|
-------------
|
2016-06-11 02:12:56 +00:00
|
|
|
Define and initilize DELAY_MICROSECONDS in sketch. Detailed how to is in RowBase.cpp.
|
2016-06-02 15:58:33 +00:00
|
|
|
|
|
|
|
Instantiation
|
2016-06-03 06:12:29 +00:00
|
|
|
-------------
|
2016-06-11 02:12:56 +00:00
|
|
|
Example instantiation of a row:
|
|
|
|
|
|
|
|
const uint8_t colPins[] = {0,1,2,3,7,8};
|
|
|
|
const uint8_t COL_PIN_COUNT = sizeof(colPins)/sizeof(*colPins);
|
|
|
|
|
|
|
|
Key* const ptrsKeys_0[] = { &k_00, &k_01, &k_02, &k_03, &k_04, &k_05 };
|
|
|
|
Row_DH_uC row_0(21, colPins, COL_PIN_COUNT, ptrsKeys_0);
|
|
|
|
|
|
|
|
Number of colPins should equal number of keys in ptrsKeys_0[] array.
|
|
|
|
if a colPin is missing, a key will be unresposive
|
|
|
|
if a Key pointer is missing, the keyboard will fail in an unprdictable way
|
2016-06-02 15:58:33 +00:00
|
|
|
*/
|
2016-06-10 01:31:24 +00:00
|
|
|
class Row_uC : public RowBase
|
2016-06-02 15:58:33 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-06-09 19:29:31 +00:00
|
|
|
RowScanner_PinsArray scanner;
|
2016-06-03 06:12:29 +00:00
|
|
|
Debouncer_4Samples debouncer;
|
2016-06-02 15:58:33 +00:00
|
|
|
public:
|
2016-06-10 01:31:24 +00:00
|
|
|
Row_uC(const uint8_t strobePin, const uint8_t readPins[], const uint8_t READ_PIN_COUNT,
|
2016-06-09 19:29:31 +00:00
|
|
|
Key *const ptrsKeys[])
|
2016-06-07 01:37:48 +00:00
|
|
|
: RowBase(ptrsKeys), scanner(strobePin, readPins, READ_PIN_COUNT) { }
|
2016-06-10 03:11:18 +00:00
|
|
|
uint8_t scan(uint16_t& rowEnd);
|
|
|
|
uint8_t debounce(const uint8_t rowState, uint8_t& debounced);
|
2016-06-02 15:58:33 +00:00
|
|
|
};
|
|
|
|
#endif
|