Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pavelrevak/gpiosam
Fast GPIO Python driver for Atmel SAM MCUs running Linux
https://github.com/pavelrevak/gpiosam
atmel gpio linux python sam
Last synced: 1 day ago
JSON representation
Fast GPIO Python driver for Atmel SAM MCUs running Linux
- Host: GitHub
- URL: https://github.com/pavelrevak/gpiosam
- Owner: pavelrevak
- License: mit
- Created: 2015-04-20T20:42:15.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-02T12:06:06.000Z (over 9 years ago)
- Last Synced: 2023-08-02T18:12:40.993Z (over 1 year ago)
- Topics: atmel, gpio, linux, python, sam
- Language: Python
- Homepage:
- Size: 176 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gpiosam
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## Installation
`sudo python setup.py install`## Examples:
```python
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
```
## API:
### Gpio(port, pin)
initialize GPIO on *port* and *pin*### Gpio.enable
property (rw) to enable or disable gpio### Gpio.output_mode
property (rw) *true* to configure GPIO as output or *false* as input### Gpio.open_drain
property (rw) to configure GPIO as open drain if is as outpu### Gpio.pull_up
property (rw) control pull up resistors### Gpio.pull_down
property (rw) control pull down resistors### Gpio.output
property (rw) to control output on GPIO### Gpio.input
property (r) to read GPIO value