keybrd library is an open source library for creating custom-keyboard firmware.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
Dieses Repo ist archiviert. Du kannst Dateien sehen und es klonen, kannst aber nicht pushen oder Issues/Pull-Requests öffnen.

Row_ShiftRegisters.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. /* Row_DH_IOE is a row connected to an Input/Output Expander.
  7. Instantiation
  8. -------------
  9. Definition of DELAY_MICROSECONDS is explained in RowBase.cpp.
  10. Example instantiation of a row:
  11. const unsigned int RowBase::DELAY_MICROSECONDS = 1000;
  12. todo
  13. Key* const ptrsKeys_0[] = { &k_00, &k_01, &k_02, &k_03, &k_04, &k_05 };
  14. Row_ShiftRegisters row_0(uint8_t BYTE_COUNT, ptrsKeys_0);
  15. Number of pins in colPort0 should equal number of keys in ptrsKeys_0[] array.
  16. if a pin is missing, a key will be unresposive
  17. if a Key pointer is missing, the keyboard will fail in an unprdictable way
  18. */
  19. class Row_ShiftRegisters : public RowBase
  20. {
  21. private:
  22. RowScanner_SPIShiftRegisters scanner;
  23. Debouncer_4Samples debouncer;
  24. public:
  25. Row_ShiftRegisters(const uint8_t SS, uint8_t BYTE_COUNT, Key *const ptrsKeys[], uint8_t KEY_COUNT)
  26. : RowBase(ptrsKeys), scanner(SS, BYTE_COUNT, KEY_COUNT) { }
  27. void begin();
  28. read_pins_t scan(read_pins_mask_t& rowEnd);
  29. read_pins_t debounce(const read_pins_t rowState, read_pins_t& debounced);
  30. };
  31. #endif