Skip to content

feat(sim): Refactor hardware drivers and implement I2C bus abstraction - #16

Merged
Awesome-Ace22 merged 12 commits into
tests/novaground-test-suitefrom
feature/daqhats-sim
Nov 6, 2026
Merged

Awesome-Ace22 merged 12 commits into
tests/novaground-test-suitefrom
feature/daqhats-sim

Conversation

@Awesome-Ace22

Copy link
Copy Markdown
Contributor

This pull request introduces a major refactor to support simulated hardware for development and CI, adds comprehensive documentation for the simulation mode, and improves the architecture and testability of the codebase. The most significant changes are the introduction of the novaMock build (the real application running on simulated hardware), a clear separation between hardware interfaces and implementations, and improved test coverage with scenario-driven simulation. Additionally, the PR updates build scripts, documentation, and controller interfaces to enable these features.

Simulation and Build System Enhancements:

  • Added a new novaMock executable that runs the real application logic on simulated hardware, using a scenario-driven simulator for DAQ, relays, servos, and GPIO, making it possible to build and test on non-Pi systems and in CI. The build system (meson.build) now conditionally builds novaMock and its integration test if dependencies are available. [1] [2] [3] [4]
  • Updated the build process to separate core, simulated, and real hardware code, and only require hardware-specific libraries when building for real hardware. [1] [2]

Documentation Improvements:

  • Added a new docs/simulation.md describing how the simulated hardware works, how to use scenario files to drive tests, and how to run tests in CI or on a laptop. Updated docs/setup.md to clarify the purpose and capabilities of novaMock. [1] [2]

Controller and Interface Refactoring:

  • Refactored controller classes (GpioController, RelayController) to depend on abstract interfaces (DigitalIo, RelayBank) instead of hardware-specific implementations, improving modularity and enabling simulation. [1] [2] [3] [4] [5]

Sampling and Loop Improvements:

  • Replaced previous sampling loops with new, interruptible loops that support cooperative cancellation via std::stop_token, improving shutdown behavior and testability. Added new sampler.cpp with single-sample and loop functions for DAQ and GPIO, supporting both real and simulated hardware. [1] [2] [3] [4] [5]

Testing and CI Integration:

  • Added an integration test (novamock_smoke) that runs the full application on simulated hardware, verifies telemetry and data logging, and runs automatically in CI if dependencies are present. [1] [2]

These changes collectively enable robust simulation, testing, and development workflows without requiring physical hardware.

  • Simulation and build system:
    • Added novaMock target and scenario-driven simulated hardware; updated meson.build and CI to support simulation and integration testing. [1] [2] [3] [4]
  • Documentation:
    • Added docs/simulation.md and updated docs/setup.md to explain simulation and usage. [1] [2]
  • Controller refactor:
    • Changed controllers to use abstract interfaces (DigitalIo, RelayBank) for better modularity and simulation support. [1] [2] [3] [4] [5]
  • Sampling/loop improvements:
    • Introduced interruptible, stop-token based sampling loops and refactored sampling logic for testability and simulation. [1] [2] [3] [4] [5]
  • Testing:
    • Added scenario-driven integration test for novaMock and improved test coverage in CI. [1] [2]

@Awesome-Ace22
Awesome-Ace22 requested a review from a team as a code owner November 6, 2026 15:40
@Awesome-Ace22 Awesome-Ace22 changed the title Refactor hardware drivers and implement I2C bus abstraction feat(sim): Refactor hardware drivers and implement I2C bus abstraction Nov 6, 2026
@Awesome-Ace22
Awesome-Ace22 merged commit 1adf5db into tests/novaground-test-suite Nov 6, 2026
2 of 16 checks passed
@Awesome-Ace22
Awesome-Ace22 deleted the feature/daqhats-sim branch November 6, 2026 15:44
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