> Thanks Raiden! Can you hint a complete implementation that I can base
> on the ESP32 work? :-)

You can look at
https://github.com/apache/nuttx/blob/master/arch/arm/src/stm32/stm32_qencoder.c
and search for CONFIG_STM32_QENCODER_INDEX_PIN.

sob., 10 cze 2023 o 02:53 Tomek CEDRO <to...@cedro.info> napisał(a):

> On Fri, Jun 9, 2023 at 3:24 AM Nathan Hartman wrote:
> > I know it is sometimes unpopular to suggest adding more Kconfigs but
> maybe
> > this is something that should be configurable, allowing developers to
> > choose if they need a 64-bit count for range or a 32- (or even 16-) bit
> > count for efficiency. The needed speed and counter size really depends on
> > how the application is going to use the qencoder.
>
> I am wondering on something more universal than #ifdef CONFIG and
> wrapping the whole lines of duplicated code..
>
> Maybe a void pointer that would be then casted to a type based on a CONFIG?
>
> Any hints welcome :-)
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>

Reply via email to