QEI on the STM32F303

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

Posts: 1
Joined: Fri Aug 11, 2017 1:21 pm

QEI on the STM32F303

Postby momchil » Fri Aug 11, 2017 1:40 pm


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"


#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.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 3 guests