Input capture driver

Hey, everyone,

I am trying to implement a capture interface using Pixhawk (px4fmu-v3), however, I believe that there is no code example for that.

A quick search for INPUT_CAP_SET returns no result though. This is the PX4FMU ioctrl command used to set capture config (edge, callback, etc), as show bellow:

Someone could please help us to initiate a sample capture callback function using drv_input_capture.h? Our goal is to implement a sensor driver that depends on the signal frequency, in other words, calculate the time delay between to consequent raising or falling edges and convert it into a measurement.

Thanks!

Hey ,I also encounter the same problem . If you solved it ,please tell me ,thank you!

Hello, @L3Y1Q2

In fact, px4fmu was not very useful at this point. I had to deploy a particular driver using explicitly this function: https://github.com/PX4/Firmware/blob/master/src/drivers/drv_input_capture.h#L178. I think that it may be easier if you set up port 5 or 6, cf. Pixhawk - Enabling GPIO output

Thanks , @alexh
In fact ,I am a bit confused about how to use aux pins .:sob:
I want to use a pin to input pulse signal and convert it to a topic .And another pin to output.
I don’t know which mode to use and whether there are functions to implement this.
If you have some ideas ,please tell me . Thanks a lot !

I solved it by look at src/drivers/pwm_input