Skip to content

Add Clockwork Pi board #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2020
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
17 changes: 16 additions & 1 deletion adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def id(self):
board_id = self._pynq_id()
elif chip_id == chips.A64:
board_id = self._pine64_id()
elif chip_id == chips.A33:
board_id = self._clockwork_pi_id()
return board_id

# pylint: enable=invalid-name
Expand Down Expand Up @@ -252,6 +254,14 @@ def _pynq_id(self):
except FileNotFoundError:
return None

def _clockwork_pi_id(self):
"""Check what type of Clockwork Pi board."""
board_value = self.detector.get_device_model()
board = None
if board_value and "Clockwork CPI3" in board_value:
board = boards.CLOCKWORK_CPI3
return board

@property
def any_96boards(self):
"""Check whether the current board is any 96boards board."""
Expand Down Expand Up @@ -322,6 +332,11 @@ def any_pine64_board(self):
"""Check whether the current board is any Pine64 device."""
return self.id in boards._PINE64_DEV_IDS

@property
def any_clockwork_pi_board(self):
"""Check whether the current board is any Clockwork Pi device."""
return self.CLOCKWORK_CPI3

@property
def any_embedded_linux(self):
"""Check whether the current board is any embedded Linux device."""
Expand All @@ -331,7 +346,7 @@ def any_embedded_linux(self):
self.any_giant_board, self.any_jetson_board, self.any_coral_board,
self.any_odroid_40_pin, self.any_96boards, self.any_sifive_board,
self.any_onion_omega_board, self.any_pine64_board,
self.any_pynq_board,
self.any_pynq_board, self.any_clockwork_pi_board
]
)

Expand Down
3 changes: 3 additions & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ def _linux_id(self): # pylint: disable=too-many-branches,too-many-statements
if self.detector.check_dt_compatible_value('fu500'):
return chips.HFU540

if self.detector.check_dt_compatible_value('sun8i-a33'):
return chips.A33

linux_id = None
hardware = self.detector.get_cpuinfo_field('Hardware')

Expand Down
3 changes: 3 additions & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
NODEMCU = "NODEMCU"
GIANT_BOARD = "GIANT_BOARD"

# Clockwork Pi boards
CLOCKWORK_CPI3 = "CLOCKWORK_CPI3"

# Orange Pi boards
ORANGE_PI_PC = "ORANGE_PI_PC"
ORANGE_PI_R1 = "ORANGE_PI_R1"
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 @@ -24,5 +24,6 @@
MIPS24KEC = "MIPS24KEC"
ZYNQ7000 = "ZYNQ7000"
A64 = "A64"
A33 = "A33"

BCM_RANGE = {'BCM2708', 'BCM2709', 'BCM2711', 'BCM2835', 'BCM2837'}
4 changes: 4 additions & 0 deletions bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV)
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 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)
print("Is this an OS environment variable special case?", detector.board.FTDI_FT232H |
Expand All @@ -44,3 +45,6 @@

if detector.board.any_pine64_board:
print("Pine64 device detected.")

if detector.board.any_clockwork_pi:
print("Clockwork Pi device detected.")