Merge pull request #4928 from 2bndy5/fix-bus-device-docs

update busio & adafruit_bus_device docs
This commit is contained in:
Scott Shawcroft 2021-06-28 15:38:24 -07:00 committed by GitHub
commit 8a5a7457ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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.)

View File

@ -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)``

View File

@ -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