Move I2C into a separate component.

This commit is contained in:
2025-11-01 16:46:15 -04:00
parent 7d87b35b1c
commit 83473c4899
11 changed files with 2340 additions and 98 deletions

4
esp/cpp/08_dht11-lcd/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
build
managed_components
dependencies.lock
sdkconfig.old

View File

@@ -1,7 +1,6 @@
idf_component_register(
SRCS
main.cpp
main.h i2c.h
main.h
INCLUDE_DIRS .
REQUIRES driver
)

View File

@@ -1,3 +1,5 @@
## IDF Component Manager Manifest File
dependencies:
idf: '>=5.3.0'
idf: '>=5.3.0'
i2c:
path: ../../components/i2c

View File

@@ -13,10 +13,8 @@
#define PIN_SCL GPIO_NUM_22
#define PIN_RST (-1)
I2C i2c(PIN_SDA, PIN_SCL, PIN_RST);
extern "C" void app_main(void)
{
init_i2c(PIN_SDA, PIN_SCL);
}