diff options
| author | David P <dpoirier@y7mail.com> | 2021-06-12 14:51:05 +1000 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2021-07-18 11:19:44 +1000 |
| commit | fdd5b18133e9d9f5a4e76be22ece6632d11d7fee (patch) | |
| tree | 07f4e1b5eb2688306ec840a0d099b4408f7b46f2 /docs/library/pyb.SPI.rst | |
| parent | cbc8d5b61f0742e810ad45bd27d8daa11f3dbbf8 (diff) | |
docs: Replace master/slave with controller/peripheral in I2C and SPI.
See https://www.oshwa.org/a-resolution-to-redefine-spi-signal-names
Diffstat (limited to 'docs/library/pyb.SPI.rst')
| -rw-r--r-- | docs/library/pyb.SPI.rst | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/docs/library/pyb.SPI.rst b/docs/library/pyb.SPI.rst index c76b16789..1bdb73a5d 100644 --- a/docs/library/pyb.SPI.rst +++ b/docs/library/pyb.SPI.rst @@ -1,19 +1,19 @@ .. currentmodule:: pyb .. _pyb.SPI: -class SPI -- a master-driven serial protocol -============================================ +class SPI -- a controller-driven serial protocol +================================================ -SPI is a serial protocol that is driven by a master. At the physical level +SPI is a serial protocol that is driven by a controller. At the physical level there are 3 lines: SCK, MOSI, MISO. 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=600000, polarity=1, phase=0, crc=0x7) + spi = SPI(1, SPI.CONTROLLER, baudrate=600000, polarity=1, phase=0, crc=0x7) -Only required parameter is mode, SPI.MASTER or SPI.SLAVE. Polarity can be +Only required parameter is mode, SPI.CONTROLLER or SPI.PERIPHERAL. 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. Crc can be None for no CRC, or a polynomial specifier. @@ -55,8 +55,8 @@ Methods Initialise the SPI bus with the given parameters: - - ``mode`` must be either ``SPI.MASTER`` or ``SPI.SLAVE``. - - ``baudrate`` is the SCK clock rate (only sensible for a master). + - ``mode`` must be either ``SPI.CONTROLLER`` or ``SPI.PERIPHERAL``. + - ``baudrate`` is the SCK clock rate (only sensible for a controller). - ``prescaler`` is the prescaler to use to derive SCK from the APB bus frequency; use of ``prescaler`` overrides ``baudrate``. - ``polarity`` can be 0 or 1, and is the level the idle clock line sits at. @@ -112,10 +112,10 @@ Methods Constants --------- -.. data:: SPI.MASTER -.. data:: SPI.SLAVE +.. data:: SPI.CONTROLLER +.. data:: SPI.PERIPHERAL - for initialising the SPI bus to master or slave mode + for initialising the SPI bus to controller or peripheral mode .. data:: SPI.LSB .. data:: SPI.MSB |
