]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
Merge remote-tracking branch 'adafruit/main'
authorRyan L <ryestar101@gmail.com>
Wed, 22 Jun 2022 19:19:19 +0000 (20:19 +0100)
committerRyan L <ryestar101@gmail.com>
Wed, 22 Jun 2022 19:19:19 +0000 (20:19 +0100)
16 files changed:
docs/api.rst
docs/conf.py
requirements.txt
setup.py
src/adafruit_blinka/board/radxa/radxazero.py [new file with mode: 0644]
src/adafruit_blinka/microcontroller/amlogic/s905y2/__init__.py [new file with mode: 0644]
src/adafruit_blinka/microcontroller/amlogic/s905y2/pin.py [new file with mode: 0644]
src/adafruit_blinka/microcontroller/bcm2711/pin.py
src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein
src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64
src/board.py
src/busio.py
src/digitalio.py
src/microcontroller/__init__.py
src/microcontroller/pin.py
src/onewireio.py [new file with mode: 0644]

index b28e684769b481a3ded654ab2443ba45b59b7c13..148032026b7102c5f89eb19a197e208bfac75892 100755 (executable)
@@ -40,6 +40,9 @@
 .. automodule:: neopixel_write
   :members:
 
+.. automodule:: onewireio
+  :members:
+
 .. automodule:: pulseio
   :members:
 
index 84be26539a0eed8f6239a75cdf4b9dd120f4ec41..0b0b04f87b2b6d7002044709c93ba677760c136f 100755 (executable)
@@ -64,7 +64,7 @@ release = "1.0.0"
 #
 # This is also used if you do content translation via gettext catalogs.
 # Usually you set "language" from the command line for these cases.
-language = None
+language = "en"
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
index 851141cbd0fb9248de81870f5606fc37dfc7aeb1..329c2f0c265e55698254d80c0f9a71b849158a60 100755 (executable)
@@ -7,3 +7,4 @@ sysv_ipc>=1.1.0; sys_platform == 'linux' and platform_machine!='mips'
 pyftdi>=0.40.0
 binho-host-adapter>=0.1.6
 numpy>=1.21.5
