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.

RowBase.h 740B

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