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

123456789101112131415161718192021222324252627282930313233
  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. ScannerInterface& refScanner;
  18. const uint8_t strobePin; //pin connected to this row (details above)
  19. Key *const *const ptrsKeys; //array of Key pointers
  20. const uint8_t readPinCount; //number of read pins
  21. Debouncer_Samples debouncer;
  22. virtual void keyWasPressed();
  23. protected://todo is protected needed?
  24. read_pins_t debounced; //bitwise state of keys after debouncing, 1=pressed, 0=released
  25. void send(const uint8_t readPinCount, const read_pins_t debouncedChanged);
  26. public:
  27. Row(ScannerInterface& refScanner, const uint8_t strobePin,
  28. Key* const ptrsKeys[], const uint8_t readPinCount);
  29. void process();
  30. };
  31. #endif