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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef ROWIOE_H
  2. #define ROWIOE_H
  3. #include <RowBase.h>
  4. #include <RowScanner_PinsBitwise.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. 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 IOExpanderPort::ADDR = 0x18;
  15. IOExpanderPort port1(1, 0);
  16. RowPort_PCA9655E rowPort1(port1);
  17. IOExpanderPort port0(0, 0);
  18. ColPort_PCA9655E colPort0(port0, 1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 );
  19. Key* const ptrsKeys_0[] = { &k_00, &k_01, &k_02, &k_03, &k_04, &k_05 };
  20. Row_IOE row_0(rowPort1, 1<<0, colPort0, ptrsKeys_0);
  21. Number of pins in colPort0 should equal number of keys in ptrsKeys_0[] array.
  22. if a pin is missing, a key will be unresposive
  23. if a Key pointer is missing, the keyboard will fail in an unprdictable way
  24. */
  25. class Row_IOE : public RowBase
  26. {
  27. private:
  28. RowScanner_PinsBitwise scanner;
  29. Debouncer_4Samples debouncer;
  30. public:
  31. Row_IOE( RowPort& refRowPort, const uint8_t strobePin,
  32. ColPort& refColPort, Key *const ptrsKeys[])
  33. : RowBase(ptrsKeys), scanner(refRowPort, strobePin, refColPort) { }
  34. void process();
  35. };
  36. #endif