From 6723c6343a52885a5f34ea0b112a97dd5f99f4d4 Mon Sep 17 00:00:00 2001 From: Mitchell M Date: Sat, 21 Mar 2026 21:30:44 -0500 Subject: [PATCH] setup driver --- CMakeLists.txt | 2 ++ blk_box.cpp | 7 +++---- drivers/CMakeLists.txt | 5 +++++ drivers/i2c.cpp | 5 +++++ include/blk_box.h | 8 +++++++- include/blk_box_drivers/i2c.h | 1 + 6 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 drivers/CMakeLists.txt create mode 100644 drivers/i2c.cpp create mode 100644 include/blk_box_drivers/i2c.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 112570c..399b669 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,3 +2,5 @@ idf_component_register( SRCS "blk_box.cpp" INCLUDE_DIRS "include" ) + +add_subdirectory(drivers) diff --git a/blk_box.cpp b/blk_box.cpp index 3982225..5cad864 100644 --- a/blk_box.cpp +++ b/blk_box.cpp @@ -1,6 +1,5 @@ -#include #include "blk_box.h" -const char* get_hello_world() { - return "hello, world!"; -} +void init_blk_box(BlkBoxInitConfig cfg) { + +} \ No newline at end of file diff --git a/drivers/CMakeLists.txt b/drivers/CMakeLists.txt new file mode 100644 index 0000000..1fc3e65 --- /dev/null +++ b/drivers/CMakeLists.txt @@ -0,0 +1,5 @@ +set(SOURCES + "i2c.cpp" +) + +target_sources(${COMPONENT_LIB} PRIVATE ${SOURCES}) diff --git a/drivers/i2c.cpp b/drivers/i2c.cpp new file mode 100644 index 0000000..0223f27 --- /dev/null +++ b/drivers/i2c.cpp @@ -0,0 +1,5 @@ +#include "stdio.h" + +void i2c_test() { + printf("initializing i2c or something\n"); +} \ No newline at end of file diff --git a/include/blk_box.h b/include/blk_box.h index bd56e5d..7be879f 100644 --- a/include/blk_box.h +++ b/include/blk_box.h @@ -1 +1,7 @@ -const char* get_hello_world(); +struct BlkBoxInitConfig { + // nothing for now... +}; + + + +void init_blk_box(BlkBoxInitConfig cfg); diff --git a/include/blk_box_drivers/i2c.h b/include/blk_box_drivers/i2c.h new file mode 100644 index 0000000..dbccfe1 --- /dev/null +++ b/include/blk_box_drivers/i2c.h @@ -0,0 +1 @@ +void i2c_test(); \ No newline at end of file