-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathScanner_IOE.h
29 lines (25 loc) · 1.05 KB
/
Scanner_IOE.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef SCANNER_IOE_H
#define SCANNER_IOE_H
#include <Arduino.h>
#include <inttypes.h>
#include "ScannerInterface.h"
#include "PortInterface.h"
/* Scanner_IOE uses bit manipulation to read all pins of one port.
The maximum keys per row is 8, because ports have a maximum of 8 pins each.
begin() should be called once from sketch setup().
keybrd_library_developer_guide.md has instructions for ## Active state and diode orientation
*/
class Scanner_IOE : public ScannerInterface
{
private:
const bool activeState; //logic level of strobe on, HIGH or LOW
PortInterface& refPortWrite; //the IC port containing the strobePin
PortInterface& refPortRead; //the IC's read port
public:
Scanner_IOE(const bool activeState, PortInterface &refPortWrite, PortInterface& refPortRead)
: activeState(activeState), refPortWrite(refPortWrite), refPortRead(refPortRead) {}
void init(const uint8_t strobePin);
void begin();
read_pins_t scan(const uint8_t strobePin);
};
#endif