feat(spi): SPI (MibSPI host mode) driver implementation and host unit tests #84
No reviewers
Labels
No labels
Category
App
Category
Documentation
Category
Firmware
Category
Hardware
Category
Qms
PR_Size
L
PR_Size
M
PR_Size
S
PR_Size
XL
PR_Size
XS
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Priority
Very Low Priority
Size
Epic
Size
Feature
Size
Task
Status
Blocked
Status
Draft
Status
Needs-review
Team
Board
Team
Dev
Team
Management
Type
Bug
Type
Capa
Type
Improvement
Type
New-feature
Type
Regulatory
Type
Usability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
opendutchsolutions.public/hal_awr6843!84
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/83-spi-driver"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Adds
hal/mss/spi_host/hal_spi_host.c/.h— the SPI driver: MibSPI classic (non-buffered, non-DMA) polling master-mode init (mode 0-3 CPOL/CPHA, prescale clamp), blocking byte-shift write/read viaSPIDAT1/SPIBUF, software chip-select viahal_gpio_write(), and the IRQ handler decodingSPIFLGto a weak, application-overridablehal_spi_host_irq_handler()hook. Depends on the already-landed GPIO driver (#75) for chip-select, but only via a FFF fake in the test suite — no realhal_gpio.clinked.Why
Continues the driver-implementation phase started by GPIO (#75/#76), ESM (#77/#78), UART (#79/#80), and I2C (#81/#82).
Related Issue
Closes #83
Type of Change
Impact Assessment
Testing
testing/mss/unit/hal_functionality/test_spi_hostlocally (17 test cases, 87 assertions, all passing) alongside the full existingctestsuite (222/222 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings,-DENABLE_SPI_HOST_MODULEadded); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by dropping the- 1Ufrom thePRESCALEfield write, confirming the test suite fails (6 assertions), then reverting.PR Size
Size justification / exemption (if L or XL):
765 raw lines across 6 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (
hal_spi_host.c/.h, 397 lines) and its comprehensive Catch2 spec (test_spi_host.c, 359 lines, covering all four SPI modes, prescale clamping, and the FFF-faked GPIO chip-select calls) don't decompose into independently-reviewable sub-PRs, same rationale as prior driver PRs (#78, #80, #82).Checklist
type(scope): descriptionconvention withRelates to #<issue>footerSummary
hal/mss/spi_host/hal_spi_host.c/.h: SPI driver (mode/prescale init, blocking write/read, software chip-select, IRQ handler) — ported fromAWR6xxx_Toolchain'sUniversal_hal spi_host_iwr68xx.c(itself from the mmWave SDK'sMIBSPI_initMaster())PHASE/POLARITYbit mapping against the standard SPI mode table — correct; the prescale formula matches the TRM'sSPICLK = VCLK/(PRESCALE+1)relationship, same derivation pattern as UART's baud divisor and I2C's clock divisortesting/mss/unit/hal_functionality/test_spi_host.c(+CMakeLists.txt): Catch2 functional test suite, using an FFF fake forhal_gpio_write()tools/misra/run_misra.sh:-DENABLE_SPI_HOST_MODULEadded