Reputation: 333
I'm writing a routine in ARM-assembly-code and I have to access a gpio. I can't use the function gpio_get_value from the linux API. ¿Anyone could tell me an alternative way to get the value, either in C or assembly?
Upvotes: 0
Views: 336
Reputation: 93476
There is more that one ARM architecture and instruction set, so you may have to be more specific. Moreover GPIO is not defined by the ARM core, but is implementation specific, so you'd have to specify the exact device (and it would necessarily be different for each device).
If you know the exact device, you only need to read the user reference for the part. GPIO is normally memory-mapped, so it is normally simply a case of reading the appropriate memory address. For a part with an MMU (normal on Linux), the GPIO may or may not be mapped to a virtual address (I am no Linux expert).
Upvotes: 2