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/wipy/quickref.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/wipy/quickref.rst')
| -rw-r--r-- | docs/wipy/quickref.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst index a22ea45b5..f9ea3d501 100644 --- a/docs/wipy/quickref.rst +++ b/docs/wipy/quickref.rst @@ -107,8 +107,8 @@ See :ref:`machine.SPI <machine.SPI>`. :: from machine import SPI - # configure the SPI master @ 2MHz - spi = SPI(0, SPI.MASTER, baudrate=200000, polarity=0, phase=0) + # configure the SPI controller @ 2MHz + spi = SPI(0, SPI.CONTROLLER, baudrate=2_000_000, polarity=0, phase=0) spi.write('hello') spi.read(5) # receive 5 bytes on the bus rbuf = bytearray(5) @@ -122,11 +122,11 @@ See :ref:`machine.I2C <machine.I2C>`. :: from machine import I2C # configure the I2C bus i2c = I2C(baudrate=100000) - i2c.scan() # returns list of slave addresses - i2c.writeto(0x42, 'hello') # send 5 bytes to slave with address 0x42 - i2c.readfrom(0x42, 5) # receive 5 bytes from slave - i2c.readfrom_mem(0x42, 0x10, 2) # read 2 bytes from slave 0x42, slave memory 0x10 - i2c.writeto_mem(0x42, 0x10, 'xy') # write 2 bytes to slave 0x42, slave memory 0x10 + i2c.scan() # returns list of peripheral addresses + i2c.writeto(0x42, 'hello') # send 5 bytes to peripheral with address 0x42 + i2c.readfrom(0x42, 5) # receive 5 bytes from peripheral + i2c.readfrom_mem(0x42, 0x10, 2) # read 2 bytes from peripheral 0x42, peripheral memory 0x10 + i2c.writeto_mem(0x42, 0x10, 'xy') # write 2 bytes to peripheral 0x42, peripheral memory 0x10 Watchdog timer (WDT) -------------------- |
