]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Merge branch 'orangepizero' of https://github.com/hansoostendorp/Adafruit_Blinka
authorMelissa LeBlanc-Williams <melissa@adafruit.com>
Fri, 6 Sep 2019 17:20:51 +0000 (10:20 -0700)
committerMelissa LeBlanc-Williams <melissa@adafruit.com>
Fri, 6 Sep 2019 17:20:51 +0000 (10:20 -0700)
src/adafruit_blinka/board/orangepizero.py [new file with mode: 0644]
src/board.py
src/busio.py

diff --git a/src/adafruit_blinka/board/orangepizero.py b/src/adafruit_blinka/board/orangepizero.py
new file mode 100644 (file)
index 0000000..bb425aa
--- /dev/null
@@ -0,0 +1,36 @@
+"""Pin definitions for the Orange Pi Zero."""
+
+# The Orange Pi Zero uses the AllWinner H2 SoC, but pins 
+# are the same as the AllWinner H3 SoC, so we import those
+from adafruit_blinka.microcontroller.allwinner_h3 import pin
+
+PA12 = pin.PA12
+SDA = pin.PA12
+PA11 = pin.PA11
+SCL = pin.PA11
+PA6 = pin.PA6
+PWM1 = pin.PA6
+PA1 = pin.PA1
+UART2_RX = pin.PA1
+PA0 = pin.PA0
+UART2_TX = pin.PA0
+PA3 = pin.PA3
+UART2_CTS = pin.PA3
+PA10 = pin.PA10
+
+PA13 = pin.PA13
+SPI1_CS = pin.PA13
+PA14 = pin.PA14
+SPI1_CLK = pin.PA14
+PA2 = pin.PA2
+UART2_RTS = pin.PA2
+PA18 = pin.PA18
+TWI1_SCK = pin.PA18
+PG6 = pin.PG6
+UART1_TX = pin.PG6
+PG7 = pin.PG7
+UART1_RX = pin.PG7
+
+SCLK = pin.PA14
+MOSI = pin.PA15
+MISO = pin.PA16
index 5065b2f1f0bb4923eb39f701e3ff22334c18cb63..1e833812082a387a2122f8d1305a393949b985e1 100755 (executable)
@@ -67,6 +67,9 @@ elif board_id == ap_board.ORANGE_PI_PC:
 elif board_id == ap_board.ORANGE_PI_R1:
     from adafruit_blinka.board.orangepir1 import *
 
+elif board_id == ap_board.ORANGE_PI_ZERO:
+    from adafruit_blinka.board.orangepizero import *
+
 elif board_id == ap_board.GIANT_BOARD:
     from adafruit_blinka.board.giantboard import *
 
index 0f4b15b3a4e5304eacf9ef7995ab17b97379d011..0ddf7dc516b0cee5b9d60770329e317dc4cccc51 100755 (executable)
@@ -96,7 +96,7 @@ class SPI(Lockable):
         elif detector.board.any_beaglebone:
             from adafruit_blinka.microcontroller.am335x.pin import Pin
             from adafruit_blinka.microcontroller.generic_linux.spi import SPI as _SPI
-        elif board_id == ap_board.ORANGE_PI_PC or board_id == ap_board.ORANGE_PI_R1:
+        elif board_id == ap_board.ORANGE_PI_PC or board_id == ap_board.ORANGE_PI_R1 or board_id == ap_board.ORANGE_PI_ZERO:
             from adafruit_blinka.microcontroller.allwinner_h3.pin import Pin
             from adafruit_blinka.microcontroller.generic_linux.spi import SPI as _SPI
         elif board_id == ap_board.GIANT_BOARD: