keybrd library is an open source library for creating custom-keyboard firmware.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
此仓库已存档。您可以查看文件和克隆,但不能推送或创建工单/合并请求。

StrobePort_PCA9655E.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef STROBEPORT_PCA9655E_H
  2. #define STROBEPORT_PCA9655E_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <Wire.h>
  6. #include <StrobePort.h>
  7. #include "IOEPort.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. IOEPort port0(0, 0);
  15. StrobePort_PCA9655E rowPort0(port0);
  16. Example instantiation for row port 1:
  17. IOEPort port1(1, 0);
  18. StrobePort_PCA9655E rowPort1(port1);
  19. Diode orientation
  20. ----------------
  21. PCA9655E does not have internal pull-up resistors, external pull-down resistors are required.
  22. Rows, columns, and diode orientation are explained in Matrix.h
  23. PCA9655E data sheet
  24. ----------------
  25. http://www.onsemi.com/pub_link/Collateral/PCA9655E-D.PDF
  26. */
  27. class StrobePort_PCA9655E : public StrobePort
  28. {
  29. private:
  30. IOEPort& port;
  31. const uint8_t configurationByteCommand;
  32. const uint8_t outputByteCommand;
  33. public:
  34. //The constructor initialization list is in .cpp
  35. StrobePort_PCA9655E(IOEPort& port);
  36. void begin();
  37. virtual void write(const uint8_t pin, const bool level);
  38. };
  39. #endif