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.

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef ROW_H
  2. #define ROW_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <config_keybrd.h>
  6. #include <Key.h>
  7. #include <ScannerInterface.h>
  8. #include <Debouncer_Samples.h>
  9. /*
  10. strobePin has one of two formats:
  11. * if refScanner a Scanner_uC, then strobePin is an Arduino pin number connected to this row
  12. * if refScanner a Scanner_IOE, then strobePin is bitwise, 1 indicating IC pin connected to this row
  13. */
  14. class Row
  15. {
  16. private:
  17. virtual void keyWasPressed();
  18. protected:
  19. void send(const uint8_t keyCount, const read_pins_t debouncedChanged);
  20. ScannerInterface& refScanner;
  21. const uint8_t strobePin; //pin connected to this row (details above)
  22. private:
  23. Key *const *const ptrsKeys; //array of Key pointers
  24. protected:
  25. const uint8_t keyCount; //number of read pins
  26. Debouncer_Samples debouncer;
  27. read_pins_t debounced; //bitwise state of keys after debouncing, 1=pressed, 0=released
  28. public:
  29. Row(ScannerInterface& refScanner, const uint8_t strobePin,
  30. Key* const ptrsKeys[], const uint8_t keyCount);
  31. virtual void process();
  32. };
  33. #endif