Add NanoPi NEO Air and NanoPi Duo2 support

This commit is contained in:
Melissa LeBlanc-Williams 2021-01-20 12:32:34 -08:00
parent 2e344175f4
commit febd68b395
3 changed files with 33 additions and 12 deletions

View file

@ -249,30 +249,34 @@ class Board:
if board_value == "orangepipc":
board = boards.ORANGE_PI_PC
if board_value == "orangepi-r1":
elif board_value == "orangepi-r1":
board = boards.ORANGE_PI_R1
if board_value == "orangepizero":
elif board_value == "orangepizero":
board = boards.ORANGE_PI_ZERO
if board_value == "orangepione":
elif board_value == "orangepione":
board = boards.ORANGE_PI_ONE
if board_value == "orangepilite":
elif board_value == "orangepilite":
board = boards.ORANGE_PI_LITE
if board_value == "orangepiplus2e":
elif board_value == "orangepiplus2e":
board = boards.ORANGE_PI_PLUS_2E
if board_value == "orangepipcplus":
elif board_value == "orangepipcplus":
board = boards.ORANGE_PI_PC_PLUS
if board_value == "pinebook-a64":
elif board_value == "pinebook-a64":
board = boards.PINEBOOK
if board_value == "pineH64":
elif board_value == "pineH64":
board = boards.PINEH64
if board_value == "orangepi2":
elif board_value == "orangepi2":
board = boards.ORANGE_PI_2
if board_value == "bananapim2zero":
elif board_value == "bananapim2zero":
board = boards.BANANA_PI_M2_ZERO
if board_value == "orangepizeroplus2-h5":
elif board_value == "orangepizeroplus2-h5":
board = boards.ORANGE_PI_ZERO_PLUS_2H5
if board_value == "orangepizeroplus":
elif board_value == "orangepizeroplus":
board = boards.ORANGE_PI_ZERO_PLUS
elif board_value == "nanopiair":
board = boards.NANOPI_NEO_AIR
elif board_value == "nanopiduo2":
board = boards.NANOPI_DUO2
return board
@ -398,6 +402,11 @@ class Board:
board = boards._ASUS_TINKER_BOARD_IDS
return board
@property
def any_nanopi(self):
"""Check whether the current board is any defined Nano Pi."""
return self.id in boards._NANOPI_IDS
@property
def any_96boards(self):
"""Check whether the current board is any 96boards board."""
@ -506,6 +515,7 @@ class Board:
self.any_raspberry_pi,
self.any_beaglebone,
self.any_orange_pi,
self.any_nanopi,
self.any_giant_board,
self.any_jetson_board,
self.any_coral_board,

View file

@ -43,6 +43,10 @@ ORANGE_PI_2 = "ORANGE_PI_2"
ORANGE_PI_ZERO_PLUS_2H5 = "ORANGE_PI_ZERO_PLUS_2H5"
ORANGE_PI_ZERO_PLUS = "ORANGE_PI_ZERO_PLUS"
# Nano Pi boards
NANOPI_NEO_AIR = "NANOPI_NEO_AIR"
NANOPI_DUO2 = "NANOPI_DUO2"
# Banana Pi boards
BANANA_PI_M2_ZERO = "BANANA_PI_M2_ZERO"
@ -147,6 +151,12 @@ _ORANGE_PI_IDS = (
ORANGE_PI_ZERO_PLUS,
)
# NanoPi
_NANOPI_IDS = (
NANOPI_NEO_AIR,
NANOPI_DUO2,
)
# BananaPI
_BANANA_PI_IDS = (BANANA_PI_M2_ZERO,)

View file

@ -20,6 +20,7 @@ print("Is this a Coral Dev Board Mini?", detector.board.CORAL_EDGE_TPU_DEV_MINI)
print("Is this a SiFive Unleashed? ", detector.board.SIFIVE_UNLEASHED)
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 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)