diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..13dc40c --- /dev/null +++ b/.gitignore @@ -0,0 +1,85 @@ +@ -0,0 +1,78 @@ +# macOS +.DS_Store +.AppleDouble +.LSOverride + +# Directory metadata +.directory + +# Temporary files +*~ +*.swp +*.swo +*.bak +*.tmp + +# Log files +*.log + +# Build artifacts and directories +**/build/ +build/ +*.o +*.a +*.out +*.exe # For any host-side utilities compiled on Windows + +# ESP-IDF specific build outputs +*.bin +*.elf +*.map +flasher_args.json # Generated in build directory +sdkconfig.old +sdkconfig + +# ESP-IDF dependencies +# For older versions or manual component management +/components/.idf/ +**/components/.idf/ +# For modern ESP-IDF component manager +managed_components/ +# If ESP-IDF tools are installed/referenced locally to the project +.espressif/ + +# CMake generated files +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake +install_manifest.txt +CTestTestfile.cmake + +# Python environment files +*.pyc +*.pyo +*.pyd +__pycache__/ +*.egg-info/ +dist/ + +# Virtual environment folders +venv/ +.venv/ +env/ + +# Language Servers +**/.clangd +**/.ccls-cache/ +**/compile_commands.json + +# Windows specific +Thumbs.db +ehthumbs.db +Desktop.ini + +# User-specific configuration files +*.user +*.workspace # General workspace files, can be from various tools +*.suo # Visual Studio Solution User Options +*.sln.docstates # Visual Studio + + +**/.cache/ +**/.devcontainer/ +**/.vscode/ +/Server diff --git a/Provider/.gitignore b/Provider/.gitignore new file mode 100644 index 0000000..f804ec5 --- /dev/null +++ b/Provider/.gitignore @@ -0,0 +1 @@ +external/ \ No newline at end of file diff --git a/Provider/CMakeLists.txt b/Provider/CMakeLists.txt new file mode 100644 index 0000000..4354294 --- /dev/null +++ b/Provider/CMakeLists.txt @@ -0,0 +1,6 @@ +# The following five lines of boilerplate have to be in your project's +# CMakeLists in this exact order for cmake to work correctly +cmake_minimum_required(VERSION 3.16) + +include($ENV{IDF_PATH}/tools/cmake/project.cmake) +project(Provider) diff --git a/Provider/dependencies.lock b/Provider/dependencies.lock new file mode 100644 index 0000000..732a10f --- /dev/null +++ b/Provider/dependencies.lock @@ -0,0 +1,21 @@ +dependencies: + espressif/led_strip: + component_hash: 28621486f77229aaf81c71f5e15d6fbf36c2949cf11094e07090593e659e7639 + dependencies: + - name: idf + require: private + version: '>=5.0' + source: + registry_url: https://components.espressif.com/ + type: service + version: 3.0.3 + idf: + source: + type: idf + version: 5.5.3 +direct_dependencies: +- espressif/led_strip +- idf +manifest_hash: f9f27a7bfd490a8f252ea50084db6f87c986509746a1f4fe61b5ce5bb0e44fcb +target: esp32s3 +version: 2.0.0 diff --git a/Provider/esp_idf_project_configuration.json b/Provider/esp_idf_project_configuration.json new file mode 100644 index 0000000..9847987 --- /dev/null +++ b/Provider/esp_idf_project_configuration.json @@ -0,0 +1,26 @@ +{ + "Provider-Default": { + "build": { + "compileArgs": [], + "ninjaArgs": [], + "buildDirectoryPath": "", + "sdkconfigDefaults": [], + "sdkconfigFilePath": "" + }, + "env": {}, + "flashBaudRate": "", + "idfTarget": "esp32s3", + "monitorBaudRate": "", + "openOCD": { + "debugLevel": -1, + "configs": [], + "args": [] + }, + "tasks": { + "preBuild": "", + "preFlash": "", + "postBuild": "", + "postFlash": "" + } + } +} diff --git a/Provider/main/CMakeLists.txt b/Provider/main/CMakeLists.txt new file mode 100644 index 0000000..5ebf314 --- /dev/null +++ b/Provider/main/CMakeLists.txt @@ -0,0 +1,2 @@ +idf_component_register(SRCS "main.cpp" + INCLUDE_DIRS ".") diff --git a/Provider/main/connect.cpp b/Provider/main/connect.cpp new file mode 100644 index 0000000..e69de29 diff --git a/Provider/main/idf_component.yml b/Provider/main/idf_component.yml new file mode 100644 index 0000000..88e3292 --- /dev/null +++ b/Provider/main/idf_component.yml @@ -0,0 +1,17 @@ +## IDF Component Manager Manifest File +dependencies: + ## Required IDF version + idf: + version: '>=4.1.0' + # # Put list of dependencies here + # # For components maintained by Espressif: + # component: "~1.0.0" + # # For 3rd party components: + # username/component: ">=1.0.0,<2.0.0" + # username2/component2: + # version: "~1.0.0" + # # For transient dependencies `public` flag can be set. + # # `public` flag doesn't have an effect dependencies of the `main` component. + # # All dependencies of `main` are public by default. + # public: true + espressif/led_strip: ^3.0.3 diff --git a/Provider/main/led_status.cpp b/Provider/main/led_status.cpp new file mode 100644 index 0000000..de9b7dc --- /dev/null +++ b/Provider/main/led_status.cpp @@ -0,0 +1,44 @@ +// Project includes +#include "types.hpp" + +// SDK Includes +#include "led_strip.h" + +enum class led_status : uint8 { Connecting, Ready, Failed }; + +// Could be a config but its the GPIO on my ESP32-S3-ETH +#define LED_GPIO GPIO_NUM_21 + +static led_strip_handle_t led_strip; + +static void setup_led(void) { + /* LED strip initialization with the GPIO and pixels number*/ + led_strip_config_t strip_config = {}; + strip_config.strip_gpio_num = LED_GPIO; + strip_config.max_leds = 1; // at least one LED on board + + led_strip_rmt_config_t rmt_config = {}; + rmt_config.resolution_hz = 10 * 1000 * 1000; // 10MHz + rmt_config.flags.with_dma = false; + ESP_ERROR_CHECK( + led_strip_new_rmt_device(&strip_config, &rmt_config, &led_strip)); + + led_strip_clear(led_strip); +} + +static void destroy_led(void) { led_strip_clear(led_strip); } + +void set_led_status(led_status status) { + switch (status) { + case led_status::Connecting: + led_strip_set_pixel(led_strip, 0, 0, 0, 255); + break; + case led_status::Ready: + led_strip_set_pixel(led_strip, 0, 0, 255, 0); + break; + case led_status::Failed: + led_strip_set_pixel(led_strip, 0, 255, 0, 0); + break; + } + led_strip_refresh(led_strip); +} \ No newline at end of file diff --git a/Provider/main/main.cpp b/Provider/main/main.cpp new file mode 100644 index 0000000..73b8e2e --- /dev/null +++ b/Provider/main/main.cpp @@ -0,0 +1,32 @@ +// STD Lib +#include + +// SDK +#include "driver/gpio.h" +#include "esp_log.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "sdkconfig.h" +#include "soc/gpio_num.h" + +// Project cpp +#include "connect.cpp" +#include "led_status.cpp" + +extern "C" void app_main() { + setup_led(); + printf("Hello, Worldi!\n"); + set_led_status(led_status::Connecting); + + vTaskDelay(1000 / portTICK_PERIOD_MS); + + set_led_status(led_status::Ready); + + vTaskDelay(1000 / portTICK_PERIOD_MS); + + set_led_status(led_status::Failed); + + vTaskDelay(1000 / portTICK_PERIOD_MS); + + destroy_led(); +} diff --git a/Provider/main/types.hpp b/Provider/main/types.hpp new file mode 100644 index 0000000..587036e --- /dev/null +++ b/Provider/main/types.hpp @@ -0,0 +1,13 @@ +#pragma once + +#include + +using uint8 = uint8_t; +using uint16 = uint16_t; +using uint32 = uint32_t; +using uint64 = uint64_t; + +using int8 = int8_t; +using int16 = int16_t; +using int32 = int32_t; +using int64 = int64_t; \ No newline at end of file diff --git a/external/ms-vscode.cpptools-extension-pack-1.5.1.vsix b/external/ms-vscode.cpptools-extension-pack-1.5.1.vsix new file mode 100644 index 0000000..e766cc4 Binary files /dev/null and b/external/ms-vscode.cpptools-extension-pack-1.5.1.vsix differ