gpio for linux
Project description
g4l
- gpio for linux (tested with jetson tx2, nano)
- link : https://gitlab.com/telelian/peripheral-library/g4l
Usage
class
- Gpio(num)
- parameter
- num : gpio number
- parameter
methods
-
Gpio.direction(dir)
- parameters
- dir : pin's direction ( Gpio.IN, Gpio.OUT )
- parameters
-
Gpio.edge(edge)
- parameters
- edge : interrupt edge (Gpio.NONE, Gpio.RISING, Gpio.FALLING, Gpio.BOTH)
- parameters
-
Gpio.input()
- returns
- input value
- returns
-
Gpio.output(value)
- parameters
- value : output value
- parameters
-
Gpio.setisr(isr)
- parameters
- isr : interrupt service routines's callback function
- parameters
example
input interrupt
from time import sleep
from g4l import Gpio
print('g4l example')
gpio = Gpio(100)
gpio.direction(Gpio.IN)
gpio.edge(Gpio.RISING)
gpio.setisr(lambda:print('gpio isr'))
print('loop start - toggle gpio')
cnt = 0
while True:
print(f'loop {cnt}')
cnt += 1
sleep(5)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
g4l-0.1.4.tar.gz
(3.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
g4l-0.1.4-py3-none-any.whl
(3.9 kB
view details)
File details
Details for the file g4l-0.1.4.tar.gz.
File metadata
- Download URL: g4l-0.1.4.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a040a136cfc8da962d67d762d672564e50d7a1acbe8d9eff7b3ee328be0d29c
|
|
| MD5 |
230a6b70604fec47bcedbbadcfa347e9
|
|
| BLAKE2b-256 |
7e31565666351b7d18287477538973a7eac5fbedd56abaa554f85d0a3e83241c
|
File details
Details for the file g4l-0.1.4-py3-none-any.whl.
File metadata
- Download URL: g4l-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f41c96baa5c0771b4655b236363f8bb035116b9e9ff1e3a5992d117076cf810
|
|
| MD5 |
883d1f2b17dd9de748fbb51e8446da56
|
|
| BLAKE2b-256 |
c12938d937bba8ccf9ecdd24e890452dca1bc4908435464616f294afe6c50e00
|