diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 8451adc5..43d7beca 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -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" @@ -61,7 +62,7 @@ FTDI_FT232H = "FT232H" DRAGONBOARD_410C = "DRAGONBOARD_410C" -SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED" +SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED" # pylint: enable=bad-whitespace @@ -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, @@ -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 @@ -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.""" diff --git a/bin/detect.py b/bin/detect.py index 2b9ac68f..590ab61f 100755 --- a/bin/detect.py +++ b/bin/detect.py @@ -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)