AnsweredAssumed Answered

"gptin" (general purpose timer inputs) driver for MQX on MCF52259

Question asked by gilles buloz on Mar 3, 2011
Latest reply on Mar 14, 2013 by gilles buloz

Hi all,


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.