Misc quad encoder updates

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4426 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2012-02-25 18:01:44 +00:00
parent 5f00d22a04
commit a69d50a488
3 changed files with 13 additions and 5 deletions

View File

@ -666,7 +666,7 @@ static int stm32_setup(FAR struct qe_lowerhalf_s *lower)
* configured CLKOUT value (minus one)
*/
stm32_putreg16(priv, STM32_GTIM_PSC_OFFSET, (uint16_t)priv->psc);
stm32_putreg16(priv, STM32_GTIM_PSC_OFFSET, (uint16_t)priv->config->psc);
#if defined(CONFIG_STM32_TIM1_QE) || defined(CONFIG_STM32_TIM8_QE)
if (priv->config->timid == 1 || priv->config->timid == 8)

View File

@ -736,8 +736,10 @@ Where <subdir> is one of the following:
but this must be manually enabled by selecting:
CONFIG_QENCODER=y : Enable the generic Quadrature Encoder infrastructure
CONFIG_STM32_TIM2=y : Enable TIM2
CONFIG_STM32_TIM2_QE=y : Use TIM2 as the quadrature encoder
CONFIG_STM32_TIM8=y : Enable TIM8
CONFIG_STM32_TIM2=n : (Or optionally TIM2)
CONFIG_STM32_TIM8_QE=y : Use TIM8 as the quadrature encoder
CONFIG_STM32_TIM2_QE=y : (Or optionally TIM2)
See also apps/examples/README.txt

View File

@ -327,12 +327,18 @@ CONFIG_STM32_TIM4_CHANNEL=2
#
# Quadrature Encoder configuration.
#
# Uses TIM2 or TIM8. TIM2 also needs CONFIG_STM32_TIM2=y; TIM8 needs CONFIG_STM_TIM8 above.
#
# CONFIG_QENCODER - Enables the upper-half quadrature encoder driver
# CONFIG_STM32_TIMn - Enables TIMn
# CONFIG_STM32_TIMn_QE - Configures TIMn as a quadrature encoder
# CONFIG_STM32_TIMn_QECLKOUT - Used to configure the TIMn prescaler value
#
# Uses TIM2 or TIM8. TIM2 also needs CONFIG_STM32_TIM2=y; TIM8 needs CONFIG_STM_TIM8=y above.
#
CONFIG_QENCODER=n
CONFIG_STM32_TIM2_QE=n
CONFIG_STM32_TIM2_QECLKOUT=28000000
CONFIG_STM32_TIM8_QE=y
CONFIG_STM32_TIM8_QECLKOUT=28000000
#
# General build options