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

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