Array of pointers like (*(volatile unsigned long *)0x40004000)

后端 未结 4 1038
借酒劲吻你
借酒劲吻你 2021-01-04 20:49

I am having a very hard time figuring out how to solve the following problem. I am on an embedded system with very little memory and want to minimize memory usage. Pointers

4条回答
  •  清歌不尽
    2021-01-04 21:28

    If I'm getting you right, this should be enough:

    volatile unsigned long* GPIO_PORTA = (volatile unsigned long*) 0x40004000;
    

    You could use that as

    volatile unsigned long regxx = GPIO_PORTA[0x17];
    
    // even
    
    GPIO_PORTA[10] &= 0xF000;
    

提交回复
热议问题