Correct syntax to directly read/write a timer register?
Posted: Mon Apr 26, 2021 4:43 am
Hello,
I apologize for the basic question, but I have a doubt about the correct syntax to directly read / write a timer register.
Should I use, for example:
or
Or are they equivalent? And if so, which one is recommended (I would prefer the second form, which is shorter)?
And also, do I need to include a specific .h file to directly access the timer registers? I am using STM32 Core release 2.0.0 and a STM32F411CE "Black Pill" board.
I apologize for the basic question, but I have a doubt about the correct syntax to directly read / write a timer register.
Should I use, for example:
Code: Select all
TIMER2_BASE->PSC = 0x0000; // disable prescaler
Code: Select all
TIM2->PSC = 0x0000; // disable prescaler
And also, do I need to include a specific .h file to directly access the timer registers? I am using STM32 Core release 2.0.0 and a STM32F411CE "Black Pill" board.