I'm wondering if there is some example Teensy 4 code that demonstrates how to measure a positive-going pulse width (as distinct from either pulse position, or frequency) with the best available accuracy, which I presume would mean hardware input capture to avoid uncertain interrupt latencies. In my limited understanding, the PulsePosition library https://github.com/PaulStoffregen/PulsePosition measures time interval from a rising edge to the next rising edge. I want to measure positive pulse width, that is between adjacent rising and falling edges.
AIUI this is simply the Arduino pulseIn(pin, HIGH) functionality, except that I am hoping for better than 1 microsecond resolution, and the ability to capture even very short pulses of approximately 1 usec in length. My pulses are raw sensor output and not part of a defined communication protocol, and they may be any length from about 1 usec to about 200 usec and there is no hard limit to the minimum or maximum time interval between successive pulses. If I need to come up with brand-new code, so be it, I just thought the problem might be common enough to have been encountered before.
AIUI this is simply the Arduino pulseIn(pin, HIGH) functionality, except that I am hoping for better than 1 microsecond resolution, and the ability to capture even very short pulses of approximately 1 usec in length. My pulses are raw sensor output and not part of a defined communication protocol, and they may be any length from about 1 usec to about 200 usec and there is no hard limit to the minimum or maximum time interval between successive pulses. If I need to come up with brand-new code, so be it, I just thought the problem might be common enough to have been encountered before.