]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/busio.py
Changed error to more appropriate type
[Adafruit_Blinka-hackapet.git] / src / busio.py
index 9702848a841246889af28d575e41db6baa51861a..ddf290d979af53a9b5563c19e7ed428d12fd9044 100755 (executable)
@@ -31,7 +31,7 @@ class I2C(Lockable):
                 self._i2c = _I2C(portId, mode=_I2C.MASTER, baudrate=frequency)
                 break
         else:
-            raise NotImplementedError(
+            raise ValueError(
                 "No Hardware I2C on (scl,sda)={}\nValid I2C ports: {}".format((scl, sda), i2cPorts)
             )
 
@@ -95,7 +95,7 @@ class SPI(Lockable):
                 self._pins = (portSck, portMosi, portMiso)
                 break
         else:
-            raise NotImplementedError(
+            raise ValueError(
                 "No Hardware SPI on (SCLK, MOSI, MISO)={}\nValid SPI ports:{}".
                 format((clock, MOSI, MISO), spiPorts))
 
@@ -230,7 +230,7 @@ class UART(Lockable):
                 )
                 break
         else:
-            raise NotImplementedError(
+            raise ValueError(
                 "No Hardware UART on (tx,rx)={}\nValid UART ports: {}".format((tx, rx), uartPorts)
             )