First submit, make led blink
This commit is contained in:
85
.gitignore
vendored
Normal file
85
.gitignore
vendored
Normal file
@@ -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
|
||||
1
Provider/.gitignore
vendored
Normal file
1
Provider/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
external/
|
||||
6
Provider/CMakeLists.txt
Normal file
6
Provider/CMakeLists.txt
Normal file
@@ -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)
|
||||
21
Provider/dependencies.lock
Normal file
21
Provider/dependencies.lock
Normal file
@@ -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
|
||||
26
Provider/esp_idf_project_configuration.json
Normal file
26
Provider/esp_idf_project_configuration.json
Normal file
@@ -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": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
2
Provider/main/CMakeLists.txt
Normal file
2
Provider/main/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
idf_component_register(SRCS "main.cpp"
|
||||
INCLUDE_DIRS ".")
|
||||
0
Provider/main/connect.cpp
Normal file
0
Provider/main/connect.cpp
Normal file
17
Provider/main/idf_component.yml
Normal file
17
Provider/main/idf_component.yml
Normal file
@@ -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
|
||||
44
Provider/main/led_status.cpp
Normal file
44
Provider/main/led_status.cpp
Normal file
@@ -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);
|
||||
}
|
||||
32
Provider/main/main.cpp
Normal file
32
Provider/main/main.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
// STD Lib
|
||||
#include <stdio.h>
|
||||
|
||||
// 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();
|
||||
}
|
||||
13
Provider/main/types.hpp
Normal file
13
Provider/main/types.hpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
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;
|
||||
BIN
external/ms-vscode.cpptools-extension-pack-1.5.1.vsix
vendored
Normal file
BIN
external/ms-vscode.cpptools-extension-pack-1.5.1.vsix
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user