GPIO metrics?

Started by flipflops, February 14, 2013, 03:45:55 AM

Previous topic - Next topic


Does Linux have easy access to the resistance on GPIO pins?

I need to detect the open/closed state of contact switches (doorbell, float, etc) attached to GPIOs.

I assume the best way is to set the GPIO pin type to output and set the pin logic to 1 so it sends 3.3v to the switch mechanism (which returns to ground) and monitor the resistance at the pin to see when it changes from high to low resistance to detect the mechanism closing the circuit.

Is there a documented way to see the resistance of a GPIO pin from the Linux OS?



or if going the GPIO input route, does this MC have integrated pull-up/down resistors and any related documentation?


Let me clarify, if I set pin x to input direction, is the pin state floating, high, or low? and can I enable integrated pull-up/down resistors on the pin to set the default input state to high or low?

I see that there is an "active_low" file in /sys/class/gpio/gpioX/ with a value of 0 but I cant find any supporting documentation.

Any help is appreciated.

Thank you