Skip to content

Added Raspberry Pi CM3+ and Compute Module detection #32

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 2 commits into from
Jul 19, 2019
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
18 changes: 17 additions & 1 deletion adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
RASPBERRY_PI_3B_PLUS = "RASPBERRY_PI_3B_PLUS"
RASPBERRY_PI_CM3 = "RASPBERRY_PI_CM3"
RASPBERRY_PI_3A_PLUS = "RASPBERRY_PI_3A_PLUS"
RASPBERRY_PI_CM3_PLUS = "RASPBERRY_PI_CM3_PLUS"
RASPBERRY_PI_4B = "RASPBERRY_PI_4B"

ODROID_C1 = "ODROID_C1"
Expand All @@ -61,7 +62,7 @@
FTDI_FT232H = "FT232H"
DRAGONBOARD_410C = "DRAGONBOARD_410C"

SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED"
SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED"

# pylint: enable=bad-whitespace

Expand Down Expand Up @@ -94,6 +95,12 @@
RASPBERRY_PI_4B
)

_RASPBERRY_PI_CM_IDS = (
RASPBERRY_PI_CM1,
RASPBERRY_PI_CM3,
RASPBERRY_PI_CM3_PLUS
)

_ODROID_40_PIN_IDS = (
ODROID_C1,
ODROID_C1_PLUS,
Expand Down Expand Up @@ -259,6 +266,10 @@
'9020e0',
'19020e0', '29020e0', # warranty bits
),
RASPBERRY_PI_CM3_PLUS: (
'a02100',
'1a02100', '2a02100', # warranty bits
),
RASPBERRY_PI_4B: (
'a03111', 'b03111', 'c03111',
'1a03111', '2a03111', '1b03111', '2b03111', # warranty bits
Expand Down Expand Up @@ -419,6 +430,11 @@ def any_raspberry_pi_40_pin(self):
"""Check whether the current board is any 40-pin Raspberry Pi."""
return self.id in _RASPBERRY_PI_40_PIN_IDS

@property
def any_raspberry_pi_cm(self):
"""Check whether the current board is any Compute Module Raspberry Pi."""
return self.id in _RASPBERRY_PI_CM_IDS

@property
def any_beaglebone(self):
"""Check whether the current board is any Beaglebone-family system."""
Expand Down
1 change: 1 addition & 0 deletions bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
print("Is this a Pi 3B+?", detector.board.RASPBERRY_PI_3B_PLUS)
print("Is this a Pi 4B?", detector.board.RASPBERRY_PI_4B)
print("Is this a 40-pin Raspberry Pi?", detector.board.any_raspberry_pi_40_pin)
print("Is this a Raspberry Pi Compute Module?", detector.board.any_raspberry_pi_cm)
print("Is this a BBB?", detector.board.BEAGLEBONE_BLACK)
print("Is this a Giant Board?", detector.board.GIANT_BOARD)
print("Is this a Coral Edge TPU?", detector.board.CORAL_EDGE_TPU_DEV)
Expand Down