I read some things about pointers and structures, but I just don’t understand: This is the contents in the microcontroller header file:
#define NVIC_BASE (SCS_BASE + 0x0100) (1)
#define NVIC ((NVIC_Type *) NVIC_BASE) (2)
The last code could be something like:
NVIC->ICER[0] = (1<<4);
Does this fit (due to the definition):
(NVIC_Type *) NVIC_BASE).ICER[0] = (1<<4);
NVIC_Type is a typed structure with some registers for setting and clearing interrupts. Obviously (2) somehow controls that the starting address of the structs is the address of NVIC_BASE. But how?
What does the pointer (*) AFTER this structure in parentheses (NVIC_Type *) mean?
source
share