keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

RowScanner_Arduino.h 1.1KB

123456789101112131415161718192021222324252627282930
  1. #ifndef ROWSCANNER_ARDUINO_H
  2. #define ROWSCANNER_ARDUINO_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <RowScannerInterface.h>
  6. #include <RowPort.h>
  7. #include <ColPort.h>
  8. /* rowPin > stobePins[]
  9. replace port calls with
  10. x pass 1: hard code pins for row0 and col6, init in setup()
  11. pass 2: pins[] array - first strobe, then read
  12. pass 3: move calls to IC classes - Strobe_uC, Read_uC
  13. pass 4: add IC classes Strobe_MCP23018, Read_MCP23018 */
  14. class RowScanner_Arduino : public RowScannerInterface
  15. {
  16. private:
  17. static const bool activeHigh; //logic level of strobe pin: 0=activeLow, 1=activeHigh
  18. const uint8_t stobePin; //Arduino pin number connected to this row
  19. //const uint8_t* readPins; //array of read pins
  20. //const uint8_t readPinCount;
  21. public:
  22. RowScanner_Arduino(const uint8_t stobePin)
  23. : stobePin(stobePin)
  24. // readPinCount(readPinCount)
  25. {}
  26. virtual uint8_t scan(uint16_t& rowEnd);
  27. uint8_t getRowState(uint16_t& rowEnd);
  28. };
  29. #endif