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.h

36 lines
1.2 KiB
C
Raw Normal View History

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>
#include <config_keybrd.h>
2016-05-09 14:05:08 +00:00
#include <Key.h>
#include <ScannerInterface.h>
#include <Debouncer_Samples.h>
2016-05-09 14:05:08 +00:00
/*
strobePin has one of two formats:
* if refScanner a Scanner_uC, then strobePin is an Arduino pin number connected to this row
* if refScanner a Scanner_IOE, then strobePin is bitwise, 1 indicating IC pin connected to this row
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:
virtual void keyWasPressed();
protected:
2016-09-12 06:28:27 +00:00
void send(const uint8_t keyCount, const read_pins_t debouncedChanged);
ScannerInterface& refScanner;
const uint8_t strobePin; //pin connected to this row (details above)
private:
2016-07-04 03:26:38 +00:00
Key *const *const ptrsKeys; //array of Key pointers
protected:
2016-09-12 06:28:27 +00:00
const uint8_t keyCount; //number of read pins
Debouncer_Samples debouncer;
2016-09-12 06:28:27 +00:00
read_pins_t debounced; //bitwise state of keys after debouncing, 1=pressed, 0=released
2016-05-09 14:05:08 +00:00
public:
Row(ScannerInterface& refScanner, const uint8_t strobePin,
2016-09-12 06:28:27 +00:00
Key* const ptrsKeys[], const uint8_t keyCount);
virtual void process();
2016-05-09 14:05:08 +00:00
};
#endif