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

30 lines
1.1 KiB
C
Raw Normal View History

2016-11-06 18:23:53 +00:00
#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.
2016-09-11 21:23:47 +00:00
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:
2016-11-06 18:23:53 +00:00
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:
2016-11-06 09:41:56 +00:00
Scanner_IOE(const bool activeState, PortInterface &refPortWrite, PortInterface& refPortRead)
2016-11-06 18:23:53 +00:00
: activeState(activeState), refPortWrite(refPortWrite), refPortRead(refPortRead) {}
void init(const uint8_t strobePin);
void begin();
read_pins_t scan(const uint8_t strobePin);
};
#endif