mirror of
https://github.com/linux-sunxi/meta-sunxi.git
synced 2024-12-26 04:58:22 +01:00
python: added pyA20 for controlling GPIO
pyA20 allows controlling GPIO, SPI and I2C on Allwinner boards from python. Although it is named A20 it should work on A10, A13 and other CPUs. Provided by Olimex for their boards but should work for others as well. Tested on A20-OLinuXino-MICRO. Signed-off-by: Jens Lucius <info@jenslucius.com>
This commit is contained in:
parent
0ed1eadb95
commit
339dc8af45
51
recipes-devtools/python/files/setup.py.patch
Normal file
51
recipes-devtools/python/files/setup.py.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
--- pyA20-0.2.0/setup.py 2014-09-04 12:17:18.000000000 +0200
|
||||||
|
+++ pyA20-0.2.0/setup.py 2014-11-24 17:44:37.000000000 +0100
|
||||||
|
@@ -43,31 +43,31 @@
|
||||||
|
Detect processor type
|
||||||
|
:return:
|
||||||
|
"""
|
||||||
|
- cpuinfo = open("/proc/cpuinfo", 'r')
|
||||||
|
- for line in cpuinfo:
|
||||||
|
- if "Hardware" in line:
|
||||||
|
- processor = line.split(":")[1].rstrip()
|
||||||
|
+ #cpuinfo = open("/proc/cpuinfo", 'r')
|
||||||
|
+ #for line in cpuinfo:
|
||||||
|
+ # if "Hardware" in line:
|
||||||
|
+ # processor = line.split(":")[1].rstrip()
|
||||||
|
|
||||||
|
- if "sun4i" in processor:
|
||||||
|
- print ("Detected processor: " + print_color(processor) + " (Probably Allwinner A10)")
|
||||||
|
+ # if "sun4i" in processor:
|
||||||
|
+ # print ("Detected processor: " + print_color(processor) + " (Probably Allwinner A10)")
|
||||||
|
|
||||||
|
- elif "sun5i" in processor:
|
||||||
|
- print ("Detected processor: " + print_color(processor) + " (Probably Allwinner A13)")
|
||||||
|
+ # elif "sun5i" in processor:
|
||||||
|
+ # print ("Detected processor: " + print_color(processor) + " (Probably Allwinner A13)")
|
||||||
|
|
||||||
|
- elif "sun7i" in processor:
|
||||||
|
- print ("Detected processor: " + print_color(processor) + " (Probably Allwinner A20)")
|
||||||
|
+ # elif "sun7i" in processor:
|
||||||
|
+ # print ("Detected processor: " + print_color(processor) + " (Probably Allwinner A20)")
|
||||||
|
|
||||||
|
- else:
|
||||||
|
- print ("Detected processor: " + print_color("unknown"))
|
||||||
|
+ # else:
|
||||||
|
+ # print ("Detected processor: " + print_color("unknown"))
|
||||||
|
|
||||||
|
|
||||||
|
- if processor_type not in processor:
|
||||||
|
- print_warning()
|
||||||
|
+ # if processor_type not in processor:
|
||||||
|
+ # print_warning()
|
||||||
|
|
||||||
|
- return
|
||||||
|
+ return
|
||||||
|
|
||||||
|
- print ("No processor detected")
|
||||||
|
- print_warning()
|
||||||
|
+ #print ("No processor detected")
|
||||||
|
+ #print_warning()
|
||||||
|
|
||||||
|
|
||||||
|
class build_ext(_build_ext):
|
15
recipes-devtools/python/pyA20_0.2.0.bb
Normal file
15
recipes-devtools/python/pyA20_0.2.0.bb
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
DESCRIPTION = "A module to control Allwinner GPIO,SPI and I2C channels"
|
||||||
|
HOMEPAGE = "https://pypi.python.org/pypi/pyA20"
|
||||||
|
SECTION = "devel/python"
|
||||||
|
LICENSE = "MIT"
|
||||||
|
LIC_FILES_CHKSUM = "file://PKG-INFO;md5=b4cb7d5da6f1efc1d0bf487169e83985"
|
||||||
|
|
||||||
|
SRC_URI = "http://pypi.python.org/packages/source/p/pyA20/pyA20-${PV}.tar.gz \
|
||||||
|
file://setup.py.patch \
|
||||||
|
"
|
||||||
|
S = "${WORKDIR}/pyA20-${PV}"
|
||||||
|
|
||||||
|
inherit distutils
|
||||||
|
|
||||||
|
SRC_URI[md5sum] = "b4115859834f09ebd389f810f2ffefb9"
|
||||||
|
SRC_URI[sha256sum] = "9855747d9bbdfcce6b460fcd67d953155e39f4e002a9a4c573910248b451dad8"
|
Loading…
Reference in New Issue
Block a user