[Linux-stm32] Counter device Interface for reading out input capture

William Breathitt Gray vilhelm.gray at gmail.com
Fri Nov 6 12:42:17 UTC 2020


On Thu, Nov 05, 2020 at 07:46:14PM +0100, Ahmad Fatoum wrote:
> Hello Benjamin,
> Hello Fabrice,
> 
> In the stm32-timer-cnt driver I find unused #defines for TIM_CCMR_MASK and
> TIM_CCER_MASK, which to me hint that support for the "input capture mode"[1]
> was implemented but removed prior to upstreaming.
> 
> It doesn't look like the counter device API is yet made to support such
> an input capture mode (latching a counter value on an external event, e.g.
> to timestamp incoming rising edges to measure jitter between pulses).
> 
> I am still very new to this, so I figured I ask whether you already have
> thoughts (or maybe code to share) on how to best integrate this with the
> counter device API.
> 
> I've added linux-iio/linux-stm32 to the CC as well, so if someone else
> has an idea how to best do this, please share.
> 
> [1]: 40.3.7 in RM0436 rev 3
> 
> Cheers,
> Ahmad
> 
> -- 
> Pengutronix e.K.                           |                             |
> Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

Hi Ahmad,

Regarding the Counter subsystem, I'm developing a Counter character
device API that supports timestamps for counter devices:
https://lore.kernel.org/linux-arm-kernel/157d1edf-feec-33b5-7ad5-94f99316ca6e@lechnology.com/T/

My aim is to get this functionality picked up for the Linux 5.11 merge
window. I have one more revision at least that should be ready in a
couple weeks -- I'll CC you for that patchset to keep you in the loop;
I force-push periodically to my personal repo when as I develop, so you
can take a look at the current state of this next revision if you're
curious:
https://gitlab.com/vilhelmgray/iio/-/tree/counter_chrdev_v6

Sincerely,

William Breathitt Gray
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://st-md-mailman.stormreply.com/pipermail/linux-stm32/attachments/20201106/3084e824/attachment.sig>


More information about the Linux-stm32 mailing list