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í.

Scanner_Port.h 848B

1234567891011121314151617181920212223
  1. #ifndef SCANNER_PORT_H
  2. #define SCANNER_PORT_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <StrobePort.h>
  6. #include <ReadPort.h>
  7. /* Scanner_Port uses bit manipulation to read all pins of one port.
  8. The maximum keys per row is 8, because ports have a maximum of 8 pins each.
  9. */
  10. class Scanner_Port
  11. {
  12. private:
  13. static const bool STROBE_ON; //HIGH or LOW logic level of strobe on, active state
  14. StrobePort& refStrobePort; //this row's IC port
  15. const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row
  16. ReadPort& refReadPort;
  17. public:
  18. Scanner_Port(StrobePort &refStrobePort, const uint8_t strobePin, ReadPort& refReadPort)
  19. : refStrobePort(refStrobePort), strobePin(strobePin), refReadPort(refReadPort) {}
  20. uint8_t scan();
  21. };
  22. #endif