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_ShiftRegisters.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #ifndef ROW_SHIFTREGISTERS_H
  2. #define ROW_SHIFTREGISTERS_H
  3. #include <RowBase.h>
  4. #include <RowDelay.h>
  5. #include <RowScanner_SPIShiftRegisters.h>
  6. #include <Debouncer_4Samples.h>
  7. //#include <Debouncer_Not.h>
  8. /* Row_DH_IOE is a row connected to an Input/Output Expander.
  9. Instantiation
  10. -------------
  11. Definition of DELAY_MICROSECONDS is explained in RowBase.cpp.
  12. Example instantiation of a row:
  13. const unsigned int RowBase::DELAY_MICROSECONDS = 1000;
  14. todo
  15. Key* const ptrsKeys_0[] = { &k_00, &k_01, &k_02, &k_03, &k_04, &k_05 };
  16. Row_ShiftRegisters row_0(uint8_t BYTE_COUNT, ptrsKeys_0);
  17. Number of pins in colPort0 should equal number of keys in ptrsKeys_0[] array.
  18. if a pin is missing, a key will be unresposive
  19. if a Key pointer is missing, the keyboard will fail in an unprdictable way
  20. */
  21. class Row_ShiftRegisters : public RowBase
  22. {
  23. private:
  24. RowDelay rowDelay;
  25. RowScanner_SPIShiftRegisters scanner;
  26. Debouncer_4Samples debouncer;
  27. //Debouncer_Not debouncer; //passed test
  28. public:
  29. Row_ShiftRegisters(const uint8_t STROBE_PIN, Key *const ptrsKeys[], uint8_t KEY_COUNT)
  30. : RowBase(ptrsKeys), scanner(STROBE_PIN, KEY_COUNT) { }
  31. void begin();
  32. void process();
  33. };
  34. #endif