cancel
Showing results for 
Search instead for 
Did you mean: 

what is diffrencce between direct register accessing vs hal.instance?? for example: SPI2->SR; //direct register accessing hspi2.Instance->SR; // hal.instance register accessing

uhaid.1
Associate II
 
3 REPLIES 3
Piranha
Chief II

This has nothing to do with STM32 and even MCUs in general. Only learning the C language can help:

http://www.tutorialspoint.com/cprogramming/index.htm

The latter allows you to change mind and switch to a different SPI painlessly (this may be arguably rare).

JW​

#define SPI_MOTOR    SPI2
 
SPI_MOTOR->SR;

This will do the same.