From 2ccced1deb1d8e8b6b5085e7b19ff15f1549be95 Mon Sep 17 00:00:00 2001 From: Marshal Horn Date: Thu, 9 Jul 2020 10:37:46 -0700 Subject: [PATCH] Added preliminary support for encoder --- ChibiOS | 2 +- NIL-STM32F051-DISCOVERY/cfg/halconf.h | 7 +++++++ NIL-STM32F051-DISCOVERY/cfg/mcuconf.h | 10 ++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChibiOS b/ChibiOS index ba3518f..2bbd155 160000 --- a/ChibiOS +++ b/ChibiOS @@ -1 +1 @@ -Subproject commit ba3518f69287f7a11c974c77175bf29a5b01392f +Subproject commit 2bbd155b3385520afedc49e8e3d7fdbf060525be diff --git a/NIL-STM32F051-DISCOVERY/cfg/halconf.h b/NIL-STM32F051-DISCOVERY/cfg/halconf.h index 41b9125..007d026 100644 --- a/NIL-STM32F051-DISCOVERY/cfg/halconf.h +++ b/NIL-STM32F051-DISCOVERY/cfg/halconf.h @@ -117,6 +117,13 @@ #define HAL_USE_MMC_SPI FALSE #endif +/** + * @brief Enables the Quadrature Encoder subsystem. + */ +#if !defined(HAL_USE_QEI) || defined(__DOXYGEN__) +#define HAL_USE_QEI TRUE +#endif + /** * @brief Enables the PWM subsystem. */ diff --git a/NIL-STM32F051-DISCOVERY/cfg/mcuconf.h b/NIL-STM32F051-DISCOVERY/cfg/mcuconf.h index 5087a9c..6ee4c69 100644 --- a/NIL-STM32F051-DISCOVERY/cfg/mcuconf.h +++ b/NIL-STM32F051-DISCOVERY/cfg/mcuconf.h @@ -146,6 +146,16 @@ #define STM32_ICU_TIM2_IRQ_PRIORITY 3 #define STM32_ICU_TIM3_IRQ_PRIORITY 3 +/* + * Quadrature Encoder driver settings + */ +#define STM32_QEI_USE_TIM1 TRUE +#define STM32_QEI_USE_TIM2 FALSE +#define STM32_QEI_USE_TIM3 FALSE +#define STM32_QEI_USE_TIM4 FALSE +#define STM32_QEI_USE_TIM5 FALSE +#define STM32_QEI_USE_TIM8 FALSE + /* * PWM driver system settings. */