]> Repositories - hackapet/Adafruit_Blinka.git/blobdiff - src/microcontroller/__init__.py
Run Black with py3.5, remove unused imports
[hackapet/Adafruit_Blinka.git] / src / microcontroller / __init__.py
index 9e05c81045ea5d1e9485ce6f47ba82ebdbd2adea..03253b3b6fc820d48848b48a520cbb9af8b49aa0 100755 (executable)
@@ -1,4 +1,9 @@
-"""Microcontroller pins"""
+"""
+`microcontroller` - Pin references and cpu functionality
+========================================================
+
+* Author(s): Melissa LeBlanc-Williams
+"""
 
 import sys
 import time
@@ -14,7 +19,12 @@ def delay_us(delay):
 
 
 class Pin(Enum):
-    """Reference Pin object"""
+    """
+    Identifies an IO pin on the microcontroller.
+
+    They are fixed by the hardware so they cannot be constructed on demand. Instead, use board or
+    microcontroller.pin to reference the desired pin.
+    """
 
     def __init__(self, pin_id):
         """Identifier for pin, referencing platform-specific pin id"""
@@ -47,7 +57,14 @@ elif chip_id == ap_chip.STM32F405:
 elif chip_id == ap_chip.RP2040:
     from adafruit_blinka.microcontroller.rp2040 import *
 elif chip_id == ap_chip.BCM2XXX:
-    from adafruit_blinka.microcontroller.bcm283x import *
+    if board_id in [
+        "RASPBERRY_PI_4B",
+        "RASPBERRY_PI_400",
+        "RASPBERRY_PI_CM4",
+    ]:
+        from adafruit_blinka.microcontroller.bcm2711.pin import *
+    else:
+        from adafruit_blinka.microcontroller.bcm283x.pin import *
 elif chip_id == ap_chip.DRA74X:
     from adafruit_blinka.microcontroller.dra74x.pin import *
 elif chip_id == ap_chip.AM33XX:
@@ -116,6 +133,8 @@ elif chip_id == ap_chip.STM32MP157:
     from adafruit_blinka.microcontroller.stm32.stm32mp157.pin import *
 elif chip_id == ap_chip.MT8167:
     from adafruit_blinka.microcontroller.mt8167.pin import *
+elif chip_id == ap_chip.RP2040_U2IF:
+    from adafruit_blinka.microcontroller.rp2040_u2if.pin import *
 elif "sphinx" in sys.modules:
     pass
 else: