keybrd library is an open source library for creating custom-keyboard firmware.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
Это архивный репозиторий. Вы можете его клонировать или просматривать файлы, но не вносить изменения или открывать задачи/запросы на слияние.

RowScanner_PinsBitwise.h 999B

1234567891011121314151617181920212223242526
  1. #ifndef ROWSCANNER_PINSBITWISE_H
  2. #define ROWSCANNER_PINSBITWISE_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <RowScannerInterface.h>
  6. #include <RowPort.h>
  7. #include <ColPort.h>
  8. /* RowScanner_PinsBitwise uses bit manipulation to read all pins of one port.
  9. The maximum keys per row is 8, because ports have a maximum of 8 pins each.
  10. */
  11. class RowScanner_PinsBitwise : public RowScannerInterface
  12. {
  13. private:
  14. RowPort& refRowPort; //this row's IC port
  15. const uint8_t strobePin; //bitwise, 1 indicates IC pin connected to this row
  16. ColPort& refColPort;
  17. public:
  18. RowScanner_PinsBitwise(RowPort &refRowPort, const uint8_t strobePin,
  19. ColPort& refColPort)
  20. : refRowPort(refRowPort), strobePin(strobePin),
  21. refColPort(refColPort) {}
  22. static const bool activeHigh; //logic level of strobe pin: 0=activeLow, 1=activeHigh
  23. virtual ColPort* const scan(read_pins_mask_t& rowEnd);
  24. };
  25. #endif