Skip to content

Platformio support #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bubulgum opened this issue Feb 13, 2025 · 12 comments
Open

Platformio support #19

bubulgum opened this issue Feb 13, 2025 · 12 comments

Comments

@bubulgum
Copy link

Hi. please make library for Platformio with CH422G. thx

@Lzw655
Copy link
Collaborator

Lzw655 commented Feb 14, 2025

Hi @bubulgum,

I think this library can be used in PlatformIO as follows. What issue are you encountering?

In platformio.ini file:

...
lib_deps =
    https://github.com/esp-arduino-libs/ESP32_IO_Expander.git
...

@bubulgum
Copy link
Author

Hi @bubulgum,

I think this library can be used in PlatformIO as follows. What issue are you encountering?

In platformio.ini file:

...
lib_deps =
    https://github.com/esp-arduino-libs/ESP32_IO_Expander.git
...

I'm using it with CH422G. On Arduino IDE this example works fine:

#include <esp_io_expander.hpp>

#define EXAMPLE_I2C_SDA_PIN (10)
#define EXAMPLE_I2C_SCL_PIN (4)
#define EXAMPLE_I2C_ADDR    (ESP_IO_EXPANDER_I2C_CH422G_ADDRESS) //default 0x24

esp_expander::CH422G *expander = NULL;

// Pin definitions for buttons
#define BUTTON_PIN_1 8
#define BUTTON_PIN_2 2
#define BUTTON_PIN_3 7
#define BUTTON_PIN_4 6
#define BUTTON_PIN_5 5

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("Test begin");

  expander = new esp_expander::CH422G(EXAMPLE_I2C_SCL_PIN, EXAMPLE_I2C_SDA_PIN, EXAMPLE_I2C_ADDR);
  expander->init();
  expander->begin();

  // Set all pins 0-7 as outputs for LEDs
  expander->enableAllIO_Output();

  // Set button pins as inputs with pull-up resistors
  pinMode(BUTTON_PIN_1, INPUT_PULLUP);
  pinMode(BUTTON_PIN_2, INPUT_PULLUP);
  pinMode(BUTTON_PIN_3, INPUT_PULLUP);
  pinMode(BUTTON_PIN_4, INPUT_PULLUP);
  pinMode(BUTTON_PIN_5, INPUT_PULLUP);

  // All LEDs are off by default (HIGH)
  expander->digitalWrite(0, HIGH);  // Turn off LED on pin IO0
  expander->digitalWrite(2, HIGH);  // Turn off LED on pin IO2
  expander->digitalWrite(4, HIGH);  // Turn off LED on pin IO4
  expander->digitalWrite(6, HIGH);  // Turn off LED on pin IO6
  expander->digitalWrite(8, HIGH);  // Turn off LED on pin OC0

  Serial.println("LEDs on IO0, IO2, IO4, IO6, and OC0 are set to output mode.");
}

void loop() {
  // Check the state of the buttons and turn on the corresponding LEDs
  if (digitalRead(BUTTON_PIN_1) == LOW) {  // Button 1 pressed (LOW is active)
    expander->digitalWrite(0, LOW);  // Turn on LED on pin IO0
    Serial.println("Button 1 pressed, LED IO0 ON");
  } else {
    expander->digitalWrite(0, HIGH);  // Turn off LED on pin IO0
  }

  if (digitalRead(BUTTON_PIN_2) == LOW) {  // Button 2 pressed
    expander->digitalWrite(2, LOW);  // Turn on LED on pin IO2
    Serial.println("Button 2 pressed, LED IO2 ON");
  } else {
    expander->digitalWrite(2, HIGH);  // Turn off LED on pin IO2
  }

  if (digitalRead(BUTTON_PIN_3) == LOW) {  // Button 3 pressed
    expander->digitalWrite(4, LOW);  // Turn on LED on pin IO4
    Serial.println("Button 3 pressed, LED IO4 ON");
  } else {
    expander->digitalWrite(4, HIGH);  // Turn off LED on pin IO4
  }

  if (digitalRead(BUTTON_PIN_4) == LOW) {  // Button 4 pressed
    expander->digitalWrite(6, LOW);  // Turn on LED on pin IO6
    Serial.println("Button 4 pressed, LED IO6 ON");
  } else {
    expander->digitalWrite(6, HIGH);  // Turn off LED on pin IO6
  }

  if (digitalRead(BUTTON_PIN_5) == LOW) {  // Button 5 pressed
    expander->digitalWrite(8, LOW);  // Turn on LED on pin OC0
    Serial.println("Button 5 pressed, LED OC0 ON");
  } else {
    expander->digitalWrite(8, HIGH);  // Turn off LED on pin OC0
  }

  delay(100);  // Delay to prevent button bounce
}

