| 
 | 
 
I found a usefull script on http://docs.cubieboard.org/tutorials/common/gpio_on_lubuntu 
 
I did consult the Allwinner H3 datasheet. 
On page 316  you'll find the exact offsets for each port : PL_DAT 0x24+0x10 
For example port A : PAxx  the offset = 0x10 
*(unsigned int *)(ptr+0x10) = data; (adapt cubieboard example) 
This way you can read and write ports that are not listed in wiringOP 
 
Port L is something special because it starts at a different address   
(page 345) port L 
0x01F02C00 
 
In order to read to onboard switch PL03, you have to switch the bits in the controlregister for this port to 0 (=input) 
(script write_controller_register) 
 
Then you can read out the port using the script (read_test_switch) 
 
compile : gcc script.c -o readswitch   |   
This thread contains more resources
You need to Log in to download or view,No account?   
  Register  
 
x
 
 
 
 
 |