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.

RowPort_PCA9655E.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef ROWPORT_PCA9655E_H
  2. #define ROWPORT_PCA9655E_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <Wire.h>
  6. #include <RowPort.h>
  7. #include "IOExpanderPort.h"
  8. /* One PCA9655E I/O expander port connected to matrix rows.
  9. begin() configures column port's configuration and output.
  10. This should normally be called only once.
  11. Instantiation
  12. ------------
  13. Example instantiation for row port 0:
  14. IOExpanderPort port0(0, 0);
  15. RowPort_PCA9655E rowPort0(port0);
  16. Example instantiation for row port 1:
  17. IOExpanderPort port1(1, 0);
  18. RowPort_PCA9655E rowPort1(port1);
  19. Diode orientation
  20. ----------------
  21. Rows, columns, and diode orientation are explained in Matrix.h
  22. PCA9655E data sheet
  23. ----------------
  24. http://www.onsemi.com/pub_link/Collateral/PCA9655E-D.PDF
  25. */
  26. class RowPort_PCA9655E : public RowPort
  27. {
  28. private:
  29. IOExpanderPort& port;
  30. const uint8_t configurationByteCommand;
  31. const uint8_t outputByteCommand;
  32. public:
  33. //The constructor initialization list is in .cpp
  34. RowPort_PCA9655E(IOExpanderPort& port);
  35. void begin();
  36. virtual void setActivePinLow(const uint8_t activePin); //activePin is a port mask
  37. virtual void setActivePinHigh(const uint8_t activePin);
  38. };
  39. #endif