diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index c26f6ae..22cbffe 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -1,5 +1,4 @@ #include e-Paper subdirectories -add_subdirectory(epaper/Config) -add_subdirectory(epaper/e-Paper) -add_subdirectory(epaper/Fonts) -add_subdirectory(epaper/GUI) +add_subdirectory(epaper) +add_subdirectory(mare) + diff --git a/libs/epaper/CMakeLists.txt b/libs/epaper/CMakeLists.txt new file mode 100644 index 0000000..dd7bccf --- /dev/null +++ b/libs/epaper/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(Config) +add_subdirectory(e-Paper) +add_subdirectory(Fonts) +add_subdirectory(GUI) diff --git a/libs/mare/CMakeLists.txt b/libs/mare/CMakeLists.txt new file mode 100644 index 0000000..d9ad5ce --- /dev/null +++ b/libs/mare/CMakeLists.txt @@ -0,0 +1,13 @@ + +# Find all source files in a single current directory +# Save the name to DIR_Config_SRCS +aux_source_directory(. DIR_Config_SRCS) + + +include_directories(../epaper/Config) +include_directories(../epaper/e-Paper) +include_directories(../epaper/Fonts) + +# Generate the link library +add_library(Mare ${DIR_Config_SRCS}) +target_link_libraries(Mare PUBLIC Config ePaper pico_stdlib hardware_spi) \ No newline at end of file diff --git a/libs/mare/mare.cpp b/libs/mare/mare.cpp new file mode 100644 index 0000000..416cfd4 --- /dev/null +++ b/libs/mare/mare.cpp @@ -0,0 +1,12 @@ +/******************************************* + * Most Awesome Renderer Ever + *******************************************/ +#include "mare.h" + +namespace Render { + + Mare::Mare(){ + + } + +} \ No newline at end of file diff --git a/libs/mare/mare.h b/libs/mare/mare.h new file mode 100644 index 0000000..ed2b0a8 --- /dev/null +++ b/libs/mare/mare.h @@ -0,0 +1,22 @@ +/******************************************* + * Most Awesome Renderer Ever + *******************************************/ + +#include +#include +#include + +namespace Render{ + + class Mare { + public: + Mare(); + virtual ~Mare(); + + public: + void render(); + + private: + int _var; + }; +} \ No newline at end of file diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 287ff50..828fda7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -4,6 +4,7 @@ include_directories(../libs/epaper/Config) include_directories(../libs/epaper/e-Paper) include_directories(../libs/epaper/GUI) include_directories(../libs/epaper/Fonts) +include_directories(../libs/mare) #add executable for main add_executable(emon main.cpp) diff --git a/src/main.cpp b/src/main.cpp index 4b977bc..5f9eb23 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,10 +3,11 @@ // Ricrdarsi di inserire cosi' tutte le lebrerie C altrimenti non LINKA, vaccamiseria extern "C" { - #include + #include } #include +#include int main(){ stdio_init_all(); @@ -15,17 +16,29 @@ int main(){ gpio_set_dir(LED_PIN, GPIO_OUT); bool s=false; uint32_t i=0; + uint8_t img[EPD_2IN9_V2_HEIGHT/8*EPD_2IN9_V2_WIDTH]; - auto a(Myclass(3)); - a.culo(); + for (int x=0; x < EPD_2IN9_V2_HEIGHT/8*EPD_2IN9_V2_WIDTH; ++x){ + img[x] = 0x01; + } - EPD_2IN9D_Init(); + int rv; + DEV_Delay_ms(500); + if((rv=DEV_Module_Init())!=0){ + printf("Init Failed, %d",rv); + return -1; + } + EPD_2IN9_V2_Init(); + EPD_2IN9_V2_Clear(); - while (true) { + while(true){ + EPD_2IN9_V2_Display((uint8_t*)img); + sleep_ms(10000); + EPD_2IN9_V2_Clear(); printf("[%u] Hello, world!\n",i++); gpio_put(LED_PIN,s); s = s ? false : true; - sleep_ms(1000); } + return 0; } \ No newline at end of file