Skip to content

drivers: counter: update esp32 support #89932

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sylvioalves
Copy link
Collaborator

@sylvioalves sylvioalves commented May 14, 2025

Update ESP32 counter driver to:

  • Add reset support
  • Add top value callback support
  • Add guard period support
  • Add reliable cancel test support
------ TESTSUITE SUMMARY START ------
SUITE PASS - 100.00% [counter_basic]: pass = 9, fail = 0, skip = 1, total = 10 duration = 4.287 seconds
 - PASS - [counter_basic.test_all_channels] duration = 0.261 seconds
 - PASS - [counter_basic.test_cancelled_alarm_does_not_expire] duration = 2.050 seconds
 - PASS - [counter_basic.test_late_alarm] duration = 0.203 seconds
 - PASS - [counter_basic.test_late_alarm_error] duration = 0.203 seconds
 - SKIP - [counter_basic.test_multiple_alarms] duration = 0.203 seconds
 - PASS - [counter_basic.test_set_top_value_with_alarm] duration = 0.312 seconds
 - PASS - [counter_basic.test_short_relative_alarm] duration = 0.205 seconds
 - PASS - [counter_basic.test_single_shot_alarm_notop] duration = 0.343 seconds
 - PASS - [counter_basic.test_single_shot_alarm_top] duration = 0.273 seconds
 - PASS - [counter_basic.test_valid_function_without_alarm] duration = 0.234 seconds
SUITE PASS - 100.00% [counter_no_callback]: pass = 1, fail = 0, skip = 0, total = 1 duration = 0.206 seconds
 - PASS - [counter_no_callback.test_set_top_value_without_alarm] duration = 0.206 seconds
------ TESTSUITE SUMMARY END ------
===================================================================
PROJECT EXECUTION SUCCESSFUL

@sylvioalves sylvioalves force-pushed the bugfix/counter_reset_top_value branch from b7eb198 to 5364855 Compare May 14, 2025 09:43
@sylvioalves sylvioalves marked this pull request as ready for review May 14, 2025 09:44
@sylvioalves sylvioalves marked this pull request as draft May 14, 2025 12:15
@joelguittet
Copy link
Contributor

@sylvioalves other MCUs have a counter entry in the timer, for example https://github.com/zephyrproject-rtos/zephyr/blob/main/dts/arm/st/l4/stm32l4.dtsi#L320
Possible to have the same for ESP32 so then drivers using counter feature are effectively portable?

@joelguittet
Copy link
Contributor

@sylvioalves for the latest proposal regarding the counter node in the device tree, I just created a PR at #90300.

Adds option to reset counter value.

Signed-off-by: Sylvio Alves <[email protected]>
Implements top value callback and handling.

Signed-off-by: Sylvio Alves <[email protected]>
Implements guard period support.

Signed-off-by: Sylvio Alves <[email protected]>
@sylvioalves sylvioalves force-pushed the bugfix/counter_reset_top_value branch from 5364855 to cf80a67 Compare May 22, 2025 09:44
@sylvioalves sylvioalves marked this pull request as ready for review May 22, 2025 09:46
@sylvioalves sylvioalves requested a review from wmrsouza May 22, 2025 09:46
As part of counter API updates, RTC timer will be removed from
counter API driver and can be removed from the test list.

Signed-off-by: Sylvio Alves <[email protected]>
Allow ESP32 devices to test the scenario where
when alarm should not be triggered after being cancelled.

Signed-off-by: Sylvio Alves <[email protected]>
@sylvioalves sylvioalves force-pushed the bugfix/counter_reset_top_value branch from cf80a67 to 81c02de Compare May 22, 2025 09:48
Copy link

@kartben kartben merged commit dba2d7b into zephyrproject-rtos:main May 26, 2025
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants