Skip to content
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

adc: add IOCTL commands ANIOC_RESET_FIFO and ANIOC_SAMPLES_ON_READ #4288

Merged
merged 1 commit into from Aug 7, 2021

Conversation

michallenc
Copy link
Contributor

Summary

This commit adds two new IOCTL commnands for ADC driver. Command ANIOC_RESET_FIFO resets FIFO head and tail which causes the driver to wait for the new data to be received. Calling this command before reading ADC data in user space ensures that the read data are newly sampled.

Command ANIOC_SAMPLES_ON_READ return the number of read channels in the buffer. This can be useful in nonblocking mode when the application needs to get the samples received before the app was started.

Both IOCTL commands are used only in generic driver section only and do not have any effect on existing architecture specific drivers.

Impact

ADC driver, no impact for current applications.

Testing

Tested on Teensy 4.1

This commit adds two new IOCTL commnands for ADC driver. Command
ANIOC_RESET_FIFO resets FIFO head and tail which causes the driver
to wait for the new data to be received. Calling this command before
reading ADC data in user space ensures that the read data are newly
sampled.

Command ANIOC_SAMPLES_ON_READ return the number of read channels in
the buffer. This can be useful in nonblocking mode when the application
needs to get the samples received before the app was started.

Both IOCTL commands are used only in generic driver section only and do
not have any effect on existing architecture specific drivers.

Signed-off-by: Michal Lenc <michallenc@seznam.cz>
@xiaoxiang781216 xiaoxiang781216 merged commit 87c5cc1 into apache:master Aug 7, 2021
@michallenc michallenc deleted the adc_ioctls branch September 2, 2021 07:31
@Ouss4 Ouss4 added this to To-Add in Release Notes - 10.2 Oct 11, 2021
@jerpelea jerpelea moved this from To-Add to fixes in Release Notes - 10.2 Oct 13, 2021
@jerpelea jerpelea moved this from fixes to Added in Release Notes - 10.2 Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants