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.

1234567891011121314151617181920212223
  1. #ifndef SCANNER_PORT_H
  2. #define SCANNER_PORT_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <StrobePort.h>
  6. #include <ReadPort.h>
  7. /* Scanner_Port uses bit manipulation to read all pins of one port.
  8. The maximum keys per row is 8, because ports have a maximum of 8 pins each.
  9. */
  10. class Scanner_Port
  11. {
  12. private:
  13. static const bool STROBE_ON; //HIGH or LOW logic level of strobe on, active state
  14. StrobePort& refStrobePort; //this row's IC port
  15. const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row
  16. ReadPort& refReadPort;
  17. public:
  18. Scanner_Port(StrobePort &refStrobePort, const uint8_t strobePin, ReadPort& refReadPort)
  19. : refStrobePort(refStrobePort), strobePin(strobePin), refReadPort(refReadPort) {}
  20. virtual ReadPort* const scan();
  21. };
  22. #endif