![Telit Wireless Solutions EZ10 Series Скачать руководство пользователя страница 53](http://html1.mh-extra.com/html/telit-wireless-solutions/ez10-series/ez10-series_product-description_1083786053.webp)
Telit EZ10-GPRS/-PCS
Product Description
80269ST10014a, Rev. 3 – 26/09/05
Reproduction forbidden without written authorization by Telit Communications S.p.A.
Page 53 of 74
All Rights reserved – Right of modification reserved
3.3.5.5.5 IIC object method: dev_read(addr, len)
Receives a string of len bytes from IIC bus device at address addr.
Return value is a Python string which is containing data received.
Example:
a = bus1.read(114,10)
receives a string of 10 bytes from IIC bus device at address 114, assigning it to a.
3.3.5.5.6 IIC object method: dev_write(addr, string)
Sends a string to the IIC bus device at address addr.
Return value is a Python string which is 1 if data is acknowledged correctly, -1 otherwise.
Example:
a = bus1.dev_write(114,'123456789')
sends the string '123456789' to the IIC bus device at address 114, assigning the result to a.
3.3.5.5.7 IIC object method: dev_gen_read(addr, start, len)
Receives a string of len bytes from IIC bus device whose address is addr, starting from address
start.
Return value is a Python string which is containing data received.
Example:
a = bus1.read(114,122, 10)
receives a string of 10 bytes from IIC bus device at address 114, starting from address 122
assigning it to a.
3.3.5.5.8 IIC object method: dev_gen_write(addr, start, string)
Sends a string to the IIC bus device whose address is addr, starting from address start.
Return value is a Python string which is 1 if data is acknowledged correctly, -1 otherwise.
Example:
a = bus1.dev_write(114,, 112, '123456789')
sends the string '123456789' to the IIC bus device at address 114, starting from address start,
assigning the result to a.
3.3.5.6 SPI built-in module
SPI built-in module is an implementation on the Python core of the SPI bus Master using the "bit-
banging" technique.
You need to use SPI built-in module if you want to create one or more SPI bus on the available
GPIO pins. This SPI bus handling module is mapped on creation on three or more GPIO pins that
will become the Serial Data In/Out and Serial Clock pins of the bus, plus a number of optional chip
select pins up to 8. It can be multi-instantiated (you can create more than one SPI bus over
different pins) and the pins used must not be used for other purposes.
Note that Python core does not verify if the pins are already used for other purposes (IIC module or
GPIO module) by other functions, it's the applicator responsibility to ensure that no conflict over
pins occurs.
If you want to use SPI built-in module you need to import it first:
import SPI