Fork of the espurna firmware for `mhsw` switches
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.

29 lines
773 B

  1. /*
  2. MCP23S08 MODULE
  3. Copyright (C) 2020 by Eddi De Pieri <eddi at depieri dot com>
  4. Adapted from https://github.com/kmpelectronics/Arduino
  5. Copyright (C) 2016 Plamen Kovandjiev <p.kovandiev@kmpelectronics.eu> & Dimitar Antonov <d.antonov@kmpelectronics.eu>
  6. (ref. https://github.com/kmpelectronics/Arduino/blob/master/ProDinoWiFiEsp/src/PRODINoESP8266/src/KMPDinoWiFiESP.cpp)
  7. */
  8. #pragma once
  9. #include "espurna.h"
  10. constexpr size_t McpGpioPins = 8;
  11. void MCP23S08Setup();
  12. uint8_t MCP23S08ReadRegister(uint8_t address);
  13. void MCP23S08WriteRegister(uint8_t address, uint8_t data);
  14. void MCP23S08SetDirection(uint8_t pinNumber, uint8_t mode);
  15. void MCP23S08SetPin(uint8_t pinNumber, bool state);
  16. bool MCP23S08GetPin(uint8_t pinNumber);
  17. bool mcpGpioValid(unsigned char gpio);