Skip to content

Conversation

@humphrey-xmos
Copy link
Contributor

@humphrey-xmos humphrey-xmos commented Dec 15, 2025

Building host apps would require a lot of copy-paste, adding cmakes for variants to assist building specific host apps.

  • Cmake now handles finding and linking libraries (SPI, USB, XSCOPE)
  • Listing common include paths (HOST_CONTROL_INC)
  • Listing per tarnsport includes, typcailly linked library headers (HOST_xxx_INCLUDES {USB, XSCOPE, SPI})

Plus,

  • Moved header files in src folder to inc
  • Moved host source from lib_device_control/host/ to host/
  • Moved examples' "shared" resources to shared folder (were duplicated).
  • Extracted USB transport to library functions from endpoint0, created transport_usb.xc

@humphrey-xmos humphrey-xmos force-pushed the feature/reorganise-library branch 29 times, most recently from a12a712 to b5e161a Compare December 18, 2025 16:14
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reorganizes the lib_device_control library structure to simplify building host applications across different transport mechanisms (USB, SPI, I2C, XSCOPE). The reorganization eliminates code duplication and provides CMake infrastructure for easier integration.

Key changes:

  • New CMake files handle transport-specific library discovery and linking
  • Header files moved from src/ to inc/ directory for clearer separation
  • Host source code relocated from lib_device_control/host/ to dedicated host/ directory
  • Transport-specific USB implementation added with proper abstractions

Reviewed changes

Copilot reviewed 42 out of 63 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
lib_device_control/transport/transport_usb.xc New USB transport implementation for device side
lib_device_control/inc/transport_usb.h New header for USB transport with documentation issues
lib_device_control/inc/control_transport_shared.h New shared transport definitions and constants
lib_device_control/lib_build_info.cmake Updated to support conditional transport source inclusion
lib_device_control/module_build_info Updated include paths for reorganized structure
lib_device_control/api/control.h Added interface array macros for XC/C compatibility
lib_device_control/api/control_shared.h Added guard for CONTROL_VENDOR_REQUEST definition
host/src/*.c New host implementation files for different transports
host/inc/util.h New utility header for host applications
host/api/control_host*.h New host API headers
host/host_build_*.cmake New CMake files for transport-specific builds
tests/i2c_end_to_end_sim/CMakeLists.txt Updated paths for reorganized host sources
examples/xscope/src/main.xc Fixed variable scope and spelling
examples/xscope/src/app.* Added missing resource header include
examples/usb/src/app.xc Added missing config header include

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@humphrey-xmos humphrey-xmos force-pushed the feature/reorganise-library branch 7 times, most recently from 2a23c73 to 3151052 Compare December 19, 2025 14:52
@humphrey-xmos humphrey-xmos force-pushed the feature/reorganise-library branch from 3151052 to 0fa528c Compare December 19, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant