I have developped a simple driver to measure the period of a signal on a GPT (general purpose timer) pin configured as input.
I currently use it with MQX 3.4 to measure the speed of some fans having a tachometer output connected to GPT0 through GTP3 pins.
This is a quite specific usage of the GPT module where only the input mode is used, and I don't know i this could be useful to someone.
The driver has 4 IOCTLs :
- one to confgure the GTP module (prescaler, ...)
- one to configure a specific pin for measurement (choose trig on rising, falling, or both edges, ...)
- one to start measuring on a pin (measure can be done simultaneously on seveal pins)
- one to stop measuring on a pin and get min/max period between trigs and trig count since measure was started
If someone is interested I can provide the source code.