Ready to develop.

This commit is contained in:
Ulysse Cura 2026-10-07 10:00:15 +02:00
commit 156db4ba59
9 changed files with 260 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.vscode/ccls-cache
build

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "lib/Pico_USB_Host"]
path = lib/Pico_USB_Host
url = https://gitea.skadubpc.net/ulysse/Pico_USB_Host_Lib.git

26
.vscode/c_cpp_properties.json vendored Normal file
View File

@ -0,0 +1,26 @@
{
"configurations": [
{
"name": "Linux",
"intelliSenseMode": "linux-gcc-arm",
"includePath": [
"${env:PICO_SDK_PATH}/src/**/include/",
"${env:PICO_SDK_PATH}/lib/**/include/",
"${env:PICO_SDK_PATH}/lib/**/src/",
"${workspaceFolder}/build/generated/pico_base/",
"${workspaceFolder}/src/",
"${workspaceFolder}/lib/**/"
],
"compilerPath": "/usr/bin/arm-none-eabi-gcc",
"cStandard": "c17",
"browse": {
"path": [
"${workspaceFolder}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 4
}

114
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,114 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "Configure",
"detail": "configure project",
"type": "shell",
"command": "cmake",
"args": [
"-H.",
"-Bbuild"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"label": "Build",
"detail": "Build project",
"dependsOn": [
"Configure"
],
"type": "shell",
"command": "make",
"args": [
"-C",
"build",
"-j$(nproc)"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"label": "Flash Access Point",
"detail": "Build and flash access point",
"type": "shell",
"dependsOn": [
"Configure"
],
"command": "make",
"args": [
"-C",
"build",
"-j$(nproc)",
"Flash_Access_Point"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"label": "Flash Station",
"detail": "Build and flash station",
"type": "shell",
"dependsOn": [
"Configure"
],
"command": "make",
"args": [
"-C",
"build",
"-j$(nproc)",
"Flash_Station"
],
"group": "build",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
}
},
{
"label": "Clean",
"detail": "Clean build directory and executable",
"type": "shell",
"command": "rm",
"args": [
"-rf",
"build"
],
"group": "build",
"presentation": {
"echo": false,
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true
}
}
]
}

59
CMakeLists.txt Normal file
View File

@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 3.13)
# Explicitely define board
set(PICO_BOARD pico)
if(NOT DEFINED PICO_BOARD)
add_definitions(-DPICO_BOARD=${PICO_BOARD})
endif()
# Include pico-sdk cmake support
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
project(Pico_USB_Tests C CXX ASM)
set(CMAKE_C_STANDARD 17)
set(CMAKE_CXX_STANDARD 17)
pico_sdk_init()
# Executables and sources
add_executable(Pico_Host
src/main_host.c
)
add_executable(Pico_Device
src/main_device.c
)
# Libs
add_subdirectory(lib/Pico_USB_Host)
target_link_libraries(Pico_Host
pico_stdlib
Pico_USB_Host
)
target_link_libraries(Pico_Device
pico_stdlib
)
# Stdio configuration
pico_enable_stdio_usb(Pico_Host 1)
pico_enable_stdio_uart(Pico_Host 1)
pico_enable_stdio_usb(Pico_Device 1)
pico_enable_stdio_uart(Pico_Device 1)
# Output
pico_add_extra_outputs(Pico_Host)
pico_add_extra_outputs(Pico_Device)
# Flash target
add_custom_target(Flash_host
DEPENDS Pico_Host
COMMAND picotool load -f ${PROJECT_BINARY_DIR}/Pico_Host.uf2
)
add_custom_target(Flash_Device
DEPENDS Pico_Device
COMMAND picotool load -f ${PROJECT_BINARY_DIR}/Pico_Device.uf2
)

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# PicoW_UDP_Tests
Test of the library PicoW_UDP_Lib.

1
lib/Pico_USB_Host Submodule

@ -0,0 +1 @@
Subproject commit adffbe805b938541659b6fa4688a5665ddbc5b9e

28
src/main_device.c Normal file
View File

@ -0,0 +1,28 @@
#include <pico/stdlib.h>
int main(void)
{
stdio_init_all();
gpio_init(PICO_DEFAULT_LED_PIN);
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
while(true)
{
static uint64_t last_time = 0;
uint64_t time = time_us_64();
if(time - last_time > 1000 * 1000)
{
last_time = time;
static bool led_state = true;
led_state = !led_state;
gpio_put(PICO_DEFAULT_LED_PIN, led_state);
}
tight_loop_contents();
}
return PICO_OK;
}

24
src/main_host.c Normal file
View File

@ -0,0 +1,24 @@
#include <pico/stdlib.h>
int main(void)
{
stdio_init_all();
gpio_init(PICO_DEFAULT_LED_PIN);
gpio_set_dir(PICO_DEFAULT_LED_PIN, GPIO_OUT);
for(int i = 0; i < 3; i++)
{
gpio_put(PICO_DEFAULT_LED_PIN, false);
sleep_ms(100);
gpio_put(PICO_DEFAULT_LED_PIN, true);
sleep_ms(100);
}
while(true)
{
tight_loop_contents();
}
return PICO_OK;
}