title: Read pin level of GPIO?
body: <p>I want to read the level of a GPIO pin. The following is found in the documentation for the chip:</p>
  
  <pre><code>GPIO Pin Level Registers (GPLEVn)
  
  SYNOPSIS    The pin level registers return the actual value of the pin.
              The LEV{n} field gives the value of the respective GPIO pin.
  
  Bit(s)    Field Name        Description              Type    Reset
  21-0      LEVn (n=32..53)   0 = GPIO pin n is low    R/W     0
                              1 = GPIO pin n is high
  </code></pre>
  
  <p>This is the code I have written:</p>
  
  <pre><code>ldr r0,=0x20200038    @ Load address of GPLEV into r0
  mov r1,#1             @ Load value 1 into r1
  lsl r1,#18            @ Left shift value in r1 eighteen places. This corresponds to GPIO50
  str r1,[r0]           @ Store the content of r1 at the address in r0
  </code></pre>
  
  <p>I would now expect to find the pin level in <strong>r0</strong>, but it does not seem to work. Are the above code a correct method for reading the pin level of a GPIO?</p>