diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index b528e3ef..a6ed830a 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -119,6 +119,8 @@ def id(self): board_id = self._clockwork_pi_id() elif chip_id == chips.RK3308: board_id = self._rock_pi_id() + elif chip_id == chips.RK3288: + board_id = self._asus_tinker_board_id() elif chip_id == chips.RYZEN_V1605B: board_id = self._udoo_id() @@ -324,6 +326,14 @@ def _udoo_id(self): return board_id return None + def _asus_tinker_board_id(self): + """Check what type of Tinker Board.""" + board_value = self.detector.get_device_model() + board = None + if board_value and "ASUS Tinker Board" in board_value: + board = boards._ASUS_TINKER_BOARD_IDS + return board + @property def any_96boards(self): """Check whether the current board is any 96boards board.""" @@ -409,6 +419,10 @@ def any_udoo_board(self): """Check to see if the current board is an UDOO board""" return self.id in boards._UDOO_BOARD_IDS + def any_asus_tinker_board(self): + """Check to see if the current board is an ASUS Tinker Board""" + return self.id in boards._ASUS_TINKER_BOARD_IDS + @property def any_embedded_linux(self): """Check whether the current board is any embedded Linux device.""" @@ -429,6 +443,7 @@ def any_embedded_linux(self): self.any_rock_pi_board, self.any_clockwork_pi_board, self.any_udoo_board, + self.any_asus_tinker_board, ] ) diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index dc416c38..f5147a40 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -130,6 +130,9 @@ def _linux_id(self): if self.detector.check_dt_compatible_value("rockchip,rk3308"): return chips.RK3308 + if self.detector.check_dt_compatible_value("rockchip,rk3288"): + return chips.RK3288 + linux_id = None hardware = self.detector.get_cpuinfo_field("Hardware") @@ -212,6 +215,8 @@ def _linux_id(self): linux_id = chips.A64 elif "sun50iw1p1" in hardware: linux_id = chips.A64 + elif "ASUS_TINKER_BOARD" in hardware: + linux_id = chips.RK3288 elif "Xilinx Zynq" in hardware: compatible = self.detector.get_device_compatible() if compatible and "xlnx,zynq-7000" in compatible: diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 6ffb557b..375606f5 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -23,6 +23,10 @@ PYBOARD = "PYBOARD" NODEMCU = "NODEMCU" GIANT_BOARD = "GIANT_BOARD" +_ASUS_TINKER_BOARD = "ASUS_TINKER_BOARD" + +# ASUS Tinker Boards +ASUS_TINKER_BOARD = "ASUS_TINKER_BOARD" # Clockwork Pi boards CLOCKWORK_CPI3 = "CLOCKWORK_CPI3" @@ -100,6 +104,8 @@ # pylint: enable=bad-whitespace +_ASUS_TINKER_BOARD_IDS = ASUS_TINKER_BOARD + # OrangePI _ORANGE_PI_IDS = ( ORANGE_PI_PC, @@ -350,5 +356,8 @@ # Pine64 boards and devices _PINE64_DEV_IDS = (PINE64, PINEBOOK, PINEPHONE) +# ASUS Tinker Board +_ASUS_TINKER_BOARD_DEV_IDS = ASUS_TINKER_BOARD + # UDOO _UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",)} diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index 0fe1cedb..27b46f4b 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -30,5 +30,6 @@ A33 = "A33" RK3308 = "RK3308" LPC4330 = "LPC4330" +RK3288 = "RK3288" BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2835", "BCM2837"} diff --git a/bin/detect.py b/bin/detect.py old mode 100755 new mode 100644 index ff609f9b..c96b7a11 --- a/bin/detect.py +++ b/bin/detect.py @@ -24,6 +24,7 @@ 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 a UDOO Bolt?", detector.board.UDOO_BOLT) +print("Is this an ASUS Tinker Board?", detector.board.ASUS_TINKER_BOARD) print( "Is this an OS environment variable special case?", detector.board.FTDI_FT232H @@ -58,3 +59,6 @@ if detector.board.any_clockwork_pi: print("Clockwork Pi device detected.") + +if detector.board.any_asus_tinker_board: + print("ASUS Tinker Board device detected.") diff --git a/docs/conf.py b/docs/conf.py old mode 100755 new mode 100644 diff --git a/requirements.txt b/requirements.txt old mode 100755 new mode 100644 diff --git a/setup.py b/setup.py old mode 100755 new mode 100644