X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka.git/blobdiff_plain/aa859c73e25d200b6a8de59ec7f9e13185c5a130..bb8f8b71f45446780449a730a741cc952a9f8578:/src/bitbangio.py diff --git a/src/bitbangio.py b/src/bitbangio.py index 241db56..8570620 100755 --- a/src/bitbangio.py +++ b/src/bitbangio.py @@ -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)