-
Notifications
You must be signed in to change notification settings - Fork 1.4k
drivers/capture: add signal notification support and fake capture driver #17747
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
base: master
Are you sure you want to change the base?
Conversation
|
@Donny9 please fix the conflict |
acassis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Donny9 please include information to this signal notification and this new fake capture to https://nuttx.apache.org/docs/latest/components/drivers/character/timers/capture.html#capture
Done~ @acassis |
This commit adds comprehensive signal notification support to the capture driver, enabling applications to be asynchronously notified when capture edge events occur on any channel, rather than having to poll for events. Background: The capture driver is used to measure frequency and duty cycle of external signals by detecting edges (rising/falling). Previously, applications could only retrieve captured values through periodic polling via CAPIOC_GETDUTY and CAPIOC_GETFREQ ioctl commands, which is inefficient for event-driven applications. Problem: Without event notification, applications must: - Continuously poll the capture device to check for new events - Waste CPU cycles in polling loops - Experience higher latency in responding to capture events - Cannot efficiently handle multiple capture channels simultaneously Solution: This commit adds a signal-based notification mechanism that allows applications to register callbacks for specific capture channels and edge types (rising, falling, or both). When the hardware detects the configured edge, a signal is sent to the registered task. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit introduces a software-based fake capture driver that simulates a 10Hz square wave with 50% duty cycle, enabling development and testing of capture-related applications without requiring real hardware. Background: The capture driver subsystem requires hardware support (timers with input capture functionality) to measure external signal frequency and duty cycle. During development, testing, or on platforms without capture hardware, it's difficult to develop and test applications that use the capture API. Problem: Without a fake/simulator driver: - Developers cannot test capture applications without specific hardware - Continuous Integration (CI) systems cannot run capture-related tests - Applications cannot be developed on platforms lacking capture hardware - Testing edge notification features requires complex hardware setup - Difficult to reproduce specific timing scenarios for debugging Solution: This commit provides a software-simulated capture driver that generates predictable capture events using a watchdog timer. The fake driver produces a square wave signal at 10Hz frequency with 50% duty cycle, allowing applications to test the full capture API without hardware. Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
These documentation updates correspond to commits: - drivers/capture: add signal notification support for edge capture events - drivers/capture: add fake capture driver for testing and development Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
|
@Donny9 strange, still failing |
Summary
patch1:
drivers/capture: add signal notification support for edge capture events
This commit adds comprehensive signal notification support to the capture
driver, enabling applications to be asynchronously notified when capture
edge events occur on any channel, rather than having to poll for events.
patch2:
drivers/capture: add fake capture driver for testing and development
This commit introduces a software-based fake capture driver that simulates
a 10Hz square wave with 50% duty cycle, enabling development and testing
of capture-related applications without requiring real hardware.
Impact
new function about capture
Testing
examples capture
