2016-07-12 13:23:24 +00:00
|
|
|
#ifndef SCANNER_UC_H
|
|
|
|
#define SCANNER_UC_H
|
2016-06-06 20:23:40 +00:00
|
|
|
#include <Arduino.h>
|
|
|
|
#include <inttypes.h>
|
2016-06-22 02:40:35 +00:00
|
|
|
#include <config_keybrd.h>
|
2016-07-12 13:23:24 +00:00
|
|
|
#include <StrobePort.h>
|
|
|
|
#include <ReadPort.h>
|
2016-06-08 02:24:50 +00:00
|
|
|
|
2016-07-12 13:23:24 +00:00
|
|
|
/* Scanner_uC class uses Arduino pin numbers (not port pin numbers).
|
|
|
|
Constructor is in Scanner_uC.cpp
|
2016-06-08 02:24:50 +00:00
|
|
|
*/
|
2016-07-12 13:23:24 +00:00
|
|
|
class Scanner_uC
|
2016-06-06 20:23:40 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-07-11 10:08:34 +00:00
|
|
|
static const bool STROBE_ON; //logic level of strobe on, HIGH or LOW
|
|
|
|
static const bool STROBE_OFF; //logic level of strobe off, complement of STROBE_ON
|
|
|
|
const uint8_t STROBE_PIN; //Arduino pin number connected to this row
|
|
|
|
const uint8_t* const READ_PINS; //array of read pin numbers
|
|
|
|
const uint8_t READ_PIN_COUNT; //number of read pins
|
2016-06-06 20:23:40 +00:00
|
|
|
public:
|
2016-07-12 13:23:24 +00:00
|
|
|
Scanner_uC(const uint8_t STROBE_PIN,
|
|
|
|
const uint8_t READ_PINS[], const uint8_t READ_PIN_COUNT); //todo rename READ_PIN_COUNT to READ_PIN_COUNT ??
|
|
|
|
virtual read_pins_t scan(uint8_t& READ_PIN_COUNT);
|
2016-06-06 20:23:40 +00:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|