Hello everyone,
I am having trouble with pointers, I understand that pointers are just variables that store memory address and here is a example from ARM MCU.
For example there is a special function register called General purpose I/O B Port Data Direction Register or just GPIOB_PDDR.
GPIOB_PDDR has address 0x400FF054 in memory address map and what bothers me is that from a book that I learn ARM MCU author declares variable as
Code:
#define GPIOB_PDDR (*((volatile unsigned int*)0x400FF054))
I understand it this variable has to be type of integer pointer since we store address in it. so part "(volatile unsigned int*)0x400FF054)" is clear to me.
But why do we have another asterix * before the brackets?
Could I declare it something like
Code:
volatile unsigned int* GPIOB_PDDR = 0x400FF054
Also when we write
Code:
GPIOB_PDDR |= 0x80000;
Do we write a value to a register which GPIOB_PDDR aka pointer points to?