keybrd library is an open source library for creating custom-keyboard firmware.
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
Este repositório está arquivado. Você pode visualizar os arquivos e realizar clone, mas não poderá realizar push nem abrir issues e pull requests.

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