what is diffrencce between direct register accessing vs hal.instance??
for example:
SPI2->SR; //direct register accessing
hspi2.Instance->SR; // hal.instance register accessing
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-05 2:21 PM
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-06 8:04 PM
This has nothing to do with STM32 and even MCUs in general. Only learning the C language can help:
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-06 10:24 PM
The latter allows you to change mind and switch to a different SPI painlessly (this may be arguably rare).
​
JW​
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-09-07 11:24 AM
#define SPI_MOTOR SPI2
SPI_MOTOR->SR;
This will do the same.
