Commit 57217a7
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.
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>1 parent f6a9f82 commit 57217a7
File tree
6 files changed
+396
-0
lines changed- drivers
- timers
- include/nuttx/timers
6 files changed
+396
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
301 | 306 | | |
302 | 307 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
87 | 91 | | |
88 | 92 | | |
89 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
117 | 122 | | |
118 | 123 | | |
119 | 124 | | |
| |||
0 commit comments