Accessing STM32 Registers Via HAL Library
Hi Everyone,
HAL provides direct access to the STM32 registers.
I am using STM32F103C8T6.
Timers 2 to 4 provide PWM.
All initialization is done using CubeMX which uses the HAL libraries.
PWM success after adding HAL_TIM1_PWM_Start(&handler, CHANNEL_x).
Now I want to fluctuate the PWM duty cycle the fastest way and that means DIRECTLY via the register which determines the PWM duty cycle (CCR1 to CCR4 for each output channel) thus NOT going through HAL_TIM_PWM_ConfigChannel because that one does all kinds of other things that slows down the process. HAL_TIM_PWM_ConfigChannel was interesting for ease of intialization of the peripheral (and probably portability to another STM32) but now I want the fastest possible execution time using C language AND via direct register manipulation.
In short: Where is the register access mapping in the HAL library? (I’ve been looking but &htim2->Instance->CCR1 = value isn’t accepted by the compiler, it cries about type conflict.)
Regards,
Ben