1
1
Introduction
2
2
============
3
3
4
+ .. image :: https://readthedocs.org/projects/Adafruit-PlatformDetect/badge/?version=latest
5
+ :target: https://circuitpython.readthedocs.io/projects/platformdetect/en/latest/
6
+ :alt: Documentation Status
7
+
8
+ .. image :: https://img.shields.io/discord/327254708534116352.svg
9
+ :target: https://discord.gg/nBQh6qu
10
+ :alt: Discord
11
+
12
+ .. image :: https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect/workflows/Build%20CI/badge.svg
13
+ :target: https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect/actions
14
+ :alt: Build Status
15
+
16
+ .. image :: https://img.shields.io/badge/code%20style-black-000000.svg
17
+ :target: https://github.com/psf/black
18
+ :alt: Code Style: Black
19
+
4
20
This library provides best-guess platform detection for a range of single-board
5
21
computers and (potentially) other platforms. It was written primarily for use
6
22
in `Adafruit_Blinka <https://github.com/adafruit/Adafruit_Blinka >`_, but may be
@@ -21,47 +37,71 @@ generally dependent on the former. Platform info is gathered from:
21
37
22
38
- Distribution-specific files such as /etc/armbian-release.
23
39
24
- The API is currently unstable and may change drastically in future releases.
40
+ Dependencies
41
+ =============
42
+ This driver depends on:
25
43
26
- Installation
27
- ============
44
+ * `Adafruit CircuitPython <https://github.com/adafruit/circuitpython >`_
45
+
46
+ Please ensure all dependencies are available on the CircuitPython filesystem.
47
+ This is easily achieved by downloading
48
+ `the Adafruit library and driver bundle <https://circuitpython.org/libraries >`_.
49
+
50
+ Installing from PyPI
51
+ =====================
52
+ .. note :: This library is not available on PyPI yet. Install documentation is included
53
+ as a standard element. Stay tuned for PyPI availability!
54
+
55
+ .. todo :: Remove the above note if PyPI version is/will be available at time of release.
56
+ If the library is not planned for PyPI, remove the entire 'Installing from PyPI' section.
57
+
58
+ On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
59
+ PyPI <https://pypi.org/project/Adafruit-PlatformDetect/> `_. To install for current user:
60
+
61
+ .. code-block :: shell
62
+
63
+ pip3 install Adafruit-PlatformDetect
28
64
29
- On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
30
- PyPI <https://pypi.org/project/adafruit-circuitpython-motorkit/> `_. To install for current user:
65
+ To install system-wide (this may be required in some cases):
31
66
32
- .. code-block :: shell
67
+ .. code-block :: shell
33
68
34
- pip3 install Adafruit-PlatformDetect
69
+ sudo pip3 install Adafruit-PlatformDetect
35
70
36
- To install system-wide (this may be required in some cases) :
71
+ To install in a virtual environment in your current project :
37
72
38
- .. code-block :: shell
73
+ .. code-block :: shell
39
74
40
- sudo pip3 install Adafruit-PlatformDetect
75
+ mkdir project-name && cd project-name
76
+ python3 -m venv .env
77
+ source .env/bin/activate
78
+ pip3 install Adafruit-PlatformDetect
41
79
42
- To install in a virtual environment in your current project:
80
+ Usage Example
81
+ =============
43
82
44
- .. code-block :: shell
83
+ .. code-block :: python
45
84
46
- mkdir project-name && cd project-name
47
- python3 -m venv .env
48
- source .env/bin/activate
49
- pip3 install Adafruit-PlatformDetect
85
+ from adafruit_platformdetect import Detector
86
+ detector = Detector()
87
+ print ( " Chip id: " , detector.chip.id)
88
+ print ( " Board id: " , detector.board.id)
50
89
51
- Usage
52
- =====
90
+ # Check for specific board models:
91
+ print (" Pi 3B+? " , detector.board.RASPBERRY_PI_3B_PLUS )
92
+ print (" BBB? " , detector.board.BEAGLEBONE_BLACK )
93
+ print (" Orange Pi PC? " , detector.board.ORANGE_PI_PC )
94
+ print (" generic Linux PC? " , detector.board.GENERIC_LINUX_PC )
53
95
54
- .. code-block :: python
96
+ Contributing
97
+ ============
55
98
56
- from adafruit_platformdetect import Detector
57
- detector = Detector()
58
- print (" Chip id: " , detector.chip.id)
59
- print (" Board id: " , detector.board.id)
99
+ Contributions are welcome! Please read our `Code of Conduct
100
+ <https://github.com/adafruit/Adafruit_CircuitPython_PlatformDetect/blob/master/CODE_OF_CONDUCT.md> `_
101
+ before contributing to help this project stay welcoming.
60
102
61
- # Check for specific board models:
62
- print (" Pi 3B+? " , detector.board.RASPBERRY_PI_3B_PLUS )
63
- print (" BBB? " , detector.board.BEAGLEBONE_BLACK )
64
- print (" Orange Pi PC? " , detector.board.ORANGE_PI_PC )
65
- print (" generic Linux PC? " , detector.board.GENERIC_LINUX_PC )
103
+ Documentation
104
+ =============
66
105
67
- See https://github.com/adafruit/Adafruit_Python_PlatformDetect/blob/master/bin/detect.py for more possible detectable boards
106
+ For information on building library documentation, please check out `this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1 >`_.
107
+
0 commit comments