feat(cbuff): CBUFF driver implementation and host unit tests #88

Merged
hoogv merged 1 commit from feat/87-cbuff-driver into dev 2026-07-23 13:59:23 +00:00
Owner

Description

Adds hal/mss/cbuff/hal_cbuff.c/.h — the CBUFF (Common Buffer / High-Speed Interface) driver: controller reset + sticky-status clear on init, single-linklist-entry session configuration (LVDS/CSI-2 interface select, sample format, size, CRC enable, HW/SW trigger source), software session-start trigger, an approximate session-active poll, and the two raw device handlers (CBUFF_IRQHandler/CBUFF_ERR_IRQHandler) decoding STAT_CBUFF_REG0/STAT_CBUFF_REG1 to a weak, application-overridable hal_cbuff_irq_handler() hook. Self-contained — no cross-module dependency.

Why

Continues the driver-implementation phase started by GPIO (#75/#76), ESM (#77/#78), UART (#79/#80), I2C (#81/#82), SPI (#83/#84), and ADCBUF (#85/#86).

Closes #87

Type of Change

  • New feature

Impact Assessment

  • Functional impact: None — self-contained addition alongside the already-landed GPIO/ESM/UART/I2C/SPI/ADCBUF drivers.
  • Regulatory impact: None.
  • QMS impact: None.
  • Risk impact: No — existing risk coverage sufficient.

Testing

  • CI pipeline passes (compile, unit tests, integration tests, static analysis)
  • Manually tested: built and ran testing/mss/unit/hal_functionality/test_cbuff_functional locally (14 test cases, 102 assertions, all passing) alongside the full existing ctest suite (249/249 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings, -DENABLE_CBUFF_MODULE added); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by zeroing the CFG_FRAME_START_TRIG bit in hal_cbuff_trigger_session_start(), confirming the test suite fails (1 assertion), then reverting.
  • No regressions observed in related areas

PR Size

  • XL (> 300 lines) — must split unless exemption declared

Size justification / exemption (if L or XL):

806 raw lines across 9 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (hal_cbuff.c/.h, 353 lines) and its comprehensive Catch2 spec (test_cbuff.c, 332 lines, covering session configuration validation, the RMW-hazard-free trigger sequence, and both IRQ handlers) don't decompose into independently-reviewable sub-PRs, same rationale as prior driver PRs (#78, #80, #82, #84, #86). The remaining files are small CMake/Kconfig/MISRA wiring diffs (~120 lines total), also not independently reviewable apart from the driver they enable.

Checklist

  • Commit messages follow type(scope): description convention with Relates to #<issue> footer
  • PR template filled in completely
  • No unverified external binaries introduced (see QMS-GITFLOW-001 Binary Security section)
  • All commits leave the codebase in a compilable, passing-tests state (Commit Integrity Rule)

Summary

  • hal/mss/cbuff/hal_cbuff.c/.h: CBUFF driver (init/reset, session config, SW trigger, session-active poll, IRQ handlers) — deliberately minimal scope (one linklist entry per session), documented in the header's top-of-file comment
  • testing/mss/unit/hal_functionality/test_cbuff.c (+ CMakeLists.txt): Catch2 functional test suite. Named test_cbuff_functional (not test_cbuff) to avoid a CMake target-name collision with ti_hal_comparison/test_cbuff.c's register-layout comparison test.
  • zephyr/Kconfig / zephyr/CMakeLists.txt / hal/util/hal_config_mss.h: HAL_AWR6843_CBUFF Kconfig option and ENABLE_CBUFF_MODULE bridge, same pattern as every other landed driver
  • tools/misra/run_misra.sh: -DENABLE_CBUFF_MODULE added
## Description Adds `hal/mss/cbuff/hal_cbuff.c`/`.h` — the CBUFF (Common Buffer / High-Speed Interface) driver: controller reset + sticky-status clear on init, single-linklist-entry session configuration (LVDS/CSI-2 interface select, sample format, size, CRC enable, HW/SW trigger source), software session-start trigger, an approximate session-active poll, and the two raw device handlers (`CBUFF_IRQHandler`/`CBUFF_ERR_IRQHandler`) decoding `STAT_CBUFF_REG0`/`STAT_CBUFF_REG1` to a weak, application-overridable `hal_cbuff_irq_handler()` hook. Self-contained — no cross-module dependency. ## Why Continues the driver-implementation phase started by GPIO (#75/#76), ESM (#77/#78), UART (#79/#80), I2C (#81/#82), SPI (#83/#84), and ADCBUF (#85/#86). ## Related Issue Closes #87 ## Type of Change - [x] New feature ## Impact Assessment - **Functional impact:** None — self-contained addition alongside the already-landed GPIO/ESM/UART/I2C/SPI/ADCBUF drivers. - **Regulatory impact:** None. - **QMS impact:** None. - **Risk impact:** No — existing risk coverage sufficient. ## Testing - [x] CI pipeline passes (compile, unit tests, integration tests, static analysis) - [x] Manually tested: built and ran `testing/mss/unit/hal_functionality/test_cbuff_functional` locally (14 test cases, 102 assertions, all passing) alongside the full existing `ctest` suite (249/249 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings, `-DENABLE_CBUFF_MODULE` added); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by zeroing the `CFG_FRAME_START_TRIG` bit in `hal_cbuff_trigger_session_start()`, confirming the test suite fails (1 assertion), then reverting. - [x] No regressions observed in related areas ## PR Size - [x] XL (> 300 lines) — must split unless exemption declared **Size justification / exemption (if L or XL):** 806 raw lines across 9 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (`hal_cbuff.c`/`.h`, 353 lines) and its comprehensive Catch2 spec (`test_cbuff.c`, 332 lines, covering session configuration validation, the RMW-hazard-free trigger sequence, and both IRQ handlers) don't decompose into independently-reviewable sub-PRs, same rationale as prior driver PRs (#78, #80, #82, #84, #86). The remaining files are small CMake/Kconfig/MISRA wiring diffs (~120 lines total), also not independently reviewable apart from the driver they enable. ## Checklist - [x] Commit messages follow `type(scope): description` convention with `Relates to #<issue>` footer - [x] PR template filled in completely - [x] No unverified external binaries introduced (see QMS-GITFLOW-001 Binary Security section) - [x] All commits leave the codebase in a compilable, passing-tests state (Commit Integrity Rule) ## Summary - `hal/mss/cbuff/hal_cbuff.c`/`.h`: CBUFF driver (init/reset, session config, SW trigger, session-active poll, IRQ handlers) — deliberately minimal scope (one linklist entry per session), documented in the header's top-of-file comment - `testing/mss/unit/hal_functionality/test_cbuff.c` (+ `CMakeLists.txt`): Catch2 functional test suite. Named `test_cbuff_functional` (not `test_cbuff`) to avoid a CMake target-name collision with `ti_hal_comparison/test_cbuff.c`'s register-layout comparison test. - `zephyr/Kconfig` / `zephyr/CMakeLists.txt` / `hal/util/hal_config_mss.h`: `HAL_AWR6843_CBUFF` Kconfig option and `ENABLE_CBUFF_MODULE` bridge, same pattern as every other landed driver - `tools/misra/run_misra.sh`: `-DENABLE_CBUFF_MODULE` added
feat(cbuff): CBUFF driver implementation and host unit tests
All checks were successful
lint / clang-format (pull_request) Successful in 12s
lint / misra (pull_request) Successful in 31s
tests / host-tests (pull_request) Successful in 41s
lint / clang-format (push) Successful in 12s
lint / misra (push) Successful in 31s
tests / host-tests (push) Successful in 50s
0b5857a378
Adds hal/mss/cbuff/hal_cbuff.c/.h - controller reset + sticky-status
clear on init, single-linklist-entry session configuration, software
session-start trigger, session-active poll, and the two raw device
handlers (CBUFF_IRQHandler/CBUFF_ERR_IRQHandler) decoding
STAT_CBUFF_REG0/REG1 to a weak hal_cbuff_irq_handler() hook.

Relates to #4, relates to #87
hoogv added this to the Development project 2026-07-23 13:58:43 +00:00
Sign in to join this conversation.
No reviewers
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
opendutchsolutions.public/hal_awr6843!88
No description provided.