But with Palformio have a lot of issues:

Compiling .pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_ht8574.cpp.o
Compiling .pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_tca95xx_16bit.cpp.o
Compiling .pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_tca95xx_8bit.cpp.o
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_ch422g.cpp:7:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_expander_utils.h:10:10: fatal error: esp_lib_utils.h: No such file or directory

***********************************************************************
* Looking for esp_lib_utils.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_lib_utils.h"
* Web  > https://registry.platformio.org/search?q=header:esp_lib_utils.h
*
***********************************************************************

 #include "esp_lib_utils.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\port\esp_io_expander.c.o
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_ht8574.cpp:7:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_expander_utils.h:10:10: fatal error: esp_lib_utils.h: No such file or directory

***********************************************************************
* Looking for esp_lib_utils.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_lib_utils.h"
* Web  > https://registry.platformio.org/search?q=header:esp_lib_utils.h
*
***********************************************************************

 #include "esp_lib_utils.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
Compiling .pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\port\esp_io_expander_ch422g.c.o
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_ch422g.cpp.o] Error 1
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_ht8574.cpp.o] Error 1
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_tca95xx_16bit.cpp:7:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_expander_utils.h:10:10: fatal error: esp_lib_utils.h: No such file or directory

***********************************************************************
* Looking for esp_lib_utils.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_lib_utils.h"
* Web  > https://registry.platformio.org/search?q=header:esp_lib_utils.h
*
***********************************************************************

 #include "esp_lib_utils.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_tca95xx_8bit.cpp:7:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_expander_utils.h:10:10: fatal error: esp_lib_utils.h: No such file or directory

***********************************************************************
* Looking for esp_lib_utils.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_lib_utils.h"
* Web  > https://registry.platformio.org/search?q=header:esp_lib_utils.h
*
***********************************************************************

 #include "esp_lib_utils.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_tca95xx_8bit.cpp.o] Error 1
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_tca95xx_16bit.cpp.o] Error 1
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:9:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_expander_utils.h:10:10: fatal error: esp_lib_utils.h: No such file or directory

***********************************************************************
* Looking for esp_lib_utils.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_lib_utils.h"
* Web  > https://registry.platformio.org/search?q=header:esp_lib_utils.h
*
***********************************************************************

 #include "esp_lib_utils.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_base.cpp.o] Error 1
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/port/esp_io_expander.c:16:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_expander_utils.h:10:10: fatal error: esp_lib_utils.h: No such file or directory

***********************************************************************
* Looking for esp_lib_utils.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_lib_utils.h"
* Web  > https://registry.platformio.org/search?q=header:esp_lib_utils.h
*
***********************************************************************

 #include "esp_lib_utils.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\port\esp_io_expander.c.o] Error 1
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/port/esp_io_expander_ch422g.c:19:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_expander_utils.h:10:10: fatal error: esp_lib_utils.h: No such file or directory

