feat(epwm): EPWM driver implementation and host unit tests #94
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!94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/93-epwm-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/epwm/hal_epwm.c/.h— the ePWM (Enhanced Pulse Width Modulator) driver: fixed-frequency, adjustable-duty-cycle waveform generation on the EPWMxA output pin.hal_epwm_init()searches the 8x8 HSPCLKDIV/CLKDIV prescale combination space for a working time-base period, configures Time-Base/Counter-Compare/Action-Qualifier submodules (immediate/non-shadowed mode),hal_epwm_set_duty_cycle()reprograms CMPA, andhal_epwm_start()/hal_epwm_stop()toggle the counter mode. All three ePWM instances supported. Polling-only, no IRQ path — the TRM states the interrupt line is generated entirely by the Event-Trigger submodule, which this driver deliberately doesn't model (documented inhal_epwm.h's top-of-file comment). 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), ADCBUF (#85/#86), CBUFF (#87/#88), HWA (#89/#90), and DMM (#91/#92).
Related Issue
Closes #93
Type of Change
Impact Assessment
Testing
testing/mss/unit/hal_functionality/test_epwmlocally (14 test cases, 103 assertions, all passing) alongside the full existingctestsuite (293/293 passing, no regressions); ran a full MISRA C:2025 pass (0 unsuppressed findings,-DENABLE_EPWM_MODULEadded); reformatted and re-verified against the exact clang-format 18.1.3 the CI runner uses; sanity-checked by changing the Action-Qualifier's ZRO event action fromSETtoCLEAR, confirming the test suite fails (1 test case, 2 assertions), then reverting.PR Size
Size justification / exemption (if L or XL):
827 raw lines across 9 files, all hand-reviewed (no mechanically-generated content). Not split further — the driver (
hal_epwm.c/.h, 470 lines) and its comprehensive Catch2 spec (test_epwm.c, 340 lines, covering the prescale-search math, duty-cycle programming, and start/stop sequencing across all three instances) don't decompose into independently-reviewable sub-PRs, same rationale as prior driver PRs (#78, #80, #82, #84, #86, #88, #90, #92). The remaining files are small CMake/Kconfig/MISRA wiring diffs, also not independently reviewable apart from the driver they enable.Checklist
type(scope): descriptionconvention withRelates to #<issue>footerSummary
hal/mss/epwm/hal_epwm.c/.h: ePWM driver (prescale search, Time-Base/Counter-Compare/Action-Qualifier config, duty-cycle update, start/stop) — EPWMxB, Dead-Band, PWM-Chopper, Trip-Zone, Digital-Compare, Event-Trigger, and phase sync all out of scope, documented in the header's top-of-file commenttesting/mss/unit/hal_functionality/test_epwm.c(+CMakeLists.txt): Catch2 functional test suite. No naming collision — noti_hal_comparison/test_epwm.cexists (no TI CSL header or existing driver to cross-check against).zephyr/Kconfig/zephyr/CMakeLists.txt/hal/util/hal_config_mss.h:HAL_AWR6843_EPWMKconfig option andENABLE_EPWM_MODULEbridge, same pattern as every other landed drivertools/misra/run_misra.sh:-DENABLE_EPWM_MODULEadded