1)GPIOA_BASE被强制转换为地 址,空间以GPIO_TypeDef的 类型进行 构建,首址为GPIOA_BASE,空间内有成员,之间依各自固有类型顺序分配相应空间; 2)GPIOA宏展开,即为紧跟其后的具体内容,这样它就是一个指针了:指向以GPIOA_BASE为首址的结构体空间。所以您给出GPIOA->某成员,则操作成立,如取该成员地址、赋值等。
gpio: at91: use dev_read_addr() to get base address Browse files It is strange to use devfdt_get_addr_ptr(), then cast the pointer back to uint32 because you could use devfdt_get_addr() without casting. Convert it to dev_read_addr(), which is capable to CONFIG_OF_LIVE. ...