]> Repositories - Adafruit_Blinka-hackapet.git/blobdiff - src/board.py
add I2C and SPI singletons for some drivers
[Adafruit_Blinka-hackapet.git] / src / board.py
index 41711f9d5a901f739ae32684b326e4e33dbea4e7..c89fd43ddcb0fa3a141fbadef00b7f2747f8a817 100755 (executable)
@@ -49,8 +49,8 @@ elif detector.board.any_raspberry_pi_40_pin:
 elif detector.board.RASPBERRY_PI_B_REV1:
     from adafruit_blinka.board.raspi_1b_rev1 import *
 
-elif detector.board.RASPBERRY_PI_B_REV2:
-#    from adafruit_blinka.board.raspi_1b_rev2 import *
+elif detector.board.RASPBERRY_PI_B_REV2:
+    from adafruit_blinka.board.raspi_1b_rev2 import *
 
 elif board_id == ap_board.BEAGLEBONE_BLACK:
     from adafruit_blinka.board.beaglebone_black import *
@@ -58,8 +58,33 @@ elif board_id == ap_board.BEAGLEBONE_BLACK:
 elif board_id == ap_board.ORANGE_PI_PC:
     from adafruit_blinka.board.orangepipc import *
 
+elif board_id == ap_board.GIANT_BOARD:
+    from adafruit_blinka.board.giantboard import *
+
+elif board_id == ap_board.JETSON_TX1:
+    from adafruit_blinka.board.jetson_tx1 import *
+
+elif board_id == ap_board.JETSON_TX2:
+    from adafruit_blinka.board.jetson_tx2 import *
+
+elif board_id == ap_board.JETSON_XAVIER:
+    from adafruit_blinka.board.jetson_xavier import *
+
+elif board_id == ap_board.JETSON_TXX:
+    from adafruit_blinka.board.jetson_txx import *
+
 elif "sphinx" in sys.modules:
     pass
 
 else:
     raise NotImplementedError("Board not supported")
+
+def I2C():
+    """The singleton I2C interface"""
+    import busio
+    return busio.I2C(SCL, SDA)
+
+def SPI():
+    """The singleton SPI interface"""
+    import busio
+    return busio.SPI(SCLK, MOSI, MISO)