Skip to content

Commit e3f892e

Browse files
authored
Merge pull request #136 from makermelissa/bbai
Add BeagleBone AI Detection
2 parents f7f06c3 + ea97500 commit e3f892e

File tree

5 files changed

+15
-2
lines changed

5 files changed

+15
-2
lines changed

adafruit_platformdetect/board.py

+9
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def id(self):
7575
board_id = self._pi_id()
7676
elif chip_id == chips.AM33XX:
7777
board_id = self._beaglebone_id()
78+
elif chip_id == chips.DRA74X:
79+
board_id = self._bbai_id()
7880
elif chip_id == chips.GENERIC_X86:
7981
board_id = boards.GENERIC_LINUX_PC
8082
elif chip_id == chips.SUN8I:
@@ -232,6 +234,13 @@ def _beaglebone_id(self):
232234

233235
# pylint: enable=no-self-use
234236

237+
def _bbai_id(self):
238+
"""Try to detect id of a Beaglebone AI related board."""
239+
board_value = self.detector.get_device_model()
240+
if "BeagleBone AI" in board_value:
241+
return boards.BEAGLEBONE_AI
242+
return None
243+
235244
# pylint: disable=too-many-return-statements
236245
def _armbian_id(self):
237246
"""Check whether the current board is an OrangePi board."""

adafruit_platformdetect/chip.py

+2
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ def _linux_id(self):
239239
if not linux_id:
240240
if "AM33XX" in hardware:
241241
linux_id = chips.AM33XX
242+
elif "DRA74X" in hardware:
243+
linux_id = chips.DRA74X
242244
elif "sun8i" in hardware:
243245
linux_id = chips.SUN8I
244246
elif "ODROIDC" in hardware:

adafruit_platformdetect/constants/boards.py

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
BEAGLEBONE_ENHANCED = "BEAGLEBONE_ENHANCED"
1313
BEAGLEBONE_USOMIQ = "BEAGLEBONE_USOMIQ"
1414
BEAGLEBONE_AIR = "BEAGLEBONE_AIR"
15+
BEAGLEBONE_AI = "BEAGLEBONE_AI"
1516
BEAGLEBONE_POCKETBONE = "BEAGLEBONE_POCKETBONE"
1617
BEAGLELOGIC_STANDALONE = "BEAGLELOGIC_STANDALONE"
1718
OSD3358_DEV_BOARD = "OSD3358_DEV_BOARD"
@@ -253,6 +254,7 @@
253254
BEAGLEBONE_ENHANCED,
254255
BEAGLEBONE_USOMIQ,
255256
BEAGLEBONE_AIR,
257+
BEAGLEBONE_AI,
256258
BEAGLEBONE_POCKETBONE,
257259
BEAGLELOGIC_STANDALONE,
258260
OSD3358_DEV_BOARD,

adafruit_platformdetect/constants/chips.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Definition of chips."""
22
AM33XX = "AM33XX"
3+
DRA74X = "DRA74X"
34
IMX6ULL = "IMX6ULL"
45
IMX8MX = "IMX8MX"
56
BCM2XXX = "BCM2XXX"

bin/detect.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
print("Is this a Pi 4B?", detector.board.RASPBERRY_PI_4B)
1414
print("Is this a 40-pin Raspberry Pi?", detector.board.any_raspberry_pi_40_pin)
1515
print("Is this a Raspberry Pi Compute Module?", detector.board.any_raspberry_pi_cm)
16-
print("Is this a BeagleBone Black?", detector.board.BEAGLEBONE_BLACK)
17-
print("Is this a BeagleBone Green?", detector.board.BEAGLEBONE_GREEN)
16+
print("Is this a BeagleBone Board?", detector.board.any_beaglebone)
1817
print("Is this a Giant Board?", detector.board.GIANT_BOARD)
1918
print("Is this a Coral Dev Board?", detector.board.CORAL_EDGE_TPU_DEV)
2019
print("Is this a Coral Dev Board Mini?", detector.board.CORAL_EDGE_TPU_DEV_MINI)

0 commit comments

Comments
 (0)