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

RowPort_AVR_Optic.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef ROWPORT_AVR_OPTIC_H
  2. #define ROWPORT_AVR_OPTIC_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <RowPort.h>
  6. /* One AVR microcontroller port connected to matrix rows.
  7. setActivePinHigh() has a delay to allow phototransistors time to sense strobe
  8. (DodoHand has optic switches with phototransistors).
  9. Instantiation
  10. ------------
  11. The constructor configures all pins of port as output (for strobe pins and LED).
  12. The 'x' in parameters DDRx, PORTx, and PINx should all be the same letter.
  13. Example instantiation for row port F:
  14. RowPort_AVR_Optic rowPortF(DDRF, PORTF);
  15. Diode orientation
  16. ----------------
  17. Rows, columns, and diode orientation are explained in Matrix.h
  18. */
  19. class RowPort_AVR_Optic : public RowPort
  20. {
  21. private:
  22. const volatile unsigned char& DDR; //Data Direction Register
  23. protected:
  24. volatile unsigned char& PORT; //PORT register
  25. public:
  26. //The constructor initialization list is in .cpp
  27. RowPort_AVR_Optic(volatile unsigned char& DDRx, volatile unsigned char& PORTx);
  28. virtual void setActivePinLow(const uint8_t activePin); //activePin is a port mask
  29. virtual void setActivePinHigh(const uint8_t activePin);
  30. };
  31. #endif