From 6b218351c85e2fdf3e432ab6d757c93f277950c5 Mon Sep 17 00:00:00 2001 From: greyes Date: Mon, 5 Jan 2026 09:18:18 +0100 Subject: [PATCH 1/4] Added pinout for TargetV2 --- lib/HALTargetV2/library.json | 17 +++ lib/HALTargetV2/src/Pin.h | 104 +++++++++++++ lib/HALTargetV2/src/USBHostDriver.cpp | 202 ++++++++++++++++++++++++++ lib/HALTargetV2/src/USBHostDriver.h | 184 +++++++++++++++++++++++ 4 files changed, 507 insertions(+) create mode 100644 lib/HALTargetV2/library.json create mode 100644 lib/HALTargetV2/src/Pin.h create mode 100644 lib/HALTargetV2/src/USBHostDriver.cpp create mode 100644 lib/HALTargetV2/src/USBHostDriver.h diff --git a/lib/HALTargetV2/library.json b/lib/HALTargetV2/library.json new file mode 100644 index 00000000..963a3f6c --- /dev/null +++ b/lib/HALTargetV2/library.json @@ -0,0 +1,17 @@ +{ + "name": "HALTargetV2", + "version": "0.1.0", + "description": "...", + "authors": [{ + "name": "Andreas Merkle", + "email": "web@blue-andi.de", + "url": "https://github.com/BlueAndi", + "maintainer": true + }], + "license": "MIT", + "dependencies": [{ + "name": "Os" + }], + "frameworks": "arduino", + "platforms": "*" +} \ No newline at end of file diff --git a/lib/HALTargetV2/src/Pin.h b/lib/HALTargetV2/src/Pin.h new file mode 100644 index 00000000..69e0bf94 --- /dev/null +++ b/lib/HALTargetV2/src/Pin.h @@ -0,0 +1,104 @@ +/* MIT License + * + * Copyright (c) 2023 - 2026 Andreas Merkle + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/******************************************************************************* + DESCRIPTION +*******************************************************************************/ +/** + * @file + * @brief Pin definition for the target board. + * @author Gabryel Reyes + * + * @addtogroup HALTargetV1 + * + * @{ + */ +#ifndef PIN_H +#define PIN_H + +/****************************************************************************** + * Compile Switches + *****************************************************************************/ + +/****************************************************************************** + * Includes + *****************************************************************************/ + +#include +#include + +/****************************************************************************** + * Macros + *****************************************************************************/ + +/****************************************************************************** + * Types and Classes + *****************************************************************************/ + +/** Pin number of all used pins. */ +namespace Pin +{ + /** Pin for push button for system reset/AP mode start (ACTIVE LOW) */ + constexpr uint8_t PIN_WIFI_AND_RESET_KEY = 48U; + + /** Pin for resetting the attached Zumo robot (ACTIVE LOW) */ + constexpr uint8_t PIN_DEVICE_RESET = 5U; + + /** Pin for info LED RGB channel RED (ACTIVE LOW) */ + constexpr uint8_t INFO_LED_R = 38U; + + /** Pin for info LED RGB channel GREEN (ACTIVE LOW) */ + constexpr uint8_t INFO_LED_G = 1U; + + /** Pin for info LED RGB channel BLUE (ACTIVE LOW) */ + constexpr uint8_t INFO_LED_B = 2U; + + /** Pin for analog measurement of battery voltage */ + constexpr uint8_t PIN_BATT_MEASUREMENT = 10U; + + /** Pin for push button A */ + constexpr uint8_t PIN_BUTTON_A = 7U; + + /** Pin for push button B */ + constexpr uint8_t PIN_BUTTON_B = 15U; + + /** Pin for push button C */ + constexpr uint8_t PIN_BUTTON_C = 17U; + + /** Pin for LED A */ + constexpr uint8_t PIN_LED_A = 6U; + + /** Pin for LED B */ + constexpr uint8_t PIN_LED_B = 16U; + + /** Pin for LED C */ + constexpr uint8_t PIN_LED_C = 18U; + +}; /* namespace Pin */ + +/****************************************************************************** + * Functions + *****************************************************************************/ + +#endif /* PIN_H */ +/** @} */ diff --git a/lib/HALTargetV2/src/USBHostDriver.cpp b/lib/HALTargetV2/src/USBHostDriver.cpp new file mode 100644 index 00000000..2c837bf7 --- /dev/null +++ b/lib/HALTargetV2/src/USBHostDriver.cpp @@ -0,0 +1,202 @@ +/* MIT License + * + * Copyright (c) 2023 - 2026 Andreas Merkle + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/******************************************************************************* + DESCRIPTION +*******************************************************************************/ +/** + * @file + * @brief Abstraction and Stream implementation of USB Host + * @author Gabryel Reyes + */ + +/****************************************************************************** + * Includes + *****************************************************************************/ +#include "USBHostDriver.h" +#include + +/****************************************************************************** + * Compiler Switches + *****************************************************************************/ + +/****************************************************************************** + * Macros + *****************************************************************************/ + +/****************************************************************************** + * Types and classes + *****************************************************************************/ + +/****************************************************************************** + * Prototypes + *****************************************************************************/ + +/****************************************************************************** + * Local Variables + *****************************************************************************/ + +/****************************************************************************** + * Public Methods + *****************************************************************************/ + +USBHost::USBHost() : Stream(), m_rxQueue(nullptr), m_isBootloaderModeActive(false) +{ +} + +USBHost::~USBHost() +{ +} + +bool USBHost::init() +{ + bool isSuccess = false; + + /* Initialize RX Queue. */ + m_rxQueue = xQueueCreate(USB_RX_QUEUE_SIZE, sizeof(uint8_t)); + + if (nullptr == m_rxQueue) + { + LOG_ERROR("Queue creation failed."); + } + else + { + LOG_DEBUG("USB driver has been successfully initialized."); + isSuccess = true; + } + + return isSuccess; +} + +void USBHost::process() +{ + /* Not implemented. */ +} + +size_t USBHost::write(uint8_t value) +{ + /* Not implemented. */ + return 0; +} + +size_t USBHost::write(const uint8_t* buffer, size_t length) +{ + /* Not implemented. */ + return 0; +} + +int USBHost::available() +{ + int availableBytes = 0; + + if (nullptr != m_rxQueue) + { + availableBytes = uxQueueMessagesWaiting(m_rxQueue); + } + + return availableBytes; +} + +int USBHost::read() +{ + /* Not implemented. */ + return -1; +} + +int USBHost::peek() +{ + /* Not implemented. */ + return -1; +} + +size_t USBHost::readBytes(uint8_t* buffer, size_t length) +{ + size_t count = 0; + + for (count = 0; count < length; count++) + { + uint8_t byte; + if (false == getByte(byte)) + { + break; + } + else + { + buffer[count] = byte; + } + } + + return count; +} + +void USBHost::requestBootloaderMode() +{ + /* Reset flags, ACM and data queue. */ + reset(); + + /* Request bootloader mode. */ + m_isBootloaderModeActive = true; +} + +void USBHost::reset() +{ + m_isBootloaderModeActive = false; + + if (nullptr != m_rxQueue) + { + (void)xQueueReset(m_rxQueue); + } +} + +bool USBHost::isBootloaderModeActive() const +{ + return (true == m_isBootloaderModeActive); +} + +/****************************************************************************** + * Protected Methods + *****************************************************************************/ + +/****************************************************************************** + * Private Methods + *****************************************************************************/ + +bool USBHost::getByte(uint8_t& byte) +{ + if ((nullptr != m_rxQueue) && (0 < available())) + { + if (pdTRUE == xQueueReceive(m_rxQueue, &byte, 0)) + { + return true; + } + } + return false; +} + +/****************************************************************************** + * External Functions + *****************************************************************************/ + +/****************************************************************************** + * Local Functions + *****************************************************************************/ diff --git a/lib/HALTargetV2/src/USBHostDriver.h b/lib/HALTargetV2/src/USBHostDriver.h new file mode 100644 index 00000000..8613e72a --- /dev/null +++ b/lib/HALTargetV2/src/USBHostDriver.h @@ -0,0 +1,184 @@ +/* MIT License + * + * Copyright (c) 2023 - 2026 Andreas Merkle + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/******************************************************************************* + DESCRIPTION +*******************************************************************************/ +/** + * @file + * @brief Abstraction and Stream implementation of USB Host + * @author Gabryel Reyes + * + * @addtogroup HALTargetV1 + * + * @{ + */ + +#ifndef USBHOSTDRIVER_H +#define USBHOSTDRIVER_H + +/****************************************************************************** + * Compile Switches + *****************************************************************************/ + +/****************************************************************************** + * Includes + *****************************************************************************/ +#include + +/****************************************************************************** + * Macros + *****************************************************************************/ + +/****************************************************************************** + * Types and Classes + *****************************************************************************/ + +/** Class for configuring and managing the USB Host */ +class USBHost : public Stream +{ +public: + /** + * Default constructor + */ + USBHost(); + + /** + * Default destructor + */ + ~USBHost(); + + /** + * Initializes the USB Host. + * + * @returns true if initialization is successful. Otherwise, false. + */ + bool init(); + + /** + * Process the device connection. + */ + void process(); + + /** + * Print single byte. + * @param[in] value Byte to send. + * @returns Number of bytes written + */ + size_t write(uint8_t value) final; + + /** + * Write bytes. + * @param[in] buffer Byte Array to send. + * @param[in] length Length of Buffer. + * @returns Number of bytes written + */ + size_t write(const uint8_t* buffer, size_t length) final; + + /** + * Check if there are available bytes in the Stream. + * @returns Number of available bytes. + */ + int available() final; + + /** + * Read a byte from the Stream. + * @returns The first byte of incoming data available (or -1 if no data is available). + */ + int read() final; + + /** + * Peek a byte from the Stream. + * @returns The first byte of incoming data available (or -1 if no data is available). + */ + int peek() final; + + /** + * Read bytes into a buffer. + * @param[in] buffer Array to write bytes to. + * @param[in] length number of bytes to be read. + * @returns Number of bytes read from Stream. + */ + size_t readBytes(uint8_t* buffer, size_t length) final; + + /** + * Request to enter the bootloader mode. + */ + void requestBootloaderMode(); + + /** + * Reset the flags, ACM and data queue. + */ + void reset(); + + /** + * Check if the bootloader mode is active. + * + * @return If the bootloader mode is active, returns true. Otherwise, false. + */ + bool isBootloaderModeActive() const; + +private: + /** Size of the RX Queue */ + static const uint16_t USB_RX_QUEUE_SIZE = 1024U; + + /** RX Queue */ + QueueHandle_t m_rxQueue; + + /** Bootloader Mode Flag. */ + bool m_isBootloaderModeActive; + +private: + /** + * Get a Byte from the receiving buffer, if any. + * @param[out] byte buffer to write the byte to. + * @returns If a received byte has been succesfully written to the buffer, returns true. Otherwise, false. + */ + bool getByte(uint8_t& byte); + +private: + /** + * Copy construction of an instance. + * Not allowed. + * + * @param[in] usbhost Source instance. + */ + USBHost(const USBHost& usbhost); + + /** + * Assignment of an instance. + * Not allowed. + * + * @param[in] usbhost Source instance. + * + * @returns Reference to USBHost instance. + */ + USBHost& operator=(const USBHost& usbhost); +}; + +/****************************************************************************** + * Functions + *****************************************************************************/ + +#endif /* USBHOSTDRIVER_H */ +/** @} */ From f63cadb20e832a93c55aa2133f31f3e2c9450967 Mon Sep 17 00:00:00 2001 From: greyes Date: Mon, 5 Jan 2026 10:08:22 +0100 Subject: [PATCH 2/4] Added configuration for HW V1 and V2. Separated configurations to own file --- config/hardwareversion.ini | 76 ++++++++++++++++++++++++++++++++++++++ platformio.ini | 49 +++++++----------------- 2 files changed, 89 insertions(+), 36 deletions(-) create mode 100644 config/hardwareversion.ini diff --git a/config/hardwareversion.ini b/config/hardwareversion.ini new file mode 100644 index 00000000..5d0c7fd5 --- /dev/null +++ b/config/hardwareversion.ini @@ -0,0 +1,76 @@ +; ************************************************************************************************* +; Target Hardware Version configurations +; * V1: ESP32 with 4MB flash. External USB Host controller. +; * V2: ESP32-S3 with 16MB flash. Integrated USB Host controller. Buttons and LEDs A, B and C. +; ************************************************************************************************* + +; ***************************************************************************** +; Target environment for ZumoComSystem. +; ***************************************************************************** +[version:V1] +extends = mode:selected_esp32 +platform = espressif32 @ ~6.11.0 +board = esp32doit-devkit-v1 +board_build.filesystem = littlefs +framework = arduino +build_flags = + ${mode:selected_esp32.build_flags} + -Wl,-Map,firmware.map + -D CONFIG_FILE_PATH="\"/config/config.json\"" +lib_deps = + HALInterfaces + HALTargetV1 + HALTargetCommon + https://github.com/NewTec-GmbH/USB_Host_Shield_2.0.git#3_Endpoints_ACM + knolleary/PubSubClient @ ~2.8 + SPI + FS + LittleFS +lib_ignore = + ArduinoNative + HALSim + HALTargetV2 + HALTest + MainNative + MainTestNative + UDPNative + WiFiNative + WifiClientNative +extra_scripts = +monitor_speed = 115200 +monitor_filters = esp32_exception_decoder + +; ***************************************************************************** +; Target environment for ZumoComSystemV2. +; ***************************************************************************** +[version:V2] +extends = mode:selected_esp32 +platform = espressif32 @ ~6.11.0 +board = esp32-s3-devkitc-1 +board_build.filesystem = littlefs +framework = arduino +build_flags = + ${mode:selected_esp32.build_flags} + -Wl,-Map,firmware.map + -D CONFIG_FILE_PATH="\"/config/config.json\"" +lib_deps = + HALInterfaces + HALTargetV2 + HALTargetCommon + knolleary/PubSubClient @ ~2.8 + SPI + FS + LittleFS +lib_ignore = + ArduinoNative + HALSim + HALTargetV1 + HALTest + MainNative + MainTestNative + UDPNative + WiFiNative + WifiClientNative +extra_scripts = +monitor_speed = 115200 +monitor_filters = esp32_exception_decoder \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index b1256f99..22cb9a80 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,6 +16,7 @@ default_envs = ConvoyLeaderTarget, ConvoyLeaderSim extra_configs = config/buildmode.ini + config/hardwareversion.ini platformio_override.ini ; ******************************************************************************** @@ -38,6 +39,14 @@ extends = mode:debug_log build_flags = ${mode:debug_log.build_flags} +; ******************************************************************************** +; Select esp32 hardware version here! +; ******************************************************************************** +[target:esp32] +extends = version:V1 +build_flags = + ${version:V1.build_flags} + ; ***************************************************************************** ; Static check configuration ; ***************************************************************************** @@ -53,41 +62,6 @@ check_flags = clangtidy: --header-filter='' --checks=-*,clang-analyzer-*,performance-*,portability-*,readability-uppercase-literal-suffix,readability-redundant-control-flow --warnings-as-errors=-*,clang-analyzer-*,performance-*,portability-*,readability-uppercase-literal-suffix,readability-redundant-control-flow check_skip_packages = yes -; ***************************************************************************** -; Target environment for ZumoComSystem. -; ***************************************************************************** -[target:esp32] -extends = mode:selected_esp32 -platform = espressif32 @ ~6.11.0 -board = esp32doit-devkit-v1 -board_build.filesystem = littlefs -framework = arduino -build_flags = - ${mode:selected_esp32.build_flags} - -Wl,-Map,firmware.map - -D CONFIG_FILE_PATH="\"/config/config.json\"" -lib_deps = - HALInterfaces - HALTargetV1 - HALTargetCommon - https://github.com/NewTec-GmbH/USB_Host_Shield_2.0.git#3_Endpoints_ACM - knolleary/PubSubClient @ ~2.8 - SPI - FS - LittleFS -lib_ignore = - ArduinoNative - HALSim - HALTest - MainNative - MainTestNative - UDPNative - WiFiNative - WifiClientNative -extra_scripts = -monitor_speed = 115200 -monitor_filters = esp32_exception_decoder - ; ***************************************************************************** ; PC target environment for Webots simulation. ; @@ -117,6 +91,7 @@ lib_deps = lib_ignore = HALTargetCommon HALTargetV1 + HALTargetV2 HALTest MainTestNative extra_scripts = @@ -150,7 +125,9 @@ lib_deps = MainTestNative lib_ignore = HALSim - HALTarget + HALTargetCommon + HALTargetV1 + HALTargetV2 MainNative extra_scripts = pre:./scripts/add_os_specific_build_flags.py From 34c1a759672e1061aca987e4f293a05612b5537c Mon Sep 17 00:00:00 2001 From: greyes Date: Mon, 5 Jan 2026 10:26:52 +0100 Subject: [PATCH 3/4] Fixed Doxygen groups. Added HALTargetV2 to target environments documentation --- doc/doxygen/ConvoyFollowerTargetDoxyfile | 1 + doc/doxygen/ConvoyLeaderTargetDoxyfile | 1 + doc/doxygen/LineFollowerTargetDoxyfile | 1 + doc/doxygen/RemoteControlTargetDoxyfile | 1 + doc/doxygen/SensorFusionTargetDoxyfile | 1 + doc/doxygen/TurtleTargetDoxyfile | 1 + doc/doxygen/mainpage.dox | 14 ++++++++++++-- lib/HALTargetV2/src/Pin.h | 2 +- lib/HALTargetV2/src/USBHostDriver.h | 2 +- 9 files changed, 20 insertions(+), 4 deletions(-) diff --git a/doc/doxygen/ConvoyFollowerTargetDoxyfile b/doc/doxygen/ConvoyFollowerTargetDoxyfile index 726403f2..1ac91f03 100644 --- a/doc/doxygen/ConvoyFollowerTargetDoxyfile +++ b/doc/doxygen/ConvoyFollowerTargetDoxyfile @@ -995,6 +995,7 @@ INPUT = mainpage.dox \ ../../src \ ../../lib/HALTargetCommon \ ../../lib/HALTargetV1 \ + ../../lib/HALTargetV2 \ ../../lib/HALInterfaces \ ../../lib/APPConvoyFollower \ ../../lib/Service \ diff --git a/doc/doxygen/ConvoyLeaderTargetDoxyfile b/doc/doxygen/ConvoyLeaderTargetDoxyfile index 00c306df..d734c604 100644 --- a/doc/doxygen/ConvoyLeaderTargetDoxyfile +++ b/doc/doxygen/ConvoyLeaderTargetDoxyfile @@ -997,6 +997,7 @@ INPUT = mainpage.dox \ ../../lib/HALInterfaces \ ../../lib/HALTargetCommon \ ../../lib/HALTargetV1 \ + ../../lib/HALTargetV2 \ ../../lib/PlatoonService \ ../../lib/Service \ ../../lib/Utilities diff --git a/doc/doxygen/LineFollowerTargetDoxyfile b/doc/doxygen/LineFollowerTargetDoxyfile index 309476a0..c4f6b4dd 100644 --- a/doc/doxygen/LineFollowerTargetDoxyfile +++ b/doc/doxygen/LineFollowerTargetDoxyfile @@ -995,6 +995,7 @@ INPUT = mainpage.dox \ ../../src \ ../../lib/HALTargetCommon \ ../../lib/HALTargetV1 \ + ../../lib/HALTargetV2 \ ../../lib/HALInterfaces \ ../../lib/APPLineFollower \ ../../lib/Service \ diff --git a/doc/doxygen/RemoteControlTargetDoxyfile b/doc/doxygen/RemoteControlTargetDoxyfile index f0ec1092..9e1a54e9 100644 --- a/doc/doxygen/RemoteControlTargetDoxyfile +++ b/doc/doxygen/RemoteControlTargetDoxyfile @@ -995,6 +995,7 @@ INPUT = mainpage.dox \ ../../src \ ../../lib/HALTargetCommon \ ../../lib/HALTargetV1 \ + ../../lib/HALTargetV2 \ ../../lib/HALInterfaces \ ../../lib/APPRemoteControl \ ../../lib/Service \ diff --git a/doc/doxygen/SensorFusionTargetDoxyfile b/doc/doxygen/SensorFusionTargetDoxyfile index 51d58454..d8155ae0 100644 --- a/doc/doxygen/SensorFusionTargetDoxyfile +++ b/doc/doxygen/SensorFusionTargetDoxyfile @@ -995,6 +995,7 @@ INPUT = mainpage.dox \ ../../src \ ../../lib/HALTargetCommon \ ../../lib/HALTargetV1 \ + ../../lib/HALTargetV2 \ ../../lib/HALInterfaces \ ../../lib/APPSensorFusion \ ../../lib/Service \ diff --git a/doc/doxygen/TurtleTargetDoxyfile b/doc/doxygen/TurtleTargetDoxyfile index edacc244..3740037b 100644 --- a/doc/doxygen/TurtleTargetDoxyfile +++ b/doc/doxygen/TurtleTargetDoxyfile @@ -997,6 +997,7 @@ INPUT = mainpage.dox \ ../../lib/HALInterfaces \ ../../lib/HALTargetCommon \ ../../lib/HALTargetV1 \ + ../../lib/HALTargetV2 \ ../../lib/Service \ ../../lib/Utilities diff --git a/doc/doxygen/mainpage.dox b/doc/doxygen/mainpage.dox index c0e403c5..f0bf0bf8 100644 --- a/doc/doxygen/mainpage.dox +++ b/doc/doxygen/mainpage.dox @@ -15,8 +15,18 @@ The HAL interface abstraction, which every kind of HAL needs to provide. @{ @} -@defgroup HALTarget Hardware abstraction on the Zumo32U4 -Abstracts the the physical hardware of the Zumo32U4. +@defgroup HALTargetCommon Hardware abstraction of the common components of the ZumoComSystem. +Abstracts the physical hardware of the ZumoComSystemV1. +@{ +@} + +@defgroup HALTargetV1 Hardware abstraction of the ZumoComSystemV1 +Abstracts the physical hardware of the ZumoComSystemV1. +@{ +@} + +@defgroup HALTargetV2 Hardware abstraction of the ZumoComSystemV2 +Abstracts the physical hardware of the ZumoComSystemV2. @{ @} diff --git a/lib/HALTargetV2/src/Pin.h b/lib/HALTargetV2/src/Pin.h index 69e0bf94..18e09edb 100644 --- a/lib/HALTargetV2/src/Pin.h +++ b/lib/HALTargetV2/src/Pin.h @@ -29,7 +29,7 @@ * @brief Pin definition for the target board. * @author Gabryel Reyes * - * @addtogroup HALTargetV1 + * @addtogroup HALTargetV2 * * @{ */ diff --git a/lib/HALTargetV2/src/USBHostDriver.h b/lib/HALTargetV2/src/USBHostDriver.h index 8613e72a..2c494723 100644 --- a/lib/HALTargetV2/src/USBHostDriver.h +++ b/lib/HALTargetV2/src/USBHostDriver.h @@ -29,7 +29,7 @@ * @brief Abstraction and Stream implementation of USB Host * @author Gabryel Reyes * - * @addtogroup HALTargetV1 + * @addtogroup HALTargetV2 * * @{ */ From b150a41bd83cf67abbe9695883bbe6f377277f30 Mon Sep 17 00:00:00 2001 From: greyes Date: Mon, 5 Jan 2026 10:44:40 +0100 Subject: [PATCH 4/4] Added some improvements suggested by Copilot --- doc/doxygen/mainpage.dox | 2 +- lib/HALTargetV2/library.json | 2 +- lib/HALTargetV2/src/USBHostDriver.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/doxygen/mainpage.dox b/doc/doxygen/mainpage.dox index f0bf0bf8..3cb7e592 100644 --- a/doc/doxygen/mainpage.dox +++ b/doc/doxygen/mainpage.dox @@ -16,7 +16,7 @@ The HAL interface abstraction, which every kind of HAL needs to provide. @} @defgroup HALTargetCommon Hardware abstraction of the common components of the ZumoComSystem. -Abstracts the physical hardware of the ZumoComSystemV1. +Abstracts the physical hardware of the common components of the ZumoComSystem. @{ @} diff --git a/lib/HALTargetV2/library.json b/lib/HALTargetV2/library.json index 963a3f6c..3d3a944f 100644 --- a/lib/HALTargetV2/library.json +++ b/lib/HALTargetV2/library.json @@ -1,7 +1,7 @@ { "name": "HALTargetV2", "version": "0.1.0", - "description": "...", + "description": "Hardware abstraction layer for the ZumoComSystemV2.", "authors": [{ "name": "Andreas Merkle", "email": "web@blue-andi.de", diff --git a/lib/HALTargetV2/src/USBHostDriver.cpp b/lib/HALTargetV2/src/USBHostDriver.cpp index 2c837bf7..0fc860d3 100644 --- a/lib/HALTargetV2/src/USBHostDriver.cpp +++ b/lib/HALTargetV2/src/USBHostDriver.cpp @@ -170,7 +170,7 @@ void USBHost::reset() bool USBHost::isBootloaderModeActive() const { - return (true == m_isBootloaderModeActive); + return m_isBootloaderModeActive; } /******************************************************************************