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.

LED_Port.h 750B

123456789101112131415161718192021222324252627
  1. #ifndef LED_PORT_H
  2. #define LED_PORT_H
  3. #include <Arduino.h>
  4. #include <inttypes.h>
  5. #include <LEDInterface.h>
  6. #include <PortInterface.h>
  7. /* An LED_Port object is an I/O expander pin that is connected to an LED indicator light.
  8. Example initialization:
  9. const uint8_t IOE_ADDR = 0x20;
  10. Port_MCP23S17 portA(IOE_ADDR, 0, 1<<0 | 1<<1 );
  11. LED_Port LED_fn(portA, 1<<5);
  12. */
  13. class LED_Port : public LEDInterface
  14. {
  15. private:
  16. PortInterface& refPort;
  17. const uint8_t pin; //bit pattern, 1 is IOE pin to LED
  18. public:
  19. LED_Port(PortInterface& refPort, const uint8_t pin)
  20. : refPort(refPort), pin(pin) {}
  21. virtual void on();
  22. virtual void off();
  23. };
  24. #endif