|
1 | | - |
2 | | -.. If you created a package, create one automodule per module in the package. |
3 | | -
|
4 | | -.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py) |
5 | | -.. use this format as the module name: "adafruit_foo.foo" |
6 | | -
|
7 | 1 | API Reference |
8 | 2 | ############# |
9 | 3 |
|
10 | 4 | .. automodule:: adafruit_esp32spi.adafruit_esp32spi |
| 5 | + |
| 6 | +.. note:: |
| 7 | + As of version 11.0.0, it simpler to import this library and its submodules |
| 8 | + The examples in this documentation use the new import names. |
| 9 | + The old import names are still available, but are deprecated and may be removed in a future release. |
| 10 | + |
| 11 | +Before version 11.0.0, the library was structured like this (not all components are shown): |
| 12 | + |
| 13 | +* ``adafruit_esp32spi`` |
| 14 | + |
| 15 | + * ``adafruit_esp32spi`` |
| 16 | + |
| 17 | + * ``ESP32_SPIcontrol`` |
| 18 | + |
| 19 | + * ``adafruit_esp32spi_socketpool`` |
| 20 | + |
| 21 | + * ``SocketPool`` |
| 22 | + |
| 23 | + * ``adafruit_esp32spi_wifimanager`` |
| 24 | + |
| 25 | + * ``WiFiManager`` |
| 26 | + |
| 27 | +.. code:: python |
| 28 | +
|
| 29 | + # Old import scheme |
| 30 | + from adafruit_esp32spi import adafruit_esp32spi |
| 31 | + from adafruit_esp32spi.adafruit_esp32spi_socketpool import SocketPool |
| 32 | + from adafruit_esp32spi.adafruit_esp32spi_wifimanager import WiFiManager |
| 33 | +
|
| 34 | +Now, the duplicated top-most name is not needed, and there are shorter names for the submodules. |
| 35 | + |
| 36 | +* ``adafruit_esp32spi`` |
| 37 | + |
| 38 | + * ``ESP32_SPIcontrol`` |
| 39 | + |
| 40 | + * ``socketpool`` |
| 41 | + |
| 42 | + * ``SocketPool`` |
| 43 | + |
| 44 | + * ``wifimanager`` |
| 45 | + |
| 46 | + * ``WiFiManager`` |
| 47 | + |
| 48 | +.. code:: python |
| 49 | +
|
| 50 | + # New import scheme |
| 51 | + import adafruit_esp32spi |
| 52 | + from adafruit_esp32spi.socketpool import SocketPool |
| 53 | + from adafruit_esp32spi.wifimanager import WiFiManager |
| 54 | +
|
| 55 | +
|
| 56 | +.. automodule:: adafruit_esp32spi |
| 57 | + :imported-members: |
11 | 58 | :members: |
12 | 59 |
|
13 | | -.. automodule:: adafruit_esp32spi.adafruit_esp32spi_socketpool |
| 60 | +.. automodule:: adafruit_esp32spi.socketpool |
| 61 | + :imported-members: |
14 | 62 | :members: |
15 | 63 |
|
16 | | -.. automodule:: adafruit_esp32spi.adafruit_esp32spi_wifimanager |
| 64 | +.. automodule:: adafruit_esp32spi.wifimanager |
| 65 | + :imported-members: |
17 | 66 | :members: |
18 | 67 |
|
19 | 68 | .. automodule:: adafruit_esp32spi.digitalio |
|
0 commit comments