Skip to content

Commit 8a5a745

Browse files
authored
Merge pull request #4928 from 2bndy5/fix-bus-device-docs
update busio & adafruit_bus_device docs
2 parents b265a92 + 9ff9259 commit 8a5a745

File tree

5 files changed

+12
-7
lines changed

5 files changed

+12
-7
lines changed

conf.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@
414414

415415
# Example configuration for intersphinx: refer to the Python standard library.
416416
intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None),
417-
"bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),
418417
"register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)}
419418

420419
# Adapted from sphinxcontrib-redirects

shared-bindings/adafruit_bus_device/I2CDevice.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
//|
4747
//| """Represents a single I2C device and manages locking the bus and the device
4848
//| address.
49+
//|
4950
//| :param ~busio.I2C i2c: The I2C bus the device is on
5051
//| :param int device_address: The 7 bit device address
5152
//| :param bool probe: Probe for the device upon object creation, default is true
@@ -114,6 +115,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(adafruit_bus_device_i2cdevice___exit_
114115
//| If ``start`` or ``end`` is provided, then the buffer will be sliced
115116
//| as if ``buf[start:end]``. This will not cause an allocation like
116117
//| ``buf[start:end]`` will so it saves memory.
118+
//|
117119
//| :param bytearray buf: buffer to write into
118120
//| :param int start: Index to start writing at
119121
//| :param int end: Index to write up to but not include; if None, use ``len(buf)``"""
@@ -157,6 +159,7 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(adafruit_bus_device_i2cdevice_readinto_obj, 2,
157159
//| If ``start`` or ``end`` is provided, then the buffer will be sliced
158160
//| as if ``buffer[start:end]``. This will not cause an allocation like
159161
//| ``buffer[start:end]`` will so it saves memory.
162+
//|
160163
//| :param bytearray buf: buffer containing the bytes to write
161164
//| :param int start: Index to start writing from
162165
//| :param int end: Index to read up to but not include; if None, use ``len(buf)``
@@ -208,6 +211,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(adafruit_bus_device_i2cdevice_write_obj, 2, adafruit_
208211
//| will be sliced as if ``in_buffer[in_start:in_end]``. This will not
209212
//| cause an allocation like ``in_buffer[in_start:in_end]`` will so
210213
//| it saves memory.
214+
//|
211215
//| :param bytearray out_buffer: buffer containing the bytes to write
212216
//| :param bytearray in_buffer: buffer containing the bytes to read into
213217
//| :param int out_start: Index to start writing from

shared-bindings/adafruit_bus_device/SPIDevice.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
//|
4646
//| """
4747
//| Represents a single SPI device and manages locking the bus and the device address.
48+
//|
4849
//| :param ~busio.SPI spi: The SPI bus the device is on
4950
//| :param ~digitalio.DigitalInOut chip_select: The chip select pin object that implements the DigitalInOut API.
5051
//| :param int extra_clocks: The minimum number of clock cycles to cycle the bus after CS is high. (Used for SD cards.)

shared-bindings/busio/I2C.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
//| lines respectively.
4747
//|
4848
//| .. seealso:: Using this class directly requires careful lock management.
49-
//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to
49+
//| Instead, use :class:`~adafruit_bus_device.I2CDevice` to
5050
//| manage locks.
5151
//|
5252
//| .. seealso:: Using this class to directly read registers requires manual
@@ -56,7 +56,8 @@
5656
//| :param ~microcontroller.Pin scl: The clock pin
5757
//| :param ~microcontroller.Pin sda: The data pin
5858
//| :param int frequency: The clock frequency in Hertz
59-
//| :param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C)
59+
//| :param int timeout: The maximum clock stretching timeut - (used only for
60+
//| :class:`bitbangio.I2C`; ignored for :class:`busio.I2C`)
6061
//|
6162
//| .. note:: On the nRF52840, only one I2C object may be created,
6263
//| except on the Circuit Playground Bluefruit, which allows two,
@@ -239,7 +240,7 @@ MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_readfrom_into_obj, 3, busio_i2c_readfrom_in
239240
//| to poll for the existence of a device.
240241
//|
241242
//| :param int address: 7-bit device address
242-
//| :param ~_typing.ReadbleBuffer buffer: buffer containing the bytes to write
243+
//| :param ~_typing.ReadableBuffer buffer: buffer containing the bytes to write
243244
//| :param int start: Index to start writing from
244245
//| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``"""
245246
//| ...
@@ -286,12 +287,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto);
286287
//| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and
287288
//| ``in_buffer`` can be the same buffer because they are used sequentially.
288289
//|
289-
//| if ``start`` or ``end`` is provided, then the corresponding buffer will be sliced
290+
//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced
290291
//| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]``
291292
//| will so it saves memory.
292293
//|
293294
//| :param int address: 7-bit device address
294-
//| :param ~_typing.ReadbleBuffer out_buffer: buffer containing the bytes to write
295+
//| :param ~_typing.ReadableBuffer out_buffer: buffer containing the bytes to write
295296
//| :param ~_typing.WriteableBuffer in_buffer: buffer to write into
296297
//| :param int out_start: Index to start writing from
297298
//| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)``

shared-bindings/busio/SPI.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
//| peripherals.
6666
//|
6767
//| .. seealso:: Using this class directly requires careful lock management.
68-
//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to
68+
//| Instead, use :class:`~adafruit_bus_device.SPIDevice` to
6969
//| manage locks.
7070
//|
7171
//| .. seealso:: Using this class to directly read registers requires manual

0 commit comments

Comments
 (0)