keybrd library is an open source library for creating custom-keyboard firmware.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

RowScanner_BitManipulation.h 975B

1234567891011121314151617181920212223242526
  1. #ifndef ROWSCANNER_BITMANIPULATION_H
  2. #define ROWSCANNER_BITMANIPULATION_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <RowScannerInterface.h>
  6. #include <RowPort.h>
  7. #include <ColPort.h>
  8. class RowScanner_BitManipulation : public RowScannerInterface
  9. {
  10. private:
  11. RowPort &refRowPort; //this row's IC port
  12. const uint8_t rowPin; //bitwise, 1 indicates IC pin connected to this row
  13. ColPort *const *const ptrsColPorts; //array of column ports
  14. const uint8_t colPortCount;
  15. public:
  16. RowScanner_BitManipulation(RowPort &refRowPort, const uint8_t rowPin,
  17. ColPort *const ptrsColPorts[], const uint8_t colPortCount)
  18. : refRowPort(refRowPort), rowPin(rowPin),
  19. ptrsColPorts(ptrsColPorts), colPortCount(colPortCount) {}
  20. virtual uint8_t scan(uint16_t& rowEnd, const bool activeHigh);
  21. uint8_t getRowState(uint16_t& rowEnd, const bool activeHigh);
  22. };
  23. #endif