diff options
| author | danicampora <daniel@wipy.io> | 2015-10-14 12:32:01 +0200 |
|---|---|---|
| committer | danicampora <daniel@wipy.io> | 2015-10-17 23:29:04 +0200 |
| commit | 4542643025c77a7272bde348b89d5039aea28d23 (patch) | |
| tree | bf9fb006f46b96d2ea9ecf4aa190c4e4cc2abfc8 /docs/library/pyb.SPI.rst | |
| parent | fca3308cc376f2c1c66fa3cef82e30c55c9acca2 (diff) | |
docs: Update all WiPy docs to reflect the new API.
Diffstat (limited to 'docs/library/pyb.SPI.rst')
| -rw-r--r-- | docs/library/pyb.SPI.rst | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/docs/library/pyb.SPI.rst b/docs/library/pyb.SPI.rst index 3c540b279..73783c7d5 100644 --- a/docs/library/pyb.SPI.rst +++ b/docs/library/pyb.SPI.rst @@ -26,18 +26,6 @@ there are 3 lines: SCK, MOSI, MISO. spi.send_recv(b'1234', buf) # send 4 bytes and receive 4 into buf spi.send_recv(buf, buf) # send/recv 4 bytes from/to buf -.. only:: port_wipy - - See usage model of I2C; SPI is very similar. Main difference is - parameters to init the SPI bus:: - - from pyb import SPI - spi = SPI(1, SPI.MASTER, baudrate=1000000, polarity=0, phase=0, firstbit=SPI.MSB) - - Only required parameter is mode, must be SPI.MASTER. Polarity can be 0 or - 1, and is the level the idle clock line sits at. Phase can be 0 or 1 to - sample data on the first or second clock edge respectively. - Constructors ------------ @@ -59,16 +47,6 @@ Constructors At the moment, the NSS pin is not used by the SPI driver and is free for other use. -.. only:: port_wipy - - .. class:: pyb.SPI(bus, ...) - - Construct an SPI object on the given bus. ``bus`` can be only 1. - With no additional parameters, the SPI object is created but not - initialised (it has the settings from the last initialisation of - the bus, if any). If extra arguments are given, the bus is initialised. - See ``init`` for parameters of initialisation. - Methods ------- @@ -102,43 +80,6 @@ Methods Printing the SPI object will show you the computed baudrate and the chosen prescaler. -.. only:: port_wipy - - .. method:: spi.init(mode, baudrate=1000000, \*, polarity=0, phase=0, bits=8, firstbit=SPI.MSB, pins=(CLK, MOSI, MISO)) - - Initialise the SPI bus with the given parameters: - - - ``mode`` must be ``SPI.MASTER``. - - ``baudrate`` is the SCK clock rate. - - ``polarity`` can be 0 or 1, and is the level the idle clock line sits at. - - ``phase`` can be 0 or 1 to sample data on the first or second clock edge - respectively. - - ``bits`` is the width of each transfer, accepted values are 8, 16 and 32. - - ``firstbit`` can be ``SPI.MSB`` only. - - ``pins`` is an optional tupple with the pins to assign to the SPI bus. - - .. method:: spi.write(buf) - - Write the data contained in ``buf``. - Returns the number of bytes written. - - .. method:: spi.read(nbytes, *, write=0x00) - - Read the ``nbytes`` while writing the data specified by ``write``. - Return the number of bytes read. - - .. method:: spi.readinto(buf, *, write=0x00) - - Read into the buffer specified by ``buf`` while writing the data specified by - ``write``. - Return the number of bytes read. - - .. method:: spi.write_readinto(write_buf, read_buf) - - Write from ``write_buf`` and read into ``read_buf``. Both buffers must have the - same length. - Returns the number of bytes written - .. only:: port_pyboard .. method:: spi.recv(recv, \*, timeout=5000) @@ -187,13 +128,3 @@ Constants .. data:: SPI.MSB set the first bit to be the least or most significant bit - -.. only:: port_wipy - - .. data:: SPI.MASTER - - for initialising the SPI bus to master - - .. data:: SPI.MSB - - set the first bit to be the most significant bit |
