2016-07-12 13:23:24 +00:00
|
|
|
#ifndef SCANNER_UC_H
|
|
|
|
#define SCANNER_UC_H
|
2016-07-14 23:28:16 +00:00
|
|
|
|
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-09-05 20:09:59 +00:00
|
|
|
#include <ScannerInterface.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).
|
2016-09-05 20:09:59 +00:00
|
|
|
Limit number of readPins to size of read_pins_t, which is defined in config_keybrd.h
|
2016-06-08 02:24:50 +00:00
|
|
|
*/
|
2016-09-05 20:09:59 +00:00
|
|
|
class Scanner_uC : public ScannerInterface
|
2016-06-06 20:23:40 +00:00
|
|
|
{
|
|
|
|
private:
|
2016-11-06 09:41:56 +00:00
|
|
|
const bool activeState; //logic level of strobe on, HIGH or LOW
|
2016-07-15 05:15:38 +00:00
|
|
|
const uint8_t* const readPins; //array of read pin numbers
|
2016-09-05 20:09:59 +00:00
|
|
|
const uint8_t readPinCount; //number of readPins
|
2016-06-06 20:23:40 +00:00
|
|
|
public:
|
2016-11-06 09:41:56 +00:00
|
|
|
Scanner_uC(const bool activeState, const uint8_t readPins[], const uint8_t readPinCount);
|
2016-09-06 07:08:26 +00:00
|
|
|
void init(const uint8_t strobePin);
|
2016-09-05 20:09:59 +00:00
|
|
|
virtual read_pins_t scan(const uint8_t strobePin);
|
2016-06-06 20:23:40 +00:00
|
|
|
};
|
|
|
|
#endif
|