Hardware Reference
In-Depth Information
Value at address 0x44E07138 (0xb6f8e138): 0xC000C404
The returned value 0xC000C404 ( 1100 0000 0000 0000 1100 0100 0000
0100 in binary) has bit 31 set to 1 , which means the LED is on. Turn the LED off by
writing 0x80000000 ( 1000 0000 0000 0000 0000 0000 0000 0000 bin-
ary) to the GPIO_CLEARDATA register at 0x44E0_7000 + 0x190 = 0x44E0_7190 :
bone# devmem2 0x44E07190 w 0x80000000
/dev/mem opened.
Memory mapped at address 0xb6fd7000.
Value at address 0x44E07190 (0xb6fd7190): 0x80000000
Written 0x80000000; readback 0x0
The LED is now off.
You read the pushbutton switch in a similar way. Figure 5-18 says P9_42 is GPIO 7,
which means bit 7 is the state of P9_42 . The devmem2 in this example reads 0x0 ,
which means all bits are 0 , including GPIO 7. Section 25.4.1 of the Technical Reference
Manual instructs you to use offset 0x13C to read GPIO_DATAOUT . Push the pushbutton
and run devmem2 :
bone# devmem2 0x44e07138
/dev/mem opened.
Memory mapped at address 0xb6fe2000.
Value at address 0x44E07138 (0xb6fe2138): 0x4000C484
Here, bit 7 is set in 0x4000C484 , showing the button is pushed.
Search WWH ::




Custom Search