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.

123456789101112131415161718192021222324
  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. static const bool STROBE_OFF; //logic level of strobe off, complement of STROBE_ON
  15. StrobePort& refStrobePort; //this row's IC port
  16. const uint8_t STROBE_PIN; //bitwise, 1 indicates IC pin connected to this row
  17. ReadPort& refReadPort;
  18. public:
  19. Scanner_Port(StrobePort &refStrobePort, const uint8_t STROBE_PIN, ReadPort& refReadPort)
  20. : refStrobePort(refStrobePort), STROBE_PIN(STROBE_PIN), refReadPort(refReadPort) {}
  21. uint8_t scan();
  22. };
  23. #endif