diff options
Diffstat (limited to 'docs/pyboard')
-rw-r--r-- | docs/pyboard/quickref.rst | 12 | ||||
-rw-r--r-- | docs/pyboard/tutorial/amp_skin.rst | 2 | ||||
-rw-r--r-- | docs/pyboard/tutorial/lcd_skin.rst | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/docs/pyboard/quickref.rst b/docs/pyboard/quickref.rst index 3ea3190999..49b67eee42 100644 --- a/docs/pyboard/quickref.rst +++ b/docs/pyboard/quickref.rst @@ -191,7 +191,7 @@ See :ref:`pyb.SPI <pyb.SPI>`. :: from pyb import SPI - spi = SPI(1, SPI.MASTER, baudrate=200000, polarity=1, phase=0) + spi = SPI(1, SPI.CONTROLLER, baudrate=200000, polarity=1, phase=0) spi.send('hello') spi.recv(5) # receive 5 bytes on the bus spi.send_recv('hello') # send and receive 5 bytes @@ -210,12 +210,12 @@ eg ``I2C(1)``. Software I2C is also available by explicitly specifying the i2c = I2C('X', freq=400000) # create hardware I2c object i2c = I2C(scl='X1', sda='X2', freq=100000) # create software I2C object - i2c.scan() # returns list of slave addresses - i2c.writeto(0x42, 'hello') # write 5 bytes to slave with address 0x42 - i2c.readfrom(0x42, 5) # read 5 bytes from slave + i2c.scan() # returns list of peripheral addresses + i2c.writeto(0x42, 'hello') # write 5 bytes to peripheral with address 0x42 + i2c.readfrom(0x42, 5) # read 5 bytes from peripheral - 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.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 Note: for legacy I2C support see :ref:`pyb.I2C <pyb.I2C>`. diff --git a/docs/pyboard/tutorial/amp_skin.rst b/docs/pyboard/tutorial/amp_skin.rst index bcb5832613..b6558959ea 100644 --- a/docs/pyboard/tutorial/amp_skin.rst +++ b/docs/pyboard/tutorial/amp_skin.rst @@ -30,7 +30,7 @@ To set the volume, define the following function:: import pyb def volume(val): - pyb.I2C(1, pyb.I2C.MASTER).mem_write(val, 46, 0) + pyb.I2C(1, pyb.I2C.CONTROLLER).mem_write(val, 46, 0) Then you can do:: diff --git a/docs/pyboard/tutorial/lcd_skin.rst b/docs/pyboard/tutorial/lcd_skin.rst index 288ac1bf08..4df0041607 100644 --- a/docs/pyboard/tutorial/lcd_skin.rst +++ b/docs/pyboard/tutorial/lcd_skin.rst @@ -51,7 +51,7 @@ MPR121 capacitive touch sensor has address 90. To get started, try:: >>> import pyb - >>> i2c = pyb.I2C(1, pyb.I2C.MASTER) + >>> i2c = pyb.I2C(1, pyb.I2C.CONTROLLER) >>> i2c.mem_write(4, 90, 0x5e) >>> touch = i2c.mem_read(1, 90, 0)[0] @@ -68,7 +68,7 @@ directory or ``lib/`` directory) and then try:: >>> import pyb >>> import mpr121 - >>> m = mpr121.MPR121(pyb.I2C(1, pyb.I2C.MASTER)) + >>> m = mpr121.MPR121(pyb.I2C(1, pyb.I2C.CONTROLLER)) >>> for i in range(100): ... print(m.touch_status()) ... pyb.delay(100) @@ -80,7 +80,7 @@ Try touching each one in turn. Note that if you put the LCD skin in the Y-position, then you need to initialise the I2C bus using:: - >>> m = mpr121.MPR121(pyb.I2C(2, pyb.I2C.MASTER)) + >>> m = mpr121.MPR121(pyb.I2C(2, pyb.I2C.CONTROLLER)) There is also a demo which uses the LCD and the touch sensors together, and can be found `here <http://micropython.org/resources/examples/lcddemo.py>`__. |