Fast GPIO Python driver for Atmel AT91SAM MCUs running Linux.
Thanks to good design of GPIO peripheral in SAM MCU is this script fully reentrant.
This driver need root privileges, because it use direct memory access.
Request python v2.7 or v3.x
sudo python setup.py install
import gpiosam
btn = gpiosam.Gpio('A', 27)
btn.enable = True
btn.output_mode = False
btn.pull_up = False
btn.pull_down = True
btn.input
False
btn.input
True
led = gpiosam.Gpio('A', 26)
led.enable = True
led.output_mode = True
led.output = True
led.output
True
led.output = False
led.output
False
led.output = not led.output
led.output
True
initialize GPIO on port and pin
property (rw) to enable or disable gpio
property (rw) true to configure GPIO as output or false as input
property (rw) to configure GPIO as open drain if is as outpu
property (rw) control pull up resistors
property (rw) control pull down resistors
property (rw) to control output on GPIO
property (r) to read GPIO value