2016-07-12 13:23:24 +00:00
|
|
|
#ifndef ROW_H
|
|
|
|
#define ROW_H
|
2016-07-14 23:28:16 +00:00
|
|
|
|
2016-05-09 14:05:08 +00:00
|
|
|
#include <Arduino.h>
|
|
|
|
#include <inttypes.h>
|
2016-06-22 02:40:35 +00:00
|
|
|
#include <config_keybrd.h>
|
2016-05-09 14:05:08 +00:00
|
|
|
#include <Key.h>
|
|
|
|
|
2016-07-12 13:23:24 +00:00
|
|
|
/* Row is an abstract base class.
|
2016-05-09 14:05:08 +00:00
|
|
|
*/
|
2016-07-12 13:23:24 +00:00
|
|
|
class Row
|
2016-05-09 14:05:08 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-07-04 03:26:38 +00:00
|
|
|
Key *const *const ptrsKeys; //array of Key pointers
|
2016-06-05 22:16:47 +00:00
|
|
|
virtual void keyWasPressed();
|
|
|
|
protected:
|
2016-09-01 02:29:59 +00:00
|
|
|
read_pins_t debounced; //bitwise state of keys after debouncing, 1=pressed, 0=released
|
2016-07-14 10:47:23 +00:00
|
|
|
void send(const uint8_t readPinCount, const read_pins_t debouncedChanged);
|
2016-05-09 14:05:08 +00:00
|
|
|
public:
|
2016-07-18 02:26:00 +00:00
|
|
|
Row(Key* const ptrsKeys[]) : ptrsKeys(ptrsKeys), debounced(0) { }
|
2016-07-04 03:54:00 +00:00
|
|
|
virtual void process()=0;
|
2016-05-09 14:05:08 +00:00
|
|
|
};
|
|
|
|
#endif
|