Including an external board helper library and calling a function

I have a project that involves deep sleep, so I want to make sure I am as frugal with power consumption as I can be. The board I will be using is a TinyPico.

The TinyPico has a helper library that exposes additional functionality and, in this case, I want to use its ability to cut power to a LED. The problem is that I can’t get the library to be included, let alone call the function in question.

The Helper library is available here on PIO, and there is more information on the website. The source is available on GitHub.

When including the library via the documented process:

esphome:
  name: test
  libraries: 
    - tinypico/TinyPICO Helper Library@^1.4.0

It fails to detect the SPI inclusion that I have in the config:

Compiling /data/test/.pioenvs/test/lib1ef/TinyPICO Helper Library/TinyPICO.cpp.o
In file included from /data/test/.piolibdeps/test/TinyPICO Helper Library/src/TinyPICO.cpp:18:0:
/data/test/.piolibdeps/test/TinyPICO Helper Library/src/TinyPICO.h:44:18: fatal error: SPI.h: No such file or directory

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

  #include <SPI.h>
                  ^
compilation terminated.
*** [/data/test/.pioenvs/test/lib1ef/TinyPICO Helper Library/TinyPICO.cpp.o] Error 1
========================== [FAILED] Took 1.39 seconds ==========================

SPI is correctly set in the config and compiles properly when the helper library is commented out:

spi:
  clk_pin: GPIO18
  mosi_pin: GPIO23
  miso_pin: GPIO19

Frankly I don’t care if I use the helper library or can call the functionality behind DotStar_SetPower directly but don’t know how to proceed.

Has anyone successfully accessed the embedded functionality of the TinyPico?

Is it the difference between including spi.h from the esphome files and SPI.h that the library is expecting?

Yes – you’re right. I hadn’t noticed the difference in capitalisation. I tried editing the TinyPICO.h file to lower the case, but the error remains seemingly identical:

INFO Reading configuration /config/esphome/test-humid.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing test-humid (board: tinypico; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <TinyPICO Helper Library> 1.4.0
|-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|-- <Update> 1.0
|-- <SPI> 1.0
|-- <Wire> 1.0.1
Compiling /data/test-humid/.pioenvs/test-humid/lib1ef/TinyPICO Helper Library/TinyPICO.cpp.o
Compiling /data/test-humid/.pioenvs/test-humid/lib64d/WiFi/WiFi.cpp.o
In file included from /data/test-humid/.piolibdeps/test-humid/TinyPICO Helper Library/src/TinyPICO.cpp:18:0:
/data/test-humid/.piolibdeps/test-humid/TinyPICO Helper Library/src/TinyPICO.h:44:18: fatal error: SPI.h: No such file or directory

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

  #include <SPI.h>
                  ^
compilation terminated.
*** [/data/test-humid/.pioenvs/test-humid/lib1ef/TinyPICO Helper Library/TinyPICO.cpp.o] Error 1
========================== [FAILED] Took 0.99 seconds ==========================

I think platformio pulls in the library when it is pulled like this

libraries: 
    - tinypico/TinyPICO Helper Library@^1.4.0

Maybe download it, edit it and use the local copy.

includes:
    - mytinypico.h

Thanks. I will try this.