Skip to content

Conversation

FelixWang47831
Copy link
Contributor

For peripherals which does not support alarm function, we can use counter_set_top_value to simulate alarm feature, and the callback will be executed after the timer expired. The alarm time can be changed by setting different top value.

In this code, the original alarm function has higher priority. The top function are only be used when alarm function is unsupported.

For peripherals which does not support alarm function, we can use
counter_set_top_value to simulate alarm feature, and the callback will
be executed after the timer expired. The alarm time can be changed by
setting different top value.

In this code, the original alarm function has higher priority. The
top function are only be used when alarm function is unsupported.

Signed-off-by: Felix Wang <[email protected]>
In mcux_lpit_isr, the first parameter in top_callback is LPIT counter
device, however, in this driver, we create channel devices for each
channel, and mcux_lpit_driver_api is for channel devices, not for
counter device.

To use mcux_lpit_driver_api in callback function, for example, update
period by set_top_value function, we need to pass channel device as
the first parameter of top_callback.

Signed-off-by: Felix Wang <[email protected]>
@sonarqubecloud
Copy link

Enable the alarm samples for frdm_ke17z and
mimxrt1180_evk/cm33.

Signed-off-by: Felix Wang <[email protected]>
@FelixWang47831 FelixWang47831 force-pushed the counter-sample-improvement branch from 7e12c2a to 76351e3 Compare October 21, 2025 10:16
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant