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_PinsArray.h 1.0KB

123456789101112131415161718192021222324252627
  1. #ifndef ROWSCANNER_PINSARRAY_H
  2. #define ROWSCANNER_PINSARRAY_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <config_keybrd.h>
  6. #include <RowPort.h>
  7. #include <ColPort.h>
  8. /* RowScanner_PinsArray class uses Arduino pin numbers (not port pin numbers).
  9. The maximum keys per row is 31, because Arduino's largest type is 32 bits and rowEnd consumes the last bit.
  10. Constructor is in RowScanner_PinsArray.cpp
  11. */
  12. class RowScanner_PinsArray
  13. {
  14. private:
  15. static const bool ACTIVE_HIGH; //logic level of strobe pin: 0=activeLow, 1=activeHigh
  16. const uint8_t STROBE_PIN; //Arduino pin number connected to this row
  17. const uint8_t* const READ_PINS; //array of read pin numbers
  18. const uint8_t READ_PIN_COUNT; //number of read pins
  19. public:
  20. RowScanner_PinsArray(const uint8_t STROBE_PIN,
  21. const uint8_t READ_PINS[], const uint8_t READ_PIN_COUNT);
  22. virtual read_pins_t scan(read_pins_mask_t& rowEnd);
  23. //read_pins_t getRowState(read_pins_mask_t& rowEnd);
  24. };
  25. #endif