feat: CBUFF driver implementation and host unit tests #87

Closed
opened 2026-07-23 13:47:51 +00:00 by hoogv · 0 comments
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.

Deliberately minimal scope (documented in hal_cbuff.h's top-of-file comment): one linklist entry per session, no chained linklist/multi-virtual-channel/LVDS-lane-clocking configuration, and no EDMA-side data feeding.

Use Case / Rationale

As a firmware developer, I need a hal_cbuff_* API to configure and trigger a basic single-source CBUFF streaming session, following the same driver pattern established by GPIO, ESM, UART, I2C, SPI, and ADCBUF.

As a QMS reviewer, I need a host-native Catch2 test suite (testing/mss/unit/hal_functionality/test_cbuff.c) covering session configuration validation, the read-modify-write-free trigger sequencing, and both IRQ handlers, runnable in CI without target hardware.

Acceptance Criteria

  • hal/mss/cbuff/hal_cbuff.c/.h implemented against this project's current hal/registers/component/cbuff.h/instance/cbuff.h
  • testing/mss/unit/hal_functionality/test_cbuff.c passes under ctest
  • Sanity-checked by deliberately breaking a register field/formula and confirming the test suite catches it, then reverting

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.

Relates to #4, relates to #75, relates to #77, relates to #79, relates to #81, relates to #83, relates to #85

### 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. Deliberately minimal scope (documented in `hal_cbuff.h`'s top-of-file comment): one linklist entry per session, no chained linklist/multi-virtual-channel/LVDS-lane-clocking configuration, and no EDMA-side data feeding. ### Use Case / Rationale As a firmware developer, I need a `hal_cbuff_*` API to configure and trigger a basic single-source CBUFF streaming session, following the same driver pattern established by GPIO, ESM, UART, I2C, SPI, and ADCBUF. As a QMS reviewer, I need a host-native Catch2 test suite (`testing/mss/unit/hal_functionality/test_cbuff.c`) covering session configuration validation, the read-modify-write-free trigger sequencing, and both IRQ handlers, runnable in CI without target hardware. ### Acceptance Criteria - [x] `hal/mss/cbuff/hal_cbuff.c`/`.h` implemented against this project's current `hal/registers/component/cbuff.h`/`instance/cbuff.h` - [x] `testing/mss/unit/hal_functionality/test_cbuff.c` passes under `ctest` - [x] Sanity-checked by deliberately breaking a register field/formula and confirming the test suite catches it, then reverting ### 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. ### Related Issues / PRs Relates to #4, relates to #75, relates to #77, relates to #79, relates to #81, relates to #83, relates to #85
hoogv closed this issue 2026-07-23 13:59:23 +00:00
hoogv added this to the Development project 2026-07-23 15:03:22 +00:00
hoogv self-assigned this 2026-07-23 15:03:23 +00:00
Sign in to join this conversation.
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#87
No description provided.