You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

113 lines
3.6 KiB

4 years ago
4 years ago
  1. #!/usr/bin/env python3
  2. # SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
  3. #
  4. # SPDX-License-Identifier: MIT
  5. """
  6. `bin.detect`
  7. ================================================================================
  8. Board detection and determination script
  9. * Author(s): Melissa LeBlanc-Williams
  10. Implementation Notes
  11. --------------------
  12. **Software and Dependencies:**
  13. * Linux and Python 3.7 or Higher
  14. """
  15. import adafruit_platformdetect
  16. detector = adafruit_platformdetect.Detector()
  17. print("Board Detection Test")
  18. print()
  19. print("Check that the Chip and Board IDs match your board and that this it is")
  20. print("correctly detecting whether or not it is a Linux board.")
  21. print()
  22. print("Chip id: ", detector.chip.id)
  23. print("Board id: ", detector.board.id)
  24. print()
  25. print("Linux Detection")
  26. print("---------------")
  27. print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
  28. print()
  29. print("Raspberry Pi Boards")
  30. print("-------------------")
  31. if detector.board.any_raspberry_pi:
  32. print("Raspberry Pi detected.")
  33. print("Is this a Pi 3B+?", detector.board.RASPBERRY_PI_3B_PLUS)
  34. print("Is this a Pi 4B?", detector.board.RASPBERRY_PI_4B)
  35. print("Is this a 40-pin Raspberry Pi?", detector.board.any_raspberry_pi_40_pin)
  36. print("Is this a Raspberry Pi Compute Module?", detector.board.any_raspberry_pi_cm)
  37. print()
  38. print("Other Boards")
  39. print("-------------------")
  40. print(
  41. "Is this a Siemens Simatic IOT2000 Gateway?",
  42. detector.board.any_siemens_simatic_iot2000,
  43. )
  44. print("Is this a 96boards board?", detector.board.any_96boards)
  45. print("Is this a BeagleBone board?", detector.board.any_beaglebone)
  46. print("Is this a Giant board?", detector.board.any_giant_board)
  47. print("Is this a Coral Dev board?", detector.board.any_coral_board)
  48. print("Is this a MaaXBoard?", detector.board.any_maaxboard)
  49. print("Is this a SiFive board? ", detector.board.any_sifive_board)
  50. print("Is this a PYNQ board?", detector.board.any_pynq_board)
  51. print("Is this a Rock Pi board?", detector.board.any_rock_pi_board)
  52. print("Is this a NanoPi board?", detector.board.any_nanopi)
  53. print("Is this a Khadas VIM3 board?", detector.board.khadas_vim3_40_pin)
  54. print("Is this a Clockwork Pi board?", detector.board.any_clockwork_pi_board)
  55. print("Is this a Seeed Board?", detector.board.any_seeed_board)
  56. print("Is this a UDOO board?", detector.board.any_udoo_board)
  57. print("Is this an ASUS Tinker board?", detector.board.any_asus_tinker_board)
  58. print("Is this an STM32MP1 board?", detector.board.any_stm32mp1)
  59. print("Is this a generic Linux PC?", detector.board.generic_linux)
  60. print(
  61. "Is this an OS environment variable special case?", detector.board.os_environ_board
  62. )
  63. if detector.board.any_jetson_board:
  64. print("Jetson platform detected.")
  65. if detector.board.any_tisk_board:
  66. print("TI platform detected.")
  67. if detector.board.any_pynq_board:
  68. print("PYNQ platform detected.")
  69. if detector.board.any_orange_pi:
  70. print("Orange Pi detected.")
  71. if detector.board.any_odroid_40_pin:
  72. print("Odroid detected.")
  73. if detector.board.any_onion_omega_board:
  74. print("Onion Omega detected.")
  75. if detector.board.any_pine64_board:
  76. print("Pine64 device detected.")
  77. if detector.board.any_rock_pi_board:
  78. print("Rock Pi device detected.")
  79. if detector.board.any_clockwork_pi_board:
  80. print("Clockwork Pi device detected.")
  81. if detector.board.any_asus_tinker_board:
  82. print("ASUS Tinker Board device detected.")
  83. if detector.board.any_coral_board:
  84. print("Coral device detected.")
  85. if detector.board.any_lubancat:
  86. print("LubanCat detected.")
  87. if detector.board.any_siemens_simatic_iot2000:
  88. print("Siemens Simatic IOT2000 Gateway detected.")