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.

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef ROW_H
  2. #define ROW_H
  3. #include <RowBase.h>
  4. #include <RowScanner_PinsArray.h>
  5. #include <Debouncer_4Samples.h>
  6. /* Row_uC is a row connected to a micro controller.
  7. Instantiation
  8. -------------
  9. Definition of DELAY_MICROSECONDS is explained in RowBase.cpp.
  10. todo Definition of activeHigh is explained in RowScanner_Interface.h
  11. Example instantiation of a row:
  12. const unsigned int RowBase::DELAY_MICROSECONDS = 1000;
  13. const bool RowScanner_PinsArray::activeHigh = 0;
  14. const uint8_t colPins[] = {0,1,2,3,7,8};
  15. const uint8_t COL_PIN_COUNT = sizeof(colPins)/sizeof(*colPins);
  16. Key* const ptrsKeys_0[] = { &k_00, &k_01, &k_02, &k_03, &k_04, &k_05 };
  17. Row_uC row_0(21, colPins, COL_PIN_COUNT, ptrsKeys_0);
  18. Number of colPins should equal number of keys in ptrsKeys_0[] array.
  19. if a colPin is missing, a key will be unresposive
  20. if a Key pointer is missing, the keyboard will fail in an unprdictable way
  21. */
  22. class Row_uC : public RowBase
  23. {
  24. private:
  25. RowScanner_PinsArray scanner;
  26. Debouncer_4Samples debouncer;
  27. public:
  28. Row_uC(const uint8_t strobePin, const uint8_t readPins[], const uint8_t READ_PIN_COUNT,
  29. Key *const ptrsKeys[])
  30. : RowBase(ptrsKeys), scanner(strobePin, readPins, READ_PIN_COUNT) { }
  31. void process();
  32. };
  33. #endif