import adafruit_platformdetect.constants.boards as ap_board
from adafruit_blinka.agnostic import board_id, detector
+import busio
# pylint: disable=wildcard-import,unused-wildcard-import,ungrouped-imports
-# pylint: disable=import-outside-toplevel
if board_id == ap_board.FEATHER_HUZZAH:
from adafruit_blinka.board.feather_huzzah import *
elif detector.board.RASPBERRY_PI_A or detector.board.RASPBERRY_PI_B_REV2:
from adafruit_blinka.board.raspberrypi.raspi_1b_rev2 import *
+elif board_id == ap_board.BEAGLEBONE:
+ from adafruit_blinka.board.beagleboard.beaglebone_black import *
+
elif board_id == ap_board.BEAGLEBONE_BLACK:
from adafruit_blinka.board.beagleboard.beaglebone_black import *
elif board_id == ap_board.LUBANCAT_IMX6ULL:
from adafruit_blinka.board.lubancat.lubancat_imx6ull import *
+elif board_id == ap_board.LUBANCAT_STM32MP157:
+ from adafruit_blinka.board.lubancat.lubancat_stm32mp157 import *
+
elif board_id == ap_board.NANOPI_NEO_AIR:
from adafruit_blinka.board.nanopi.neoair import *
elif board_id == ap_board.NANOPI_DUO2:
from adafruit_blinka.board.nanopi.duo2 import *
+elif board_id == ap_board.PICO_U2IF:
+ from adafruit_blinka.board.pico_u2if import *
+
elif "sphinx" in sys.modules:
pass
else:
raise NotImplementedError("Board not supported {}".format(board_id))
+try:
+ if SDA and SCL:
-def I2C():
- """The singleton I2C interface"""
- import busio
+ def I2C():
+ """The singleton I2C interface"""
+ return busio.I2C(SCL, SDA)
- return busio.I2C(SCL, SDA)
+ if SCLK:
+ def SPI():
+ """The singleton SPI interface"""
+ return busio.SPI(SCLK, MOSI, MISO)
-def SPI():
- """The singleton SPI interface"""
- import busio
- return busio.SPI(SCLK, MOSI, MISO)
+except NameError:
+ pass