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.

1234567891011121314151617181920212223242526
  1. #ifndef ROWBASE_H
  2. #define ROWBASE_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <config_keybrd.h>
  6. #include <Key.h>
  7. /* RowBase is an abstract base class.
  8. */
  9. class RowBase
  10. {
  11. private:
  12. static const unsigned int DELAY_MICROSECONDS; //delay between each Row scan for debouncing
  13. Key *const *const ptrsKeys; //array of Key pointers
  14. virtual void keyWasPressed();
  15. protected:
  16. read_pins_t debounced; //bitwise, 1 means pressed, 0 means released
  17. void wait();
  18. void pressRelease(const read_pins_mask_t rowEnd, const read_pins_t debouncedChanged);
  19. public:
  20. RowBase(Key *const ptrsKeys[]) : ptrsKeys(ptrsKeys), debounced(0) { }
  21. virtual void process()=0;
  22. };
  23. #endif