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_PinsBitwise.h 913B

12345678910111213141516171819202122232425
  1. #ifndef ROWSCANNER_PINSBITWISE_H
  2. #define ROWSCANNER_PINSBITWISE_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <RowPort.h>
  6. #include <ColPort.h>
  7. /* RowScanner_PinsBitwise 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 RowScanner_PinsBitwise
  11. {
  12. private:
  13. RowPort& refRowPort; //this row's IC port
  14. const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row
  15. ColPort& refColPort;
  16. public:
  17. RowScanner_PinsBitwise(RowPort &refRowPort, const uint8_t strobePin,
  18. ColPort& refColPort)
  19. : refRowPort(refRowPort), strobePin(strobePin),
  20. refColPort(refColPort) {}
  21. static const bool activeHigh; //logic level of strobe pin: 0=activeLow, 1=activeHigh
  22. virtual ColPort* const scan();
  23. };
  24. #endif