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 640B

1234567891011121314151617181920212223
  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. /* Row is an abstract base class.
  8. */
  9. class Row
  10. {
  11. private:
  12. Key *const *const ptrsKeys; //array of Key pointers
  13. virtual void keyWasPressed();
  14. protected:
  15. read_pins_t debounced; //bitwise state of keys after debouncing, 1=pressed, 0=released
  16. void send(const uint8_t readPinCount, const read_pins_t debouncedChanged);
  17. public:
  18. Row(Key* const ptrsKeys[]) : ptrsKeys(ptrsKeys), debounced(0) { }
  19. virtual void process()=0;
  20. };
  21. #endif