else:
raise NotImplementedError("Board not supported {}".format(board_id))
-if SDA and SCL:
+try:
+ if SDA and SCL:
- def I2C():
- """The singleton I2C interface"""
- return busio.I2C(SCL, SDA)
+ def I2C():
+ """The singleton I2C interface"""
+ return busio.I2C(SCL, SDA)
+ if SCLK:
-if SCLK:
+ def SPI():
+ """The singleton SPI interface"""
+ return busio.SPI(SCLK, MOSI, MISO)
- def SPI():
- """The singleton SPI interface"""
- return busio.SPI(SCLK, MOSI, MISO)
+
+except NameError:
+ pass