I'm new to ChibiOS and the discovery board but so far I've been loving it! I'm working on a project that requires encoder feedback, but I can't seem to get the encoder libraries hal_qei and hal_qei_lld to work. The first issue I run into is that the driver QEID1 seems to be undeclared, hence I had to add the two #define lines before I include the libraries:
Code: Select all
#include "ch.h"
#include "hal.h"
#define HAL_USE_QEI TRUE
#define STM32_QEI_USE_TIM1 TRUE
#include "hal_qei.h"
#include "hal_qei_lld.h"
I'm not sure if what I'm doing is correct so any feedback would be appreciated. The other issue I have is the error "invalid type argument of '->' (have 'QEIDriver {aka struct QEIDriver}') hal_qei_lld.h" which is regarding this line of code:
Code: Select all
/**
* @brief Returns the counter value.
*
* @param[in] qeip pointer to the @p QEIDriver object
* @return The current counter value.
*
* @notapi
*/
#define qei_lld_get_count(qeip) ((qeip)->tim->CNT)
I'm running ChibiOS 17.6 on the STM32F303 Discovery board.
Thanks!