Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
View: 3330|Reply: 1

data / control register (example onboard switch) OK

[Copy link]

12

Threads

30

Posts

150

Credits

Registered member

Rank: 2

Credits
150
Post time 2016-1-15 18:57:11 | Show all posts |Read mode
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 post contains more resources

You have to Login for download or view attachment(s). No Account? Register

x

0

Threads

1

Posts

12

Credits

Novice

Rank: 1

Credits
12
Post time 2016-4-5 03:14:43 | Show all posts
Thank you for your very usefull zip
You have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2019-6-20 01:48 GMT+8 , Processed in 0.026071 second(s), 23 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list