feat: I2C (host mode) driver implementation and host unit tests #81
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#81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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/i2c_host/hal_i2c_host.c/.h— the I2C driver: prescaler/clock derivation (TRM-derived module-clock search + ICCL/ICCH split), blocking write/read with per-byte and transfer-complete poll loops, NACK/arbitration-lost error reporting, and the IRQ handler decodingICSTRto a weak, application-overridablehal_i2c_host_irq_handler()hook.Use Case / Rationale
As a firmware developer, I need a
hal_i2c_host_*API for blocking I2C transfers and clock configuration, following the same driver pattern established by GPIO (#75), ESM (#77), and UART (#79).As a QMS reviewer, I need the clock-prescaler derivation cross-checked against an independent source, the same rigor already applied to UART's baud formula.
User Stories
hal_i2c_host_init()to deriveICPSC/ICCLKL/ICCLKHfrom a peripheral clock and target SCL frequency instead of hand-computing the TRM formula myself.hal_i2c_host_write_blocking()/hal_i2c_host_read_blocking()to report NACK/arbitration-lost/timeout distinctly rather than a generic failure.testing/mss/unit/hal_functionality/test_i2c_host.c) covering the clock derivation, both transfer directions, and error paths, runnable in CI without target hardware.Acceptance Criteria
hal/mss/i2c_host/hal_i2c_host.c/.himplemented against this project's currenthal/registers/component/i2c.h/instance/i2c.htesting/mss/unit/hal_functionality/test_i2c_host.cpasses underctestFunctional Impact
None — self-contained addition alongside the already-landed GPIO/ESM/UART 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