28
28
ORANGE_PI_PC = "ORANGE_PI_PC"
29
29
GIANT_BOARD = "GIANT_BOARD"
30
30
31
+ JETSON_TX1 = 'JETSON_TX1'
32
+ JETSON_TX2 = 'JETSON_TX2'
33
+ JETSON_XAVIER = 'JETSON_XAVIER'
34
+ JETSON_TXX = 'JETSON_TXX'
35
+
31
36
RASPBERRY_PI_B_REV1 = "RASPBERRY_PI_B_REV1"
32
37
RASPBERRY_PI_B_REV2 = "RASPBERRY_PI_B_REV2"
33
38
RASPBERRY_PI_B_PLUS = "RASPBERRY_PI_B_PLUS"
49
54
FTDI_FT232H = "FT232H"
50
55
# pylint: enable=bad-whitespace
51
56
57
+ _JETSON_IDS = (
58
+ JETSON_TX1 ,
59
+ JETSON_TX2 ,
60
+ JETSON_XAVIER ,
61
+ JETSON_TXX
62
+ )
63
+
52
64
_RASPBERRY_PI_40_PIN_IDS = (
53
65
RASPBERRY_PI_B_PLUS ,
54
66
RASPBERRY_PI_A_PLUS ,
@@ -223,7 +235,7 @@ class Board:
223
235
def __init__ (self , detector ):
224
236
self .detector = detector
225
237
226
- # pylint: disable=invalid-name
238
+ # pylint: disable=invalid-name, too-many-branches
227
239
@property
228
240
def id (self ):
229
241
"""Return a unique id for the detected board, if any."""
@@ -259,6 +271,9 @@ def id(self):
259
271
board_id = ODROID_C2
260
272
elif chip_id == ap_chip .FT232H :
261
273
board_id = FTDI_FT232H
274
+ elif chip_id == ap_chip .TEGRAXXX :
275
+ board_id = self ._tegra_id ()
276
+
262
277
return board_id
263
278
# pylint: enable=invalid-name
264
279
@@ -318,6 +333,19 @@ def _sama5_id(self):
318
333
return GIANT_BOARD
319
334
return None
320
335
336
+ def _tegra_id (self ):
337
+ """Try to detect the id of aarch64 board."""
338
+ board_value = self .detector .get_device_model ()
339
+ if 'tx1' in board_value :
340
+ return JETSON_TX1
341
+ elif 'quill' in board_value :
342
+ return JETSON_TX2
343
+ elif 'xavier' in board_value :
344
+ return JETSON_XAVIER
345
+ elif 'txx' in board_value :
346
+ return JETSON_TXX
347
+ return None
348
+
321
349
@property
322
350
def any_raspberry_pi (self ):
323
351
"""Check whether the current board is any Raspberry Pi."""
@@ -343,11 +371,16 @@ def any_giant_board(self):
343
371
"""Check whether the current board is any defined Giant Board."""
344
372
return self .GIANT_BOARD
345
373
374
+ @property
375
+ def any_jetson_board (self ):
376
+ """Check whether the current board is any defined Jetson Board."""
377
+ return self .id in _JETSON_IDS
378
+
346
379
@property
347
380
def any_embedded_linux (self ):
348
381
"""Check whether the current board is any embedded Linux device."""
349
382
return self .any_raspberry_pi or self .any_beaglebone or \
350
- self .any_orange_pi or self .any_giant_board
383
+ self .any_orange_pi or self .any_giant_board or self . any_jetson_board
351
384
352
385
def __getattr__ (self , attr ):
353
386
"""
0 commit comments