keybrd library is an open source library for creating custom-keyboard firmware.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.
Tento repozitář je archivovaný. Můžete prohlížet soubory, klonovat, ale nemůžete nahrávat a vytvářet nové úkoly a požadavky na natažení.

ColPort_PCA9655E.h 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef COLPORT_PCA9655E_H
  2. #define COLPORT_PCA9655E_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <Wire.h>
  6. #include <ColPort.h>
  7. #include "IOExpanderPort.h"
  8. /* One PCA9655E I/O expander port connected to matrix columns.
  9. PCA9655E does not have internal pull-up resistors (PCA9535E does).
  10. Instantiation
  11. ------------
  12. colPins parameter is port's bitwise pin configuration
  13. 1=configure as input (for pins connected to column)
  14. 0=configure as output (for LED or not connected to a column)
  15. Example instantiation for column port 0, with pins 2 and 3 connected to columns:
  16. IOExpanderPort port0(0, 0);
  17. ColPort_PCA9655E colPort0(port0, 2<<0 | 1<<3 );
  18. Example instantiation for column port 1, with pins 2 and 3 connected to columns:
  19. IOExpanderPort port1(1, 0);
  20. ColPort_PCA9655E colPort1(port1, 2<<0 | 1<<3 );
  21. colPins are read from pin 0 on up.
  22. Diode orientation
  23. ----------------
  24. Rows, columns, and diode orientation are explained in Matrix.h
  25. */
  26. class ColPort_PCA9655E : public ColPort
  27. {
  28. private:
  29. IOExpanderPort& port;
  30. const uint8_t configurationByteCommand;
  31. const uint8_t inputByteCommand;
  32. public:
  33. //The constructor initialization list is in .cpp
  34. ColPort_PCA9655E(IOExpanderPort& port, const uint8_t colPins);
  35. void begin();
  36. //read port and store result in portState
  37. virtual void read();
  38. };
  39. #endif