fbsd_gpio: cffi-based Python bindings for FreeBSD libgpio
Requirements:
Python 2.7 or 3.4
cffi
How to install
Python package on FreeBSD 11 have problem when using python source that needed to compile thing, so the easiest way is to use the binary packages uploaded to pypi:
pip install --only-binary freebsd-11 fbsd_gpio
How to use
The fbsd_gpio module expose two classes, GpioController and GpioPin
Use gpio controller unit 0 (/dev/gpioc0) and list all the pins name:
from fbsd_gpio import GpioController
gpioc = GpioController(0)
for pin in gpioc:
print(pin)
Set pin 127 to output and logical value 1
from fbsd_gpio import GpioController, GPIO_VALUE_HIGH
gpioc = GpioController(0)
gpioc.pin_output(127)
# The two following lines are equivalent
gpioc.pin_set(127, GPIO_VALUE_HIGH)
gpioc.pin_high(127)
Alternativelly you can use the GpioPin class:
from fbsd_gpio import GpioPin, GPIO_VALUE_HIGH
pin = GpioPin(127, unit=0)
pin.ouput = True
# The following lines are equivalent
pin.set(GPIO_VALUE_HIGH)
pin.high()
pin(GPIO_VALUE_HIGH)
Or use the name of the pin directly:
from fbsd_gpio import GpioController, GPIO_VALUE_HIGH
gpioc = GpioController(0)
gpioc.gpioled0.output = True
# The three following lines are equivalent
gpioc.gpioled.set(GPIO_VALUE_HIGH)
gpioc.gpioled0.high()
gpioc.gpioled0(GPIO_VALUE_HIGH)
Get the value of a pin:
from fbsd_gpio import GpioPin
pin = GpioPin(128, unit=0)
if pin.input:
print('Pin is input mode')
else
print('Pin is output mode')
# The two following lines are equivalent
value = pin.get()
value = pin()
Toggle the value of a pin:
from fbsd_gpio import GpioPin
pin = GpioPin(128, unit=0)
pin.toggle()
Change the name of a pin:
from fbsd_gpio import GpioPin
pin = GpioPin(128, unit=0)
pin.name = 'green_led'
Metadata
Release files for fbsd_gpio 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fbsd_gpio-0.5.0.tar.gz | 5.3 kB | Without provenance | Details for fbsd_gpio-0.5.0.tar.gz |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py34.tar.gz | Details for fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py34.tar.gz | |||
| fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py27.tar.gz | Details for fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py27.tar.gz |
Total release size: 34.9 kB
Release files / fbsd_gpio-0.5.0.tar.gz
| Download URL | fbsd_gpio-0.5.0.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1842c0bf0f1120d61f9a128419d67f7365e710501e66f8387557bccbc6e00dc8
|
|
BLAKE2b-256 checksum How to use checksums |
56f0c08556faee2797eb0dad7d01b43815f7ea319c461ff4ac8c3215a3a3fb51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py34.tar.gz
| Download URL | fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py34.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a0749d85cf6ed287d177c9d674dc63b25ff53321faf68faabb2559472260f223
|
|
BLAKE2b-256 checksum How to use checksums |
2ff9bae77564332854afdef6a27530a53afe3c89b7f0ed7cf0c1f808dd861cb8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py27.tar.gz
| Download URL | fbsd_gpio-0.5.0.freebsd-11.0-CURRENT-arm-py27.tar.gz |
|---|---|
| Size | 14.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
602487371e9fcfb05e7fafebe2b8731f63b20055177244c276f4a12db390f742
|
|
BLAKE2b-256 checksum How to use checksums |
5ba0efc00eb75f74afbde525ceae14dfc772335d22f3e5c1b60b583d9ed1087a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for fbsd_gpio 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.