AnsweredAssumed Answered

Timer encoder mode in CubeMx code generation

Question asked by kurosz.bartlomiej on Apr 13, 2015
Hello st!

Today i bumped into a problem with code generation for encoders in CubeMx tool.
I've read all topics on this site connected to timers in encoder modes, but all i've found was only not-working-code, or almost-working-code.

Problem:
I would like to run my timers in encoder mode. In other threads i saw Init functions, containing:
(...)
encoder.EncoderMode = TIM_ENCODERMODE_TI12;
(...)
HAL_TIM_Encoder_Init(&timer, &encoder);
(...)

Okay, but isn't it something I should be able to choose in Cube, and then this code would have been generated automatically?  

If there is no way to configure it via Cube, do i have to write the init functions myself? (Because for that mode timer needs to be initialized via hal_tim_encoder_init function, doesn't it?)

I got a bit confused with this.

Btw. I use F3Discovery

Thank you for your answers!

Outcomes