We are trying to access GPIO using register level interface.
#define GPIO_CNF_ 0x6000d100
#define GPIO_OE_ 0x6000d000+0x110 //* / GPIO_MSK_OE_* Output Enable
#define GPIO_OUT_ 0x6000d000+0x120 //* / GPIO_MSK_OUT_* GPIO Output Value
#define GPIO_IN_ 0x6000d000+0x130 //* GPIO Input Value (Read Only)
#define GPIO_INT_STA_ 0x6000d000+0x140 //* / GPIO_MSK_INT_STA_* GPIO Interrupt Status
#define GPIO_INT_ENB_ 0x6000d000+0x150 //* / GPIO_MSK_INT_ENB_* Interrupt Enable
#define GPIO_INT_LVL_ 0x6000d000+0x160 //* / GPIO_MSK_INT_LVL_* Interrupt Selection (Edge/Level)
#define GPIO_INT_CLR_ 0x6000d000+0x170 //* Interrupt Flag Set-to-Clear
*(int *)(GPIO_CNF_) = 0x00ff;
*(int *)(GPIO_OE_) = 0xff ;
*(int *)(GPIO_OUT_) = 0xff ;
*(int *)(GPIO_IN_) = 0x00 ;
*(int *)(GPIO_INT_STA_) = 0x00;
*(int *)(GPIO_INT_ENB_) = 0x00;
*(int *)(GPIO_INT_LVL_) = 0x000000;
return 0 ;
Error I am getting:
Program received signal SIGSEGV, Segmentation fault
Can we access those GPIO registers through this above address or not?
Is there any other way to access GPIO registers through register level interface?