feat(i2c): I2C host-mode driver implementation and host unit tests #82
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!82
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/81-i2c-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/i2c_host/hal_i2c_host.c/.h— the I2C driver: prescaler/clock derivation (TRM-derived module-clock search +ICCL/ICCHsplit), 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. Self-contained — no cross-module dependency.Why
Continues the driver-implementation phase started by GPIO (#75/#76), ESM (#77/#78), and UART (#79/#80).
Related Issue
Closes #81
Type of Change
Impact Assessment
Testing
testing/mss/unit/hal_functionality/test_i2c_hostlocally (16 test cases, 67 assertions, all passing) alongside the full existingctestsuite (205/205 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings,-DENABLE_I2C_HOST_MODULEadded); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by off-by-one-ing theICCL/ICCHdivisor computation, confirming the test suite fails (6 assertions), then reverting.PR Size
Size justification / exemption (if L or XL):
959 raw lines across 6 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (
hal_i2c_host.c/.h, 581 lines) and its comprehensive Catch2 spec (test_i2c_host.c, 371 lines, covering clock derivation, both transfer directions, and error paths) don't decompose into independently-reviewable sub-PRs, same rationale as ESM's (#78) and UART's (#80) PRs.Checklist
type(scope): descriptionconvention withRelates to #<issue>footerSummary
hal/mss/i2c_host/hal_i2c_host.c/.h: I2C driver (clock derivation, blocking write/read, error reporting, IRQ handler)ti/drivers/i2c/src/i2c_reg.c(I2CMasterInitClk) — TI hardcodes an 8MHz internal-clock target and fixedd=5, this driver derives both per the TRM's full generality; both agree structurally for this SoC's actual 200MHz VCLK, no correction neededtesting/mss/unit/hal_functionality/test_i2c_host.c(+CMakeLists.txt): Catch2 functional test suitetools/misra/run_misra.sh:-DENABLE_I2C_HOST_MODULEadded