Skip to content

Commit c1cc9b8

Browse files
authored
Merge pull request #6353 from tekktrik/doc/add-communication-links
Add links to guides for "essential" modules, others
2 parents 5edc59f + d1d6d99 commit c1cc9b8

File tree

8 files changed

+69
-7
lines changed

8 files changed

+69
-7
lines changed

shared-bindings/analogio/__init__.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,15 @@
5757
//| This example will initialize the the device, read
5858
//| :py:data:`~analogio.AnalogIn.value` and then
5959
//| :py:meth:`~analogio.AnalogIn.deinit` the hardware. The last step is optional
60-
//| because CircuitPython will do it automatically after the program finishes."""
60+
//| because CircuitPython will do it automatically after the program finishes.
61+
//|
62+
//| For the essentials of `analogio`, see the CircuitPython Essentials
63+
//| Learn guide:
64+
//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-analog-in
65+
//|
66+
//| For more information on using `analogio`, see this additional Learn guide:
67+
//| https://learn.adafruit.com/circuitpython-basics-analog-inputs-and-outputs
68+
//| """
6169
//|
6270

6371
STATIC const mp_rom_map_elem_t analogio_module_globals_table[] = {

shared-bindings/board/__init__.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,14 @@
4343
//| Common container for board base pin names. These will vary from board to
4444
//| board so don't expect portability when using this module.
4545
//|
46+
//| Another common use of this module is to use serial communciation buses with
47+
//| the default pins and settings. For more information about serial communcication
48+
//| in CircuitPython, see the :mod:`busio`.
49+
//|
50+
//| For more information regarding the typical usage of :py:mod:`board`, refer to the CircuitPython
51+
//| Essentials Learn guide:
52+
//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pins-and-modules
53+
//|
4654
//| .. warning:: The board module varies by board. The APIs documented here may or may not be
4755
//| available on a specific board."""
4856

shared-bindings/busio/__init__.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,19 @@
6868
//| This example will initialize the the device, run
6969
//| :py:meth:`~busio.I2C.scan` and then :py:meth:`~busio.I2C.deinit` the
7070
//| hardware. The last step is optional because CircuitPython automatically
71-
//| resets hardware after a program finishes."""
71+
//| resets hardware after a program finishes.
72+
//|
73+
//| Note that drivers will typically handle communication if provided the bus
74+
//| instance (such as ``busio.I2C(board.SCL, board.SDA)``), and that many of
75+
//| the methods listed here are lower level functionalities that are needed
76+
//| for working with custom drivers.
77+
//|
78+
//| Tutorial for I2C and SPI:
79+
//| https://learn.adafruit.com/circuitpython-basics-i2c-and-spi
80+
//|
81+
//| Tutorial for UART:
82+
//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-uart-serial
83+
//| """
7284
//|
7385

7486
STATIC const mp_rom_map_elem_t busio_module_globals_table[] = {

shared-bindings/digitalio/__init__.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,15 @@
7171
//| led.value = True
7272
//| time.sleep(0.1)
7373
//| led.value = False
74-
//| time.sleep(0.1)"""
74+
//| time.sleep(0.1)
75+
//|
76+
//| For the essentials of `digitalio`, see the CircuitPython Essentials
77+
//| Learn guide:
78+
//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-digital-in-out
7579
//|
80+
//| For more information on using `digitalio`, see this additional Learn guide:
81+
//| https://learn.adafruit.com/circuitpython-digital-inputs-and-outputs
82+
//| """
7683

7784
STATIC const mp_rom_map_elem_t digitalio_module_globals_table[] = {
7885
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_digitalio) },

shared-bindings/displayio/__init__.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@
4949
//| """Native helpers for driving displays
5050
//|
5151
//| The `displayio` module contains classes to manage display output
52-
//| including synchronizing with refresh rates and partial updating."""
52+
//| including synchronizing with refresh rates and partial updating.
53+
//|
54+
//| For more a more thorugh explanation and guide for using `displayio`, please
55+
//| refer to this Learn guide:
56+
//| https://learn.adafruit.com/circuitpython-display-support-using-displayio
57+
//| """
5358
//|
5459

5560
//| import paralleldisplay

shared-bindings/neopixel_write/__init__.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,19 @@ STATIC void check_for_deinit(digitalio_digitalinout_obj_t *self) {
9191
//| pin = digitalio.DigitalInOut(board.NEOPIXEL)
9292
//| pin.direction = digitalio.Direction.OUTPUT
9393
//| pixel_off = bytearray([0, 0, 0])
94-
//| neopixel_write.neopixel_write(pin, pixel_off)"""
94+
//| neopixel_write.neopixel_write(pin, pixel_off)
95+
//|
96+
//| .. note::
97+
//|
98+
//| This library is typically not used by user level code.
99+
//|
100+
//| For more information on actually using NeoPixels, refer to the CircuitPython
101+
//| Essentials Learn guide: https://learn.adafruit.com/circuitpython-essentials/circuitpython-neopixel
102+
//|
103+
//| For a much more thorough guide about using NeoPixels, refer to the Adadfruit NeoPixel Überguide:
104+
//| https://learn.adafruit.com/adafruit-neopixel-uberguide
105+
//|
106+
//| """
95107
//|
96108
//| def neopixel_write(digitalinout: digitalio.DigitalInOut, buf: ReadableBuffer) -> None:
97109
//| """Write buf out on the given DigitalInOut.

shared-bindings/pwmio/__init__.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@
5757
//| :py:data:`~pwmio.PWMOut.duty_cycle`, and then sleep 0.1 seconds.
5858
//| CircuitPython will automatically turn off the PWM when it resets all
5959
//| hardware after program completion. Use ``deinit()`` or a ``with`` statement
60-
//| to do it yourself."""
60+
//| to do it yourself.
61+
//|
62+
//| For the essentials of `pwmio`, see the CircuitPython Essentials
63+
//| Learn guide:
64+
//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-pwm
65+
//| """
6166
//|
6267

6368
STATIC const mp_rom_map_elem_t pwmio_module_globals_table[] = {

shared-bindings/storage/__init__.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@
4040
//| The `storage` provides storage management functionality such as mounting and
4141
//| unmounting which is typically handled by the operating system hosting Python.
4242
//| CircuitPython does not have an OS, so this module provides this functionality
43-
//| directly."""
43+
//| directly.
44+
45+
//| For more information regarding using the `storage` module, refer to the CircuitPython
46+
//| Essentials Learn guide:
47+
//| https://learn.adafruit.com/circuitpython-essentials/circuitpython-storage
48+
//| """
4449
//|
4550

4651
//| def mount(filesystem: VfsFat, mount_path: str, *, readonly: bool = False) -> None:

0 commit comments

Comments
 (0)