Adafruit_Python_PlatformDetect/bin/detect.py
Brennen Bearnes f4712430e2 refactor 96boards detection
- Brings naming in line with existing conventions
  - Replaces `_is_96Boards()` with an `any_96boards` property
  - Renames `get_dt_compatible_field()` to `check_dt_compatible_value()`
    to distinguish between returning a field's string value and a boolean
    check on whether a value is present.
  - Adds a 96Boards check to `bin/detect.py`.

This might still need some changes, and definitely needs tested on actual
96Boards hardware.
2018-12-28 18:29:44 -07:00

20 lines
733 B
Python
Executable file

#!/usr/bin/env python3
import adafruit_platformdetect
detector = adafruit_platformdetect.Detector()
print("Chip id: ", detector.chip.id)
print("Board id: ", detector.board.id)
print("Is this a 96Boards board?", detector.board.LINARO_96BOARDS)
print("Is this a Pi 3B+?", detector.board.RASPBERRY_PI_3B_PLUS)
print("Is this a 40-pin Raspberry Pi?", detector.board.any_raspberry_pi_40_pin)
print("Is this a BBB?", detector.board.BEAGLEBONE_BLACK)
print("Is this an Orange Pi PC?", detector.board.ORANGE_PI_PC)
print("Is this an embedded Linux system?", detector.board.any_embedded_linux)
print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC)
if detector.board.any_raspberry_pi:
print("Raspberry Pi detected.")