+adafruit-circuitpython-typing
index fc2a39b65ffdf51d75c25d8a69a02f1a7a34f4df..67ef7ee4c7d30cf86fa36f2fabb0affb246ae53d 100755 (executable)
--- a/setup.py
+++ b/setup.py
@@ -64,9 +64,11 @@ setup(
         "keypad",
         "micropython",
         "neopixel_write",
+        "onewireio",
         "pulseio",
         "pwmio",
         "rainbowio",
+        "usb_hid",
     ],
     package_data={
         "adafruit_blinka.microcontroller.bcm283x.pulseio": [
@@ -78,6 +80,7 @@ setup(
         "Adafruit-PlatformDetect>=3.13.0",
         "Adafruit-PureIO>=1.1.7",
         "pyftdi>=0.40.0",
+        "adafruit-circuitpython-typing",
     ]
     + board_reqs,
     license="MIT",
diff --git a/src/adafruit_blinka/board/radxa/radxazero.py b/src/adafruit_blinka/board/radxa/radxazero.py
new file mode 100644 (file)
index 0000000..381bfaf
--- /dev/null
@@ -0,0 +1,55 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+"""Pin definitions for the Radxa Zero."""
+
+from adafruit_blinka.microcontroller.amlogic.s905y2 import pin
+
+D3 = pin.GPIOA_14
+D5 = pin.GPIOA_15
+D7 = pin.GPIOAO_3
+D8 = pin.GPIOAO_8
+D10 = pin.GPIOAO_1
+D11 = pin.GPIOAO_2
+D12 = pin.GPIOX_9
+D13 = pin.GPIOX_11
+D16 = pin.GPIOX_10
+D18 = pin.GPIOX_8
+D19 = pin.GPIOH_4
+D21 = pin.GPIOH_5
+D23 = pin.GPIOH_7
+D24 = pin.GPIOH_6
+D27 = pin.GPIOAO_3
+D28 = pin.GPIOAO_2
+D32 = pin.GPIOAO_4
+D35 = pin.GPIOAO_8
+D36 = pin.GPIOH_8
+D37 = pin.GPIOAO_9
+D38 = pin.GPIOAO_10
+D40 = pin.GPIOAO_11
+
+SDA1 = D24
+SCL1 = D23
+
+SDA3 = D3
+SCL3 = D5
+
+SDA4 = D27
+SCL4 = D28
+
+SCLK = D13
+MOSI = D18
+MISO = D12
+
+SCLK1 = D23
+MOSI1 = D19
+MISO1 = D21
+
+UART_TX = D11
+UART_RX = D7
+
+UART_TX1 = D18
+UART_RX1 = D12
+
+UART_TX4 = D23
+UART_RX4 = D24
diff --git a/src/adafruit_blinka/microcontroller/amlogic/s905y2/__init__.py b/src/adafruit_blinka/microcontroller/amlogic/s905y2/__init__.py
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/src/adafruit_blinka/microcontroller/amlogic/s905y2/pin.py b/src/adafruit_blinka/microcontroller/amlogic/s905y2/pin.py
new file mode 100644 (file)
index 0000000..2d0bfff
--- /dev/null
@@ -0,0 +1,75 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+"""AmLogic s905y2 pin names"""
+# pylint: disable=wildcard-import,unused-wildcard-import
+from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
+
+periphs = 0
+aobus = 1
+
+GPIO412 = GPIOAO_0 = Pin((aobus, 0))
+GPIO413 = GPIOAO_1 = Pin((aobus, 1))
+GPIO414 = GPIOAO_2 = Pin((aobus, 2))
+GPIO415 = GPIOAO_3 = Pin((aobus, 3))
+GPIO416 = GPIOAO_4 = Pin((aobus, 4))
+
+GPIO420 = GPIOAO_8 = Pin((aobus, 8))
+GPIO421 = GPIOAO_9 = Pin((aobus, 9))
+GPIO422 = GPIOAO_10 = Pin((aobus, 10))
+GPIO423 = GPIOAO_11 = Pin((aobus, 11))
+
+GPIO447 = GPIOH_4 = Pin((periphs, 20))
+GPIO448 = GPIOH_5 = Pin((periphs, 21))
+GPIO449 = GPIOH_6 = Pin((periphs, 22))
+GPIO450 = GPIOH_7 = Pin((periphs, 23))
+GPIO451 = GPIOH_8 = Pin((periphs, 24))
+
+GPIO490 = GPIOA_14 = Pin((periphs, 63))
+GPIO491 = GPIOA_15 = Pin((periphs, 64))
+
+
+GPIO500 = GPIOX_8 = Pin((periphs, 73))
+GPIO501 = GPIOX_9 = Pin((periphs, 74))
+GPIO502 = GPIOX_10 = Pin((periphs, 75))
+GPIO503 = GPIOX_11 = Pin((periphs, 76))
+
+
+I2C1_SDA = GPIOH_6
+I2C1_SCL = GPIOH_7
+I2C3_SDA = GPIOA_14
+I2C3_SCL = GPIOA_15
+I2C4_SDA = GPIOAO_3
+I2C4_SCL = GPIOAO_2
+
+SPIA_SCLK = GPIOX_11
+SPIA_MISO = GPIOX_9
+SPIA_MOSI = GPIOX_8
+
+SPIB_SCLK = GPIOH_7
+SPIB_MISO = GPIOH_5
+SPIB_MOSI = GPIOH_4
+
+UARTA_TX = GPIOAO_2
+UARTA_RX = GPIOAO_3
+UARTB_TX = GPIOAO_8
+UARTB_RX = GPIOAO_9
+UARTC_TX = GPIOH_7
+UARTC_RX = GPIOH_6
+
+i2cPorts = (
+    (1, I2C1_SCL, I2C1_SDA),
+    (3, I2C3_SCL, I2C3_SDA),
+    (4, I2C4_SCL, I2C4_SDA),
+)
+
+spiPorts = (
+    (0, SPIA_SCLK, SPIA_MOSI, SPIA_MISO),
+    (1, SPIB_SCLK, SPIB_MOSI, SPIB_MISO),
+)
+
+uartPorts = (
+    (0, UARTA_TX, UARTA_RX),
+    (1, UARTB_TX, UARTB_RX),
+    (4, UARTC_TX, UARTC_RX),
+)
index 91b40305b1432d4cb3a35baf2531ab33ce5f1cb8..ffc508b0b8e9f460bb4e559b45369ee46641eefa 100644 (file)
@@ -82,7 +82,7 @@ D45 = Pin(45)
 # ordered as spiId, sckId, mosiId, misoId
 spiPorts = (
     (0, SCLK, MOSI, MISO),
-    (6, SCLK_1, MOSI_1, MISO_1),
+    (1, SCLK_1, MOSI_1, MISO_1),
     (2, SCLK_2, MOSI_2, MISO_2),
     (3, D3, D2, D1),
     (4, D7, D6, D5),
index 0291c1b4669cd98f02f2d1c9d489ed13f1d9ca2f..e1783f8e47196dd044e4abf2ad42de742342bc29 100755 (executable)
Binary files a/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein and b/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein differ
index 0143060ba9a7451f75a73c7cea934fcb8a6304da..1bad045af84826f0dda15bc3584a1a7b45ce6a13 100755 (executable)
Binary files a/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64 and b/src/adafruit_blinka/microcontroller/bcm283x/pulseio/libgpiod_pulsein64 differ
index 656216b50b4ff3d6276b13994f2e4af4a97d9ba2..3a51e5caf983a89c8a5f23db576a60934062dd32 100644 (file)
@@ -208,6 +208,9 @@ elif board_id == ap_board.CLOCKWORK_CPI3:
 elif board_id == ap_board.ONION_OMEGA2:
     from adafruit_blinka.board.onion.omega2 import *
 
+elif board_id == ap_board.RADXA_ZERO:
+    from adafruit_blinka.board.radxa.radxazero import *
+
 elif board_id == ap_board.ROCK_PI_S:
     from adafruit_blinka.board.radxa.rockpis import *
 
index 0605ee901d56f32adaa9b1879ec459aa11ae9b68..dd748a596f0d51a798bb246e363c14f813a8bc23 100644 (file)
@@ -492,36 +492,3 @@ class UART(Lockable):
     def write(self, buf):
         """Write to the UART from a buffer"""
         return self._uart.write(buf)
-
-
-class OneWire:
-    """
-    Stub class for OneWire, which is currently not implemented
-    """
-
-    def __init__(self, pin):
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def deinit(self):
-        """
-        Deinitialize the OneWire bus and release any hardware resources for reuse.
-        """
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def reset(self):
-        """
-        Reset the OneWire bus and read presence
-        """
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def read_bit(self):
-        """
-        Read in a bit
-        """
-        raise NotImplementedError("OneWire has not been implemented")
-
-    def write_bit(self, value):
-        """
-        Write out a bit based on value.
-        """
-        raise NotImplementedError("OneWire has not been implemented")
index 509aeced96a6f572a4f6dff6645b5815e0d930e8..6b89bf0a7454b9a2b1480da65c7c8a4425d77df4 100644 (file)
@@ -38,6 +38,8 @@ elif detector.chip.S905:
     from adafruit_blinka.microcontroller.amlogic.s905.pin import Pin
 elif detector.chip.S905X3:
     from adafruit_blinka.microcontroller.amlogic.s905x3.pin import Pin
+elif detector.chip.S905Y2:
+    from adafruit_blinka.microcontroller.amlogic.s905y2.pin import Pin
 elif detector.chip.S922X:
     from adafruit_blinka.microcontroller.amlogic.s922x.pin import Pin
 elif detector.chip.A311D:
index a307a0df29242212026be7970b4ed0d689c74bb3..6865c4e68333954205ff20a5ab66e4fb7f2ce10a 100644 (file)
@@ -68,6 +68,8 @@ elif chip_id == ap_chip.S905:
     from adafruit_blinka.microcontroller.amlogic.s905 import *
 elif chip_id == ap_chip.S905X3:
     from adafruit_blinka.microcontroller.amlogic.s905x3 import *
+elif chip_id == ap_chip.S905Y2:
+    from adafruit_blinka.microcontroller.amlogic.s905y2 import *
 elif chip_id == ap_chip.S922X:
     from adafruit_blinka.microcontroller.amlogic.s922x import *
 elif chip_id == ap_chip.A311D:
@@ -122,6 +124,10 @@ elif chip_id == ap_chip.RP2040_U2IF:
     from adafruit_blinka.microcontroller.rp2040_u2if import *
 elif chip_id == ap_chip.GENERIC_X86:
     print("WARNING: GENERIC_X86 is not fully supported. Some features may not work.")
+elif chip_id is None:
+    print(
+        "WARNING: chip_id == None is not fully supported. Some features may not work."
+    )
 elif "sphinx" in sys.modules:
     pass
 else:
index ab96c7b1fee44061978a0207b9e22869c1cc8010..79627c0417206f407aa885275cdf7c1f66612ece 100644 (file)
@@ -55,6 +55,8 @@ elif chip_id == ap_chip.S905:
     from adafruit_blinka.microcontroller.amlogic.s905.pin import *
 elif chip_id == ap_chip.S905X3:
     from adafruit_blinka.microcontroller.amlogic.s905x3.pin import *
+elif chip_id == ap_chip.S905Y2:
+    from adafruit_blinka.microcontroller.amlogic.s905y2.pin import *
 elif chip_id == ap_chip.S922X:
     from adafruit_blinka.microcontroller.amlogic.s922x.pin import *
 elif chip_id == ap_chip.A311D:
@@ -106,5 +108,13 @@ elif chip_id == ap_chip.RP2040_U2IF:
 elif "sphinx" in sys.modules:
     # pylint: disable=unused-import
     from adafruit_blinka.microcontroller.generic_micropython import Pin
+elif chip_id == ap_chip.GENERIC_X86:
+    print("WARNING: GENERIC_X86 is not fully supported. Some features may not work.")
+    from adafruit_blinka.microcontroller.generic_micropython import Pin
+elif chip_id is None:
+    print(
+        "WARNING: chip_id == None is not fully supported. Some features may not work."
+    )
+    from adafruit_blinka.microcontroller.generic_micropython import Pin
 else:
     raise NotImplementedError("Microcontroller not supported: ", chip_id)
diff --git a/src/onewireio.py b/src/onewireio.py
new file mode 100644 (file)
index 0000000..4e37463
--- /dev/null
@@ -0,0 +1,47 @@
+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
+"""
+`onewireio` - 1-wire bus protocol
+=================================================
+
+See `CircuitPython:onewireio` in CircuitPython for more details.
+
+* Author(s): cefn
+"""
+
+# pylint: disable=import-outside-toplevel,too-many-branches,too-many-statements
+# pylint: disable=too-many-arguments,too-many-function-args,too-many-return-statements
+
+
+class OneWire:
+    """
+    Stub class for OneWire, which is currently not implemented
+    """
+
+    def __init__(self, pin):
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def deinit(self):
+        """
+        Deinitialize the OneWire bus and release any hardware resources for reuse.
+        """
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def reset(self):
+        """
+        Reset the OneWire bus and read presence
+        """
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def read_bit(self):
+        """
+        Read in a bit
+        """
+        raise NotImplementedError("OneWire has not been implemented")
+
+    def write_bit(self, value):
+        """
+        Write out a bit based on value.
+        """
+        raise NotImplementedError("OneWire has not been implemented")