***********************************************************************
* Looking for esp_lib_utils.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_lib_utils.h"
* Web  > https://registry.platformio.org/search?q=header:esp_lib_utils.h
*
***********************************************************************

 #include "esp_lib_utils.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\port\esp_io_expander_ch422g.c.o] Error 1
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_io_expander.hpp:17,
                 from src/main.cpp:40:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:29: error: 'variant' in namespace 'std' does not name a template type
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                             ^~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:24: note: 'std::variant' is only available from C++17 onwards
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                        ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<HostConfig> host;     /*!< I2C host configuration */
              ^~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<HostConfig> host;     /*!< I2C host configuration */
         ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In member function 'bool esp_expander::Base::Config::isHostConfigValid() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: error: 'host' was not declared in this scope
             return host.has_value();
                    ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: note: suggested alternative: 'cosl'
             return host.has_value();
                    ^~~~
                    cosl
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:102:13: error: no matching function for call to 'esp_expander::Base::HostPartialConfig::HostPartialConfig(<brace-enclosed initializer list>)'
             },
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig()'
     struct HostPartialConfig {
            ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(const esp_expander::Base::HostPartialConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(esp_expander::Base::HostPartialConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:105:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:106:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:122:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:123:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
*** [.pio\build\adafruit_qtpy_esp32c3\src\main.cpp.o] Error 1```

@Lzw655
Copy link
Collaborator

Lzw655 commented Feb 14, 2025

The esp-lib-utils library is a dependency of the ESP32_IO_Expander library, please add it as follows:

...
lib_deps =
https://github.com/esp-arduino-libs/esp-lib-utils.git#v0.2.0
https://github.com/esp-arduino-libs/ESP32_IO_Expander.git
...

@bubulgum
Copy link
Author

The esp-lib-utils library is a dependency of the ESP32_IO_Expander library, please add it as follows:

... lib_deps = https://github.com/esp-arduino-libs/esp-lib-utils.git#v0.2.0 https://github.com/esp-arduino-libs/ESP32_IO_Expander.git ...

this will make more trouble.

In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/esp_io_expander.hpp:17,
                 from src/main.cpp:2:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:29: error: 'variant' in namespace 'std' does not name a template type
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                             ^~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:24: note: 'std::variant' is only available from C++17 onwards
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                        ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<HostConfig> host;     /*!< I2C host configuration */
              ^~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<HostConfig> host;     /*!< I2C host configuration */
         ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In member function 'bool esp_expander::Base::Config::isHostConfigValid() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: error: 'host' was not declared in this scope
             return host.has_value();
                    ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: note: suggested alternative: 'cosl'
             return host.has_value();
                    ^~~~
                    cosl
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:102:13: error: no matching function for call to 'esp_expander::Base::HostPartialConfig::HostPartialConfig(<brace-enclosed initializer list>)'
             },
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig()'
     struct HostPartialConfig {
            ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(const esp_expander::Base::HostPartialConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(esp_expander::Base::HostPartialConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:105:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:106:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:122:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:123:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
Compiling .pio\build\adafruit_qtpy_esp32c3\FrameworkArduino\Esp.cpp.o
*** [.pio\build\adafruit_qtpy_esp32c3\src\main.cpp.o] Error 1
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_tca95xx_16bit.hpp:9,
                 from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_tca95xx_16bit.cpp:9:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:29: error: 'variant' in namespace 'std' does not name a template type
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                             ^~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:24: note: 'std::variant' is only available from C++17 onwards
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                        ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<HostConfig> host;     /*!< I2C host configuration */
              ^~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<HostConfig> host;     /*!< I2C host configuration */
         ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In member function 'bool esp_expander::Base::Config::isHostConfigValid() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: error: 'host' was not declared in this scope
             return host.has_value();
                    ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: note: suggested alternative: 'short'
             return host.has_value();
                    ^~~~
                    short
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:102:13: error: no matching function for call to 'esp_expander::Base::HostPartialConfig::HostPartialConfig(<brace-enclosed initializer list>)'
             },
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig()'
     struct HostPartialConfig {
            ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(const esp_expander::Base::HostPartialConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(esp_expander::Base::HostPartialConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:105:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:106:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_tca95xx_8bit.hpp:9,
                 from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_tca95xx_8bit.cpp:9:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:29: error: 'variant' in namespace 'std' does not name a template type
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                             ^~~~~~~
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_ch422g.hpp:9,
                 from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_ch422g.cpp:9:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:29: error: 'variant' in namespace 'std' does not name a template type
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                             ^~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:24: note: 'std::variant' is only available from C++17 onwards
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                        ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:24: note: 'std::variant' is only available from C++17 onwards
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                        ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<HostConfig> host;     /*!< I2C host configuration */
              ^~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<HostConfig> host;     /*!< I2C host configuration */
         ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<HostConfig> host;     /*!< I2C host configuration */
              ^~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<HostConfig> host;     /*!< I2C host configuration */
         ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:122:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In member function 'bool esp_expander::Base::Config::isHostConfigValid() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: error: 'host' was not declared in this scope
             return host.has_value();
                    ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In member function 'bool esp_expander::Base::Config::isHostConfigValid() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: error: 'host' was not declared in this scope
             return host.has_value();
                    ^~~~
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_ht8574.hpp:9,
                 from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_ht8574.cpp:9:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:29: error: 'variant' in namespace 'std' does not name a template type
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                             ^~~~~~~
In file included from .pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:10:
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:29: error: 'variant' in namespace 'std' does not name a template type
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                             ^~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:24: note: 'std::variant' is only available from C++17 onwards
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                        ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:123:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:54:24: note: 'std::variant' is only available from C++17 onwards
     using HostConfig = std::variant<HostPartialConfig, HostFullConfig>;
                        ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<HostConfig> host;     /*!< I2C host configuration */
              ^~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:14: error: 'optional' in namespace 'std' does not name a template type
         std::optional<HostConfig> host;     /*!< I2C host configuration */
              ^~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<HostConfig> host;     /*!< I2C host configuration */
         ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:74:9: note: 'std::optional' is only available from C++17 onwards
         std::optional<HostConfig> host;     /*!< I2C host configuration */
         ^~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In member function 'bool esp_expander::Base::Config::isHostConfigValid() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: error: 'host' was not declared in this scope
             return host.has_value();
                    ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: note: suggested alternative: 'short'
             return host.has_value();
                    ^~~~
                    short
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: note: suggested alternative: 'short'
             return host.has_value();
                    ^~~~
                    short
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:102:13: error: no matching function for call to 'esp_expander::Base::HostPartialConfig::HostPartialConfig(<brace-enclosed initializer list>)'
             },
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:102:13: error: no matching function for call to 'esp_expander::Base::HostPartialConfig::HostPartialConfig(<brace-enclosed initializer list>)'
             },
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig()'
     struct HostPartialConfig {
            ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig()'
     struct HostPartialConfig {
            ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(const esp_expander::Base::HostPartialConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(const esp_expander::Base::HostPartialConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(esp_expander::Base::HostPartialConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(esp_expander::Base::HostPartialConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:105:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:105:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In member function 'bool esp_expander::Base::Config::isHostConfigValid() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: error: 'host' was not declared in this scope
             return host.has_value();
                    ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: note: suggested alternative: 'short'
             return host.has_value();
                    ^~~~
                    short
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:106:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:106:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:102:13: error: no matching function for call to 'esp_expander::Base::HostPartialConfig::HostPartialConfig(<brace-enclosed initializer list>)'
             },
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:70:20: note: suggested alternative: 'short'
             return host.has_value();
                    ^~~~
                    short
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig()'
     struct HostPartialConfig {
            ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(const esp_expander::Base::HostPartialConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(esp_expander::Base::HostPartialConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:105:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:102:13: error: no matching function for call to 'esp_expander::Base::HostPartialConfig::HostPartialConfig(<brace-enclosed initializer list>)'
             },
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig()'
     struct HostPartialConfig {
            ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:122:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:122:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_tca95xx_16bit.cpp.o] Error 1
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(const esp_expander::Base::HostPartialConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note: candidate: 'constexpr esp_expander::Base::HostPartialConfig::HostPartialConfig(esp_expander::Base::HostPartialConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:106:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:46:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:123:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:123:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:105:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:106:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 3 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:122:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp: In constructor 'esp_expander::Base::Base(int, uint8_t)':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:122:13: error: no matching function for call to 'esp_expander::Base::DeviceConfig::DeviceConfig(<brace-enclosed initializer list>)'
             }
             ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig()'
     struct DeviceConfig {
            ^~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   candidate expects 0 arguments, 1 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(const esp_expander::Base::DeviceConfig&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'const esp_expander::Base::DeviceConfig&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note: candidate: 'constexpr esp_expander::Base::DeviceConfig::DeviceConfig(esp_expander::Base::DeviceConfig&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:56:12: note:   no known conversion for argument 1 from 'uint8_t' {aka 'unsigned char'} to 'esp_expander::Base::DeviceConfig&&'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:123:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:123:9: error: no matching function for call to 'esp_expander::Base::Config::Config(<brace-enclosed initializer list>)'
         }
         ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config()'
     struct Config {
            ^~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 0 arguments, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(const esp_expander::Base::Config&)'     
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note: candidate: 'constexpr esp_expander::Base::Config::Config(esp_expander::Base::Config&&)'
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.hpp:63:12: note:   candidate expects 1 argument, 2 provided
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp: In member function 'void esp_expander::Base::Config::convertPartialToFull()':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:21:37: error: 'holds_alternative' is not a member of 'std'
     if (isHostConfigValid() && std::holds_alternative<HostPartialConfig>(host.value())) {
                                     ^~~~~~~~~~~~~~~~~
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_ch422g.cpp.o] Error 1
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:21:72: error: expected primary-expression before '>' token
     if (isHostConfigValid() && std::holds_alternative<HostPartialConfig>(host.value())) {
                                                                        ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:21:74: error: 'host' was not declared in this scope
     if (isHostConfigValid() && std::holds_alternative<HostPartialConfig>(host.value())) {
                                                                          ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:21:74: note: suggested alternative: 'short'
     if (isHostConfigValid() && std::holds_alternative<HostPartialConfig>(host.value())) {
                                                                          ^~~~
                                                                          short
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp: In member function 'void esp_expander::Base::Config::printHostConfig() const':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:51:14: error: 'holds_alternative' is not a member of 'std'
     if (std::holds_alternative<HostFullConfig>(host.value())) {
              ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:51:46: error: expected primary-expression before '>' token
     if (std::holds_alternative<HostFullConfig>(host.value())) {
                                              ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:51:48: error: 'host' was not declared in this scope
     if (std::holds_alternative<HostFullConfig>(host.value())) {
                                                ^~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:51:48: note: suggested alternative: 'short'
     if (std::holds_alternative<HostFullConfig>(host.value())) {
                                                ^~~~
                                                short
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_tca95xx_8bit.cpp.o] Error 1
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp: In member function 'esp_expander::Base::HostFullConfig* esp_expander::Base::getHostFullConfig()':
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:309:14: error: 'holds_alternative' is not a member of 'std'
     if (std::holds_alternative<HostPartialConfig>(_config.host.value())) {
              ^~~~~~~~~~~~~~~~~
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:309:49: error: expected primary-expression before '>' token
     if (std::holds_alternative<HostPartialConfig>(_config.host.value())) {
                                                 ^
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:309:59: error: 'struct esp_expander::Base::Config' has no member named 'host'; did you mean 'host_id'?        
     if (std::holds_alternative<HostPartialConfig>(_config.host.value())) {
                                                           ^~~~
                                                           host_id
.pio/libdeps/adafruit_qtpy_esp32c3/ESP32_IO_Expander/src/chip/esp_expander_base.cpp:313:46: error: 'struct esp_expander::Base::Config' has no member named 'host'; did you mean 'host_id'?        
     return &std::get<HostFullConfig>(_config.host.value());
                                              ^~~~
                                              host_id
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_ht8574.cpp.o] Error 1
*** [.pio\build\adafruit_qtpy_esp32c3\lib6a2\ESP32_IO_Expander\chip\esp_expander_base.cpp.o] Error 1````

@Lzw655
Copy link
Collaborator

Lzw655 commented Feb 14, 2025

It looks like your build environment does not support C++17. Maybe you can use an older version v0.1.0 that does not depend on esp-lib-utils?

@bubulgum
Copy link
Author

bubulgum commented Feb 14, 2025

I've tried build_flags = -std=c++17 but still same issue.
v0.1.0 also have errors, but mostly about the code commands, i will check this late also. thank you

@Jason2866
Copy link

Jason2866 commented Feb 15, 2025

@bubulgum Please post your platformio.ini The driver needs Arduino 3.x / >=IDF 5.1 so you have to use the Platformio fork pioarduino

@bubulgum
Copy link
Author

@bubulgum Please post your platformio.ini The driver needs Arduino 3.x / >=IDF 5.1 so you have to use the Platformio fork pioarduino

please have a look

[env:adafruit_qtpy_esp32c3]
platform = espressif32
board = adafruit_qtpy_esp32c3
framework = arduino
monitor_speed = 115200
upload_port = COM4
monitor_port = COM4
lib_deps = adafruit/Adafruit NeoPixel@^1.12.4```

@Jason2866
Copy link

Jason2866 commented Feb 18, 2025

Official Platformio only supports Arduino core 2.0.17. So the config can not work.
Try this. It uses pioarduino which provides actual core 3.x.x support.

[env:adafruit_qtpy_esp32c3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = adafruit_qtpy_esp32c3
framework = arduino
monitor_speed = 115200
upload_port = COM4
monitor_port = COM4
lib_deps = 
    adafruit/Adafruit NeoPixel@^1.12.4
    https://github.com/esp-arduino-libs/ESP32_IO_Expander.git

@bubulgum
Copy link
Author

Official Platformio only supports Arduino core 2.0.17. So the config can not work. Try this. It uses pioarduino which provides actual core 3.x.x support.

[env:adafruit_qtpy_esp32c3]
platform = https://github.com/pioarduino/platform-espressif32/releases/download/stable/platform-espressif32.zip
board = adafruit_qtpy_esp32c3
framework = arduino
monitor_speed = 115200
upload_port = COM4
monitor_port = COM4
lib_deps = 
    adafruit/Adafruit NeoPixel@^1.12.4
    https://github.com/esp-arduino-libs/ESP32_IO_Expander.git

Thank you for your support, after core was updated, everything work on Platformio.

[env:esp32-c3-devkitm-1]
platform = espressif32
board = esp32-c3-devkitm-1
framework = arduino
board_build.filesystem = spiffs
upload_protocol = esptool
board_build.partitions = default.csv
monitor_speed = 115200
lib_deps =
              https://github.com/esp-arduino-libs/esp-lib-utils.git#v0.2.0
              https://github.com/esp-arduino-libs/ESP32_IO_Expander.git```

@bubulgum
Copy link
Author

bubulgum commented Feb 19, 2025

Could you provide more support, i could make working LEDs and buttons on my board with ESP32C3 with CH422 and library.

#include <Arduino.h>
#include <esp_io_expander.hpp>

#define EXAMPLE_I2C_SDA_PIN (10)
#define EXAMPLE_I2C_SCL_PIN (4)
#define EXAMPLE_I2C_ADDR    (ESP_IO_EXPANDER_I2C_CH422G_ADDRESS) // default 0x24

esp_expander::CH422G *expander = NULL;

// Pin definitions for buttons
#define BUTTON_PIN_1 8
#define BUTTON_PIN_2 2
#define BUTTON_PIN_3 7
#define BUTTON_PIN_4 6
#define BUTTON_PIN_5 5

void setup() {
  Serial.begin(115200);
  delay(1000);
  Serial.println("Test begin");

  expander = new esp_expander::CH422G(EXAMPLE_I2C_SCL_PIN, EXAMPLE_I2C_SDA_PIN, EXAMPLE_I2C_ADDR);
  expander->init();
  expander->begin();

  // Set all pins 0-7 as outputs for LEDs
  expander->enableAllIO_Output();

  // Set button pins as inputs with pull-up resistors
  pinMode(BUTTON_PIN_1, INPUT_PULLUP);
  pinMode(BUTTON_PIN_2, INPUT_PULLUP);
  pinMode(BUTTON_PIN_3, INPUT_PULLUP);
  pinMode(BUTTON_PIN_4, INPUT_PULLUP);
  pinMode(BUTTON_PIN_5, INPUT_PULLUP);

  // All LEDs are off by default (HIGH)
  expander->digitalWrite(0, HIGH);  // Turn off LED on pin IO0
  expander->digitalWrite(2, HIGH);  // Turn off LED on pin IO2
  expander->digitalWrite(4, HIGH);  // Turn off LED on pin IO4
  expander->digitalWrite(6, HIGH);  // Turn off LED on pin IO6
  expander->digitalWrite(8, HIGH);  // Turn off LED on pin OC0

  expander->digitalWrite(1, HIGH);  // Turn off LED on pin IO1
  expander->digitalWrite(3, HIGH);  // Turn off LED on pin IO3
  expander->digitalWrite(5, HIGH);  // Turn off LED on pin IO5
  expander->digitalWrite(7, HIGH);  // Turn off LED on pin IO7
  expander->digitalWrite(9, HIGH);  // Turn off LED on pin OC1

  Serial.println("LEDs on IO0, IO2, IO4, IO6, and OC0 are set to output mode.");
}

void loop() {
  // Check the button states and turn on corresponding LEDs
  if (digitalRead(BUTTON_PIN_1) == LOW) {  // Button 1 pressed (LOW is active)
    expander->digitalWrite(1, LOW);  // Turn on LED on pin IO0
    Serial.println("Button 1 pressed, LED IO0 ON");
  } else {
    expander->digitalWrite(1, HIGH);  // Turn off LED on pin IO0
  }

  if (digitalRead(BUTTON_PIN_2) == LOW) {  // Button 2 pressed
    expander->digitalWrite(3, LOW);  // Turn on LED on pin IO2
    Serial.println("Button 2 pressed, LED IO2 ON");
  } else {
    expander->digitalWrite(3, HIGH);  // Turn off LED on pin IO2
  }

  if (digitalRead(BUTTON_PIN_3) == LOW) {  // Button 3 pressed
    expander->digitalWrite(5, LOW);  // Turn on LED on pin IO4
    Serial.println("Button 3 pressed, LED IO4 ON");
  } else {
    expander->digitalWrite(5, HIGH);  // Turn off LED on pin IO4
  }

  if (digitalRead(BUTTON_PIN_4) == LOW) {  // Button 4 pressed
    expander->digitalWrite(7, LOW);  // Turn on LED on pin IO6
    Serial.println("Button 4 pressed, LED IO6 ON");
  } else {
    expander->digitalWrite(7, HIGH);  // Turn off LED on pin IO6
  }

  if (digitalRead(BUTTON_PIN_5) == LOW) {  // Button 5 pressed
    expander->digitalWrite(9, LOW);  // Turn on LED on pin OC0
    Serial.println("Button 5 pressed, LED OC0 ON");
  } else {
    expander->digitalWrite(9, HIGH);  // Turn off LED on pin OC0
  }

  delay(100);  // Delay to prevent button debounce
}

Scan I2C found this address:

1.) 0x20
2.) 0x21
3.) 0x22
4.) 0x23
5.) 0x24
6.) 0x25
7.) 0x26
8.) 0x27
9.) 0x30
10.) 0x31
11.) 0x32
12.) 0x33
13.) 0x34
14.) 0x35
15.) 0x36
16.) 0x37
17.) 0x38
18.) 0x39
19.) 0x3A
20.) 0x3B
21.) 0x3C
22.) 0x3D
23.) 0x3E
24.) 0x3F

Looks like all belong to CH422G, But I also have OLED display on this board that using I2C with same SDA and SCL on address 0x3C.
So CH422G and Display share same address.
I can't find the way to connect to display (i can't change address physically).

So my question is: How put CH422G to SLEEP mode using library?
Or maybe there is another way to connect to display on address 0x3C.
Any help appreciated.

@Lzw655
Copy link
Collaborator

Lzw655 commented Feb 19, 2025

Hi @bubulgum,

CH422G currently does not support entering sleep mode. I have added this feature in the feat/ch422g_support_sleep branch, please give it a try.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants