]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/bitbangio.py
Display message to linux user to use new Bitbang Library for now
[Adafruit_Blinka-hackapet.git] / src / bitbangio.py
index 241db56241d03f6916aa7fabbf5b652fe98ba68b..8570620c21b3e92e0e171e2012d62503a1d88ece 100755 (executable)
@@ -16,6 +16,11 @@ class I2C(Lockable):
         # TODO: This one is a bit questionable:
         if agnostic.board_id == ap_board.PYBOARD:
             raise NotImplementedError("No software I2C on {}".format(agnostic.board_id))
+        elif agnostic.detector.board.any_embedded_linux:
+            # TODO: Attempt to load this library automatically
+            raise NotImplementedError(
+                "For bitbangio on Linux, please use Adafruit_CircuitPython_BitbangIO"
+            )
         self.init(scl, sda, frequency)
 
     def init(self, scl, sda, frequency):
@@ -63,6 +68,11 @@ class I2C(Lockable):
 # TODO untested, as actually busio.SPI was on tasklist https://github.com/adafruit/Adafruit_Micropython_Blinka/issues/2 :(
 class SPI(Lockable):
     def __init__(self, clock, MOSI=None, MISO=None):
+        if agnostic.detector.board.any_embedded_linux:
+            # TODO: Attempt to load this library automatically
+            raise NotImplementedError(
+                "For bitbangio on Linux, please use Adafruit_CircuitPython_BitbangIO"
+            )
         from machine import SPI
 
         self._spi = SPI(-1)