summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-17 05:12:42 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-17 05:12:42 +0000
commit8b614e9f7179b5928d5235df3bfa5617ddc4501d (patch)
tree73c5047a9ef689082957a6256cdf6e00b1234555
parentf9e9d03d9447cc298fcee97b34aa5c44fa22e308 (diff)
automatic import of python-gpio
-rw-r--r--.gitignore1
-rw-r--r--python-gpio.spec240
-rw-r--r--sources1
3 files changed, 242 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..b22abec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/gpio-1.0.0.tar.gz
diff --git a/python-gpio.spec b/python-gpio.spec
new file mode 100644
index 0000000..d1d5d85
--- /dev/null
+++ b/python-gpio.spec
@@ -0,0 +1,240 @@
+%global _empty_manifest_terminate_build 0
+Name: python-gpio
+Version: 1.0.0
+Release: 1
+Summary: gpio access via the standard linux sysfs interface
+License: MIT
+URL: https://pypi.org/project/gpio/
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/3d/14/12f7715abee718d57757519edac43ff57370ae5e2aea03cb75fe14fb2ff4/gpio-1.0.0.tar.gz
+BuildArch: noarch
+
+
+%description
+# Linux [sysfs](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) gpio access
+
+This library provides gpio access via the standard linux [sysfs interface](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt)
+
+It is intended to mimick [RPIO](http://pythonhosted.org/RPIO/) as much as possible
+for all features, while also supporting additional (and better named) functionality
+to the same methods.
+
+## Supported Features
+
+- get pin values with `read(pin)` or `input(pin)`
+- set pin values with `write(pin, value)`, `set(pin, value)` or `output(pin, value)`
+- get the pin mode with `mode(pin)`
+- set the pin mode with `setup(pin, mode)`
+ - `mode` can currently equal `gpio.IN` or `gpio.OUT`
+- create a `GPIOPin` class directly to `write` and `read` a pin
+
+## Examples
+
+### RPi.GPIO Drop-in
+
+Good for up to 130KHz pin toggle on a Pi 400.
+
+```python
+import time
+
+import gpio as GPIO
+
+GPIO.setup(14, GPIO.OUT)
+
+while True:
+ GPIO.output(14, GPIO.HIGH)
+ time.sleep(1.0)
+ GPIO.output(14, GPIO.LOW)
+ time.sleep(1.0)
+```
+
+### Use GPIOPin directly
+
+Good for up to 160KHz pin toggle on a Pi 400.
+
+This gives you a class instance you can manipulate directly, eliminating the lookup:
+
+```python
+import gpio
+
+pin = gpio.GPIOPin(14, gpio.OUT)
+
+while True:
+ pin.write(14, GPIO.HIGH)
+ time.sleep(1.0)
+ pin.write(14, GPIO.LOW)
+ time.sleep(1.0)
+```
+
+
+
+
+%package -n python3-gpio
+Summary: gpio access via the standard linux sysfs interface
+Provides: python-gpio
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-gpio
+# Linux [sysfs](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) gpio access
+
+This library provides gpio access via the standard linux [sysfs interface](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt)
+
+It is intended to mimick [RPIO](http://pythonhosted.org/RPIO/) as much as possible
+for all features, while also supporting additional (and better named) functionality
+to the same methods.
+
+## Supported Features
+
+- get pin values with `read(pin)` or `input(pin)`
+- set pin values with `write(pin, value)`, `set(pin, value)` or `output(pin, value)`
+- get the pin mode with `mode(pin)`
+- set the pin mode with `setup(pin, mode)`
+ - `mode` can currently equal `gpio.IN` or `gpio.OUT`
+- create a `GPIOPin` class directly to `write` and `read` a pin
+
+## Examples
+
+### RPi.GPIO Drop-in
+
+Good for up to 130KHz pin toggle on a Pi 400.
+
+```python
+import time
+
+import gpio as GPIO
+
+GPIO.setup(14, GPIO.OUT)
+
+while True:
+ GPIO.output(14, GPIO.HIGH)
+ time.sleep(1.0)
+ GPIO.output(14, GPIO.LOW)
+ time.sleep(1.0)
+```
+
+### Use GPIOPin directly
+
+Good for up to 160KHz pin toggle on a Pi 400.
+
+This gives you a class instance you can manipulate directly, eliminating the lookup:
+
+```python
+import gpio
+
+pin = gpio.GPIOPin(14, gpio.OUT)
+
+while True:
+ pin.write(14, GPIO.HIGH)
+ time.sleep(1.0)
+ pin.write(14, GPIO.LOW)
+ time.sleep(1.0)
+```
+
+
+
+
+%package help
+Summary: Development documents and examples for gpio
+Provides: python3-gpio-doc
+%description help
+# Linux [sysfs](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt) gpio access
+
+This library provides gpio access via the standard linux [sysfs interface](https://www.kernel.org/doc/Documentation/gpio/sysfs.txt)
+
+It is intended to mimick [RPIO](http://pythonhosted.org/RPIO/) as much as possible
+for all features, while also supporting additional (and better named) functionality
+to the same methods.
+
+## Supported Features
+
+- get pin values with `read(pin)` or `input(pin)`
+- set pin values with `write(pin, value)`, `set(pin, value)` or `output(pin, value)`
+- get the pin mode with `mode(pin)`
+- set the pin mode with `setup(pin, mode)`
+ - `mode` can currently equal `gpio.IN` or `gpio.OUT`
+- create a `GPIOPin` class directly to `write` and `read` a pin
+
+## Examples
+
+### RPi.GPIO Drop-in
+
+Good for up to 130KHz pin toggle on a Pi 400.
+
+```python
+import time
+
+import gpio as GPIO
+
+GPIO.setup(14, GPIO.OUT)
+
+while True:
+ GPIO.output(14, GPIO.HIGH)
+ time.sleep(1.0)
+ GPIO.output(14, GPIO.LOW)
+ time.sleep(1.0)
+```
+
+### Use GPIOPin directly
+
+Good for up to 160KHz pin toggle on a Pi 400.
+
+This gives you a class instance you can manipulate directly, eliminating the lookup:
+
+```python
+import gpio
+
+pin = gpio.GPIOPin(14, gpio.OUT)
+
+while True:
+ pin.write(14, GPIO.HIGH)
+ time.sleep(1.0)
+ pin.write(14, GPIO.LOW)
+ time.sleep(1.0)
+```
+
+
+
+
+%prep
+%autosetup -n gpio-1.0.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-gpio -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 17 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..bf393de
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+270558d8c137209eb3f3597efcf07310 gpio-1.0.0.tar.gz