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.

Row.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637
  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. #include <Debouncer_Not.h>
  10. /*
  11. strobePin has one of two formats:
  12. * if refScanner a Scanner_uC, then strobePin is an Arduino pin number connected to this row
  13. * otherwise strobePin is bit pattern, 1 indicating an IC pin connected to this row
  14. */
  15. class Row
  16. {
  17. private:
  18. virtual void keyWasPressed();
  19. protected:
  20. void send(const uint8_t keyCount, const read_pins_t debouncedChanged);
  21. ScannerInterface& refScanner;
  22. const uint8_t strobePin; //pin connected to this row (details above)
  23. private:
  24. Key *const *const ptrsKeys; //array of Key pointers
  25. protected:
  26. const uint8_t keyCount; //number of read pins
  27. //Debouncer_Samples debouncer;
  28. Debouncer_Not debouncer; //todo
  29. read_pins_t debounced; //bit pattern, state of keys after debouncing, 1=pressed, 0=released
  30. public:
  31. Row(ScannerInterface& refScanner, const uint8_t strobePin,
  32. Key* const ptrsKeys[], const uint8_t keyCount);
  33. virtual void process();
  34. };
  35. #endif