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

ReadPort.h 689B

12345678910111213141516171819202122
  1. #ifndef READPORT_H
  2. #define READPORT_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. /*
  6. ReadPort is an abstract base class.
  7. Port classes are the keybrd library's interface to microcontoller ports or I/O expander ports.
  8. */
  9. class ReadPort
  10. {
  11. protected:
  12. const uint8_t readPins; //bitwise pin configuration, 1 means read column
  13. uint8_t portState; //bitwise pin values, which is set in read()
  14. public:
  15. ReadPort(const uint8_t readPins): readPins(readPins), portState(0) {}
  16. //read port and store it's pins values in portState
  17. virtual uint8_t read()=0;
  18. uint8_t getColPins();
  19. };
  20. #endif