-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Closed
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsChanges to public APIsarea: Counterarea: Drivers
Milestone
Description
Counter.h and rtc.h share almost the same functionality with only minor
differences:
- rtc.h has option for initial value and initial alarm (set by rtc_set_config)
- counter.h has pointer to the user context in the alarm callback
Both interfaces have drawbacks:
- no information about the frequency so alarm is set in ticks which are virtual
- no helper function to convert microseconds or milliseconds to ticks
- in both APIs it is unclear if alarm is one shot or periodic
- interfaces are limiting functionality of peripherals (TIMER, RTC) which usually
have couple of capture/compare channels. Current interfaces allow usage of single channel - lack of information about overflow (unless alarm is periodic and is actual overflow)
- lack of possibility to set alarm for absolute value
Counter.h and RTC.h should be unified. Implementation of unified interface can be based on low power RTC-like peripheral or more accurate high frequency general purpose timers.
Topic already mentioned in #5895
Pull Requests, targeting the topic-counters topic branch:
@nordic-krch to coordinate with @anangl once all PRs are posted.
- API + nRF + tests : PR [DNM] [RFC] drivers: counter: API proposal unifying counter and rtc drivers. #8340
- nRF: PR [DNM] Nrf counter shim #8743
- CMSDK: PR Move CMSDK Counters/Timers to unified interface #10025
- QMSI: Move AON, AONPT counter and QMSI RTC to unified interface #9276
- mcux: Introduce mcux driver for new unified counter/rtc interface #11347
- stm32: Move STM32 RTC to new counter API #11373
- i.MX EPIT: i.MX EPIT Timer Driver #11441
Metadata
Metadata
Assignees
Labels
EnhancementChanges/Updates/Additions to existing featuresChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsChanges to public APIsarea: Counterarea: Drivers