diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-14 17:48:25 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-02-14 17:48:25 +0000 |
commit | fa01a80b095d5f01861085adf85fc8160525e464 (patch) | |
tree | 8e046d91a1d4cd89ed2ef349449ccf9907635c9e /nuttx/arch/arm/src/stm32/stm32_qencoder.h | |
parent | eb27d3ee72eef6f00fc98e9896014d8c785f8c0d (diff) | |
download | nuttx-fa01a80b095d5f01861085adf85fc8160525e464.tar.gz nuttx-fa01a80b095d5f01861085adf85fc8160525e464.tar.bz2 nuttx-fa01a80b095d5f01861085adf85fc8160525e464.zip |
More STM32 quadrature encoder code
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4391 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/stm32/stm32_qencoder.h')
-rw-r--r-- | nuttx/arch/arm/src/stm32/stm32_qencoder.h | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/nuttx/arch/arm/src/stm32/stm32_qencoder.h b/nuttx/arch/arm/src/stm32/stm32_qencoder.h index 5c977caad..f0b93f857 100644 --- a/nuttx/arch/arm/src/stm32/stm32_qencoder.h +++ b/nuttx/arch/arm/src/stm32/stm32_qencoder.h @@ -49,6 +49,47 @@ /************************************************************************************ * Included Files ************************************************************************************/ +/* Timer devices may be used for different purposes. One special purpose is as + * a quadrature encoder input device. If CONFIG_STM32_TIMn is defined then the + * CONFIG_STM32_TIMn_QE must also be defined to indicate that timer "n" is intended + * to be used for as a quadrature encoder. + */ + +#ifndef CONFIG_STM32_TIM1 +# undef CONFIG_STM32_TIM1_QE +#endif +#ifndef CONFIG_STM32_TIM2 +# undef CONFIG_STM32_TIM2_QE +#endif +#ifndef CONFIG_STM32_TIM3 +# undef CONFIG_STM32_TIM3_QE +#endif +#ifndef CONFIG_STM32_TIM4 +# undef CONFIG_STM32_TIM4_QE +#endif +#ifndef CONFIG_STM32_TIM5 +# undef CONFIG_STM32_TIM5_QE +#endif +#ifndef CONFIG_STM32_TIM8 +# undef CONFIG_STM32_TIM8_QE +#endif + +/* Only timers 2-5, and 1 & 8 can be used as a quadrature encoder (at least for the + * STM32 F4) + */ + +#undef CONFIG_STM32_TIM6_QE +#undef CONFIG_STM32_TIM7_QE +#undef CONFIG_STM32_TIM9_QE +#undef CONFIG_STM32_TIM10_QE +#undef CONFIG_STM32_TIM11_QE +#undef CONFIG_STM32_TIM12_QE +#undef CONFIG_STM32_TIM13_QE +#undef CONFIG_STM32_TIM14_QE + +/************************************************************************************ + * Included Files + ************************************************************************************/ /************************************************************************************ * Name: stm32_qeinitialize @@ -59,13 +100,14 @@ * * Input Parameters: * devpath - The full path to the driver to register. E.g., "/dev/qe0" + * tim - The timer number to used. time must be an element of {1,2,3,4,5,8} * * Returned Values: * Zero on success; A negated errno value is returned on failure. * ************************************************************************************/ -int stm32_qeinitialize(FAR const char *devpath); +int stm32_qeinitialize(FAR const char *devpath, int tim); #endif /* CONFIG_QENCODER */ #endif /* __ARCH_ARM_SRC_STM32_STM32_QENCODER_H */ |