Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ def id(self) -> Optional[str]:
board_id = boards.ODROID_C4
elif chip_id == chips.S922X:
board_id = boards.ODROID_N2
elif chip_id == chips.A311D:
board_id = boards.KHADAS_VIM3
elif chip_id == chips.EXYNOS5422:
board_id = boards.ODROID_XU4
elif chip_id == chips.FT232H:
Expand Down Expand Up @@ -573,6 +575,11 @@ def any_odroid_40_pin(self) -> bool:
"""Check whether the current board is any defined 40-pin Odroid."""
return self.id in boards._ODROID_40_PIN_IDS

@property
def khadas_vim3_40_pin(self) -> bool:
"""Check whether the current board is any defined 40-pin Khadas VIM3."""
return self.id in boards._KHADAS_40_PIN_IDS

@property
def any_jetson_board(self) -> bool:
"""Check whether the current board is any defined Jetson Board."""
Expand Down Expand Up @@ -647,6 +654,7 @@ def any_embedded_linux(self) -> bool:
self.any_jetson_board,
self.any_coral_board,
self.any_odroid_40_pin,
self.khadas_vim3_40_pin,
self.any_96boards,
self.any_sifive_board,
self.any_onion_omega_board,
Expand Down
7 changes: 7 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ def _linux_id(self) -> Optional[str]:
if self.detector.check_dt_compatible_value("rockchip,rk3328"):
return chips.RK3328

if self.detector.check_dt_compatible_value("amlogic,a311d"):
return chips.A311D

if self.detector.check_dt_compatible_value("st,stm32mp157"):
return chips.STM32MP157

Expand Down Expand Up @@ -276,6 +279,8 @@ def _linux_id(self) -> Optional[str]:
return chips.S922X
if "sm1" in compatible_list:
return chips.S905X3
if "vim3amlogic" in compatible_list:
return chips.A311D
if compatible and "sun50i-a64" in compatible:
linux_id = chips.A64
if compatible and "sun50i-h6" in compatible:
Expand Down Expand Up @@ -318,6 +323,8 @@ def _linux_id(self) -> Optional[str]:
linux_id = chips.S905X3
elif "ODROID-XU4" in hardware:
linux_id = chips.EXYNOS5422
elif "KHADAS-VIM3" in hardware:
linux_id = chips.A311D
elif "SAMA5" in hardware:
linux_id = chips.SAMA5
elif "Pinebook" in hardware:
Expand Down
5 changes: 5 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@
MAAXBOARD = "MAAXBOARD"
MAAXBOARD_MINI = "MAAXBOARD_MINI"

# Khadas VIM3
KHADAS_VIM3 = "KHADAS_VIM3"

_KHADAS_40_PIN_IDS = (KHADAS_VIM3,)

# Asus Tinkerboard
_ASUS_TINKER_BOARD_IDS = (ASUS_TINKER_BOARD,)

Expand Down
1 change: 1 addition & 0 deletions adafruit_platformdetect/constants/chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: MIT

"""Definition of chips."""
A311D = "A311D"
AM33XX = "AM33XX"
DRA74X = "DRA74X"
TDA4VM = "TDA4VM"
Expand Down
4 changes: 4 additions & 0 deletions bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
print("Is this a PYNQ Board?", detector.board.PYNQ_Z1 | detector.board.PYNQ_Z2)
print("Is this a Rock Pi board?", detector.board.any_rock_pi_board)
print("Is this a NanoPi board?", detector.board.any_nanopi)
print("Is this a Khadas VIM3 board?", detector.board.KHADAS_VIM3)
print("Is this a Clockwork Pi board?", detector.board.any_clockwork_pi_board)
print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC)
Expand Down Expand Up @@ -83,6 +84,9 @@
if detector.board.any_odroid_40_pin:
print("Odroid detected.")

if detector.board.khadas_vim3_40_pin:
print("Khadas VIM3 detected.")

if detector.board.any_onion_omega_board:
print("Onion Omega detected.")

Expand Down