From 3387edc424a7592ec97bfbc0083a44919e5ef1ca Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 25 Jun 2021 23:32:24 -0700 Subject: [PATCH 1/4] rm intersphinx_mapping to bus_device pkg --- conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/conf.py b/conf.py index 7acc981f3d..fb988499c3 100644 --- a/conf.py +++ b/conf.py @@ -414,7 +414,6 @@ texinfo_documents = [ # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {"cpython": ('https://docs.python.org/3/', None), - "bus_device": ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None), "register": ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None)} # Adapted from sphinxcontrib-redirects From dc02f97640dccc941ef43132cc14d2f62d169af1 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 25 Jun 2021 23:35:30 -0700 Subject: [PATCH 2/4] fix SPIDevice docs --- shared-bindings/adafruit_bus_device/SPIDevice.c | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-bindings/adafruit_bus_device/SPIDevice.c b/shared-bindings/adafruit_bus_device/SPIDevice.c index 94901e4a15..a695a168ed 100644 --- a/shared-bindings/adafruit_bus_device/SPIDevice.c +++ b/shared-bindings/adafruit_bus_device/SPIDevice.c @@ -45,6 +45,7 @@ //| //| """ //| Represents a single SPI device and manages locking the bus and the device address. +//| //| :param ~busio.SPI spi: The SPI bus the device is on //| :param ~digitalio.DigitalInOut chip_select: The chip select pin object that implements the DigitalInOut API. //| :param int extra_clocks: The minimum number of clock cycles to cycle the bus after CS is high. (Used for SD cards.) From 02c70336ffbb858471fc2a2857f63fa8a9d89eef Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Fri, 25 Jun 2021 23:38:08 -0700 Subject: [PATCH 3/4] fix I2CDevice docs --- shared-bindings/adafruit_bus_device/I2CDevice.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared-bindings/adafruit_bus_device/I2CDevice.c b/shared-bindings/adafruit_bus_device/I2CDevice.c index ac760a490f..12c836396d 100644 --- a/shared-bindings/adafruit_bus_device/I2CDevice.c +++ b/shared-bindings/adafruit_bus_device/I2CDevice.c @@ -46,6 +46,7 @@ //| //| """Represents a single I2C device and manages locking the bus and the device //| address. +//| //| :param ~busio.I2C i2c: The I2C bus the device is on //| :param int device_address: The 7 bit device address //| :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_ //| If ``start`` or ``end`` is provided, then the buffer will be sliced //| as if ``buf[start:end]``. This will not cause an allocation like //| ``buf[start:end]`` will so it saves memory. +//| //| :param bytearray buf: buffer to write into //| :param int start: Index to start writing at //| :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, //| If ``start`` or ``end`` is provided, then the buffer will be sliced //| as if ``buffer[start:end]``. This will not cause an allocation like //| ``buffer[start:end]`` will so it saves memory. +//| //| :param bytearray buf: buffer containing the bytes to write //| :param int start: Index to start writing from //| :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_ //| will be sliced as if ``in_buffer[in_start:in_end]``. This will not //| cause an allocation like ``in_buffer[in_start:in_end]`` will so //| it saves memory. +//| //| :param bytearray out_buffer: buffer containing the bytes to write //| :param bytearray in_buffer: buffer containing the bytes to read into //| :param int out_start: Index to start writing from From 9ff9259d1ccda8179c6b3d28a949e01a2bd1ed21 Mon Sep 17 00:00:00 2001 From: Brendan <2bndy5@gmail.com> Date: Sat, 26 Jun 2021 01:50:28 -0700 Subject: [PATCH 4/4] fix interlinking in busio docs --- shared-bindings/busio/I2C.c | 11 ++++++----- shared-bindings/busio/SPI.c | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/shared-bindings/busio/I2C.c b/shared-bindings/busio/I2C.c index 56a6e1b8ae..d300956d0a 100644 --- a/shared-bindings/busio/I2C.c +++ b/shared-bindings/busio/I2C.c @@ -46,7 +46,7 @@ //| lines respectively. //| //| .. seealso:: Using this class directly requires careful lock management. -//| Instead, use :class:`~adafruit_bus_device.i2c_device.I2CDevice` to +//| Instead, use :class:`~adafruit_bus_device.I2CDevice` to //| manage locks. //| //| .. seealso:: Using this class to directly read registers requires manual @@ -56,7 +56,8 @@ //| :param ~microcontroller.Pin scl: The clock pin //| :param ~microcontroller.Pin sda: The data pin //| :param int frequency: The clock frequency in Hertz -//| :param int timeout: The maximum clock stretching timeut - (used only for bitbangio.I2C; ignored for busio.I2C) +//| :param int timeout: The maximum clock stretching timeut - (used only for +//| :class:`bitbangio.I2C`; ignored for :class:`busio.I2C`) //| //| .. note:: On the nRF52840, only one I2C object may be created, //| 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 //| to poll for the existence of a device. //| //| :param int address: 7-bit device address -//| :param ~_typing.ReadbleBuffer buffer: buffer containing the bytes to write +//| :param ~_typing.ReadableBuffer buffer: buffer containing the bytes to write //| :param int start: Index to start writing from //| :param int end: Index to read up to but not include. Defaults to ``len(buffer)``""" //| ... @@ -286,12 +287,12 @@ STATIC MP_DEFINE_CONST_FUN_OBJ_KW(busio_i2c_writeto_obj, 1, busio_i2c_writeto); //| bit, generate a repeated start and read into ``in_buffer``. ``out_buffer`` and //| ``in_buffer`` can be the same buffer because they are used sequentially. //| -//| if ``start`` or ``end`` is provided, then the corresponding buffer will be sliced +//| If ``start`` or ``end`` is provided, then the corresponding buffer will be sliced //| as if ``buffer[start:end]``. This will not cause an allocation like ``buf[start:end]`` //| will so it saves memory. //| //| :param int address: 7-bit device address -//| :param ~_typing.ReadbleBuffer out_buffer: buffer containing the bytes to write +//| :param ~_typing.ReadableBuffer out_buffer: buffer containing the bytes to write //| :param ~_typing.WriteableBuffer in_buffer: buffer to write into //| :param int out_start: Index to start writing from //| :param int out_end: Index to read up to but not include. Defaults to ``len(buffer)`` diff --git a/shared-bindings/busio/SPI.c b/shared-bindings/busio/SPI.c index 5a82ac0b41..31f3a9021e 100644 --- a/shared-bindings/busio/SPI.c +++ b/shared-bindings/busio/SPI.c @@ -65,7 +65,7 @@ //| peripherals. //| //| .. seealso:: Using this class directly requires careful lock management. -//| Instead, use :class:`~adafruit_bus_device.spi_device.SPIDevice` to +//| Instead, use :class:`~adafruit_bus_device.SPIDevice` to //| manage locks. //| //| .. seealso:: Using this class to directly read registers requires manual