Skip to content

Commit edf507e

Browse files
committed
Multiple documentation fixes
1 parent fcb6bea commit edf507e

File tree

14 files changed

+53
-12
lines changed

14 files changed

+53
-12
lines changed

docs/library/errno.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
|see_cpython_module| :mod:`python:errno`.
88

99
This module provides access to symbolic error codes for `OSError` exception.
10-
The codes available may vary per CircuitPython build.
10+
Some codes are not available on the smallest CircuitPython builds, such as SAMD21, for space reasons.
1111

1212
Constants
1313
---------

shared-bindings/_stage/__init__.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616

1717
//| """C-level helpers for animation of sprites on a stage
1818
//|
19-
//| The `_stage` module contains native code to speed-up the ```stage`` Library
20-
//| <https://github.com/python-ugame/circuitpython-stage>`_."""
19+
//| The `_stage` module contains native code to speed-up the ``stage``
20+
//| `library <https://github.com/python-ugame/circuitpython-stage>`_."""
2121
//|
2222
//|
2323
//| def render(

shared-bindings/aesio/aes.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,10 @@ static void validate_length(aesio_aes_obj_t *self, size_t src_length,
177177
//| """Encrypt the buffer from ``src`` into ``dest``.
178178
//|
179179
//| For ECB mode, the buffers must be 16 bytes long. For CBC mode, the
180-
//| buffers must be a multiple of 16 bytes, and must be equal length. For
181-
//| CTR mode, there are no restrictions."""
180+
//| buffers must be a multiple of 16 bytes, and must be equal length.
181+
//| Any included padding must conform to the required padding style for the given mode.
182+
//| For CTR mode, there are no restrictions.
183+
//| """
182184
//| ...
183185
//|
184186
static mp_obj_t aesio_aes_encrypt_into(mp_obj_t self_in, mp_obj_t src, mp_obj_t dest) {

shared-bindings/alarm/time/TimeAlarm.c

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ mp_obj_t MP_WEAK rtc_get_time_source_time(void) {
3535
//| If the given time is already in the past, then an exception is raised.
3636
//| If the sleep happens after the given time, then it will wake immediately
3737
//| due to this time alarm.
38+
//|
39+
//| Example::
40+
//|
41+
//| # Deep sleep for 30 seconds.
42+
//| time_alarm = alarm.time.TimeAlarm(monotonic_time=time.monotonic() + 30)
43+
//| alarm.exit_and_deep_sleep_until_alarms(time_alarm)
3844
//| """
3945
//| ...
4046
//|

shared-bindings/analogio/AnalogOut.c

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
//|
2121
//| **Limitations:** Not available on Nordic, RP2040, Spresense, as there is no on-chip DAC.
2222
//| On Espressif, available only on ESP32 and ESP32-S2; other chips do not have a DAC.
23+
//| On ESP32-S2 boards, GPIO18 (DAC2) is often connected to a pull-up resistor, which causes
24+
//| `unexpected output values in the lower part of the output range
25+
//| <https://github.com/adafruit/circuitpython/issues/7871>`_.
2326
//|
2427
//| Example usage::
2528
//|

shared-bindings/busio/I2C.c

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@
3939
//| bit unpacking. Instead, use an existing driver or make one with
4040
//| :ref:`Register <register-module-reference>` data descriptors.
4141
//|
42+
//| .. seealso:: This class provides an I2C controller, which controls I2C targets (peripherals).
43+
//| To act as an I2C target, use `i2ctarget.I2CTarget`.
44+
//|
4245
//| :param ~microcontroller.Pin scl: The clock pin
4346
//| :param ~microcontroller.Pin sda: The data pin
4447
//| :param int frequency: The clock frequency in Hertz

shared-bindings/busio/SPI.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
//| main device. It is typically faster than :py:class:`~bitbangio.I2C` because a
2929
//| separate pin is used to select a device rather than a transmitted
3030
//| address. This class only manages three of the four SPI lines: `!clock`,
31-
//| `!MOSI`, `!MISO`. Its up to the client to manage the appropriate
31+
//| `!MOSI`, `!MISO`. It is up to the client to manage the appropriate
3232
//| select line, often abbreviated `!CS` or `!SS`. (This is common because
3333
//| multiple secondaries can share the `!clock`, `!MOSI` and `!MISO` lines
3434
//| and therefore the hardware.)
@@ -46,6 +46,8 @@
4646
//| </details>
4747
//| </p>
4848
//|
49+
//| .. seealso:: This class acts as an SPI main (controller).
50+
//| To act as an SPI secondary (target), use `spitarget.SPITarget`.
4951
//| """
5052
//|
5153
//| def __init__(

shared-bindings/epaperdisplay/EPaperDisplay.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
//| is called. This is done so that CircuitPython can use the display itself.
3030
//|
3131
//| Most people should not use this class directly. Use a specific display driver instead that will
32-
//| contain the startup and shutdown sequences at minimum."""
32+
//| contain the startup and shutdown sequences at minimum.
33+
//| """
3334
//|
3435
//| def __init__(
3536
//| self,

shared-bindings/fourwire/FourWire.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,11 @@
2020

2121
//| class FourWire:
2222
//| """Manage updating a display over SPI four wire protocol in the background while Python code runs.
23-
//| It doesn't handle display initialization."""
23+
//| It doesn't handle display initialization.
24+
//|
25+
//| .. seealso:: See `busdisplay.BusDisplay` and `epaperdisplay.EPaperDisplay`
26+
//| for how to initialize a display, given a `FourWire` bus.
27+
//| """
2428
//|
2529
//| def __init__(
2630
//| self,

shared-bindings/i2cdisplaybus/I2CDisplayBus.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,11 @@
1919

2020
//| class I2CDisplayBus:
2121
//| """Manage updating a display over I2C in the background while Python code runs.
22-
//| It doesn't handle display initialization."""
22+
//| It doesn't handle display initialization.
23+
//|
24+
//| .. seealso:: See `busdisplay.BusDisplay` and `epaperdisplay.EPaperDisplay`
25+
//| for how to initialize a display, given an `I2CDisplayBus`.
26+
//| """
2327
//|
2428
//| def __init__(
2529
//| self,

shared-bindings/index.rst

+6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ a list of modules supported on each board.
1515
Modules
1616
---------
1717

18+
.. note:: Some modules are documented in :doc:`/docs/library/index`, not here:
19+
`builtins`, `heapq`, `array`, `binascii`, `collections`, `errno`, `gc`,
20+
`io`, `json`, `re`, `sys`, `select`.
21+
22+
The documentation for :func:`help` is at the end of this page.
23+
1824
.. toctree::
1925
:glob:
2026
:maxdepth: 2

shared-bindings/paralleldisplaybus/ParallelBus.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@
1818
//| class ParallelBus:
1919
//| """Manage updating a display over 8-bit parallel bus in the background while Python code runs. This
2020
//| protocol may be referred to as 8080-I Series Parallel Interface in datasheets. It doesn't handle
21-
//| display initialization."""
21+
//| display initialization.
22+
//|
23+
//| .. seealso:: See `busdisplay.BusDisplay` and `epaperdisplay.EPaperDisplay`
24+
//| for how to initialize a display, given a `ParallelBus`.
25+
//| """
2226
//|
2327
//| def __init__(
2428
//| self,

shared-bindings/rotaryio/IncrementalEncoder.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@
4242
//| position = enc.position
4343
//| if last_position == None or position != last_position:
4444
//| print(position)
45-
//| last_position = position"""
45+
//| last_position = position
46+
//|
47+
//| .. warning:: On RP2350 boards, any pulldowns used must be 8.2 kohms or less,
48+
//| to overcome a hardware issue.
49+
//| See the RP2350 warning in `digitalio` for more information.
50+
//| """
51+
//|
4652
//| ...
4753
//|
4854
static mp_obj_t rotaryio_incrementalencoder_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *all_args) {

shared-bindings/synthio/LFO.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ static const uint16_t triangle[] = {0, 32767, 0, -32767};
4343
//| An LFO's ``value`` property is computed once when it is constructed, and then
4444
//| when its associated synthesizer updates it.
4545
//|
46-
//| This means that for instance an LFO **created** with ``offset=1`` has ```value==1``
46+
//| This means that for instance an LFO **created** with ``offset=1`` has ``value==1``
4747
//| immediately, but **updating** the ``offset`` property alone does not
4848
//| change ``value``; it only updates through an association with an active synthesizer.
4949
//|

0 commit comments

Comments
 (0)