Telit EZ10-GPRS/-PCS
Product Description
80269ST10014a, Rev. 3 – 26/09/05
Reproduction forbidden without written authorization by Telit Communications S.p.A.
Page 55 of 74
All Rights reserved – Right of modification reserved
Sends a byte to the SPI bus previously created addressed for the Slave number SS_number
whose Slave Select signal is activated.
Input parameter byte is a Python byte which is the byte to be sent to the SPI bus.
Optional Parameter SS_number is a Python byte representing the Slave number to be activated, if
not present no slave line is activated.
Return value is a Python integer which is -1 if an error occurred otherwise is 1 the byte has been
sent.
Example:
a = bus3.sendbyte(123)
sends byte 123 to the SPI bus , assigning return result value to a.
b=bus4.sendbyte(111,1)
sends byte 111 to the SPI bus activating the Slave Select line of the SS1 device (in our example
GPIO10)
3.3.5.6.3 SPI object method: send(string, <SS_number>)
Sends a string to the SPI bus previously created.
Input parameter string is a Python string which is the string to send to the SPI bus.
Optional Parameter SS_number is a Python byte representing the Slave number to be activated, if
not present no slave line is activated.
Return value is a Python integer which is -1 if an error occurred otherwise is 1 if all bytes of the
string have been sent.
Example:
a = bus3.send('test')
sends string 'test' to the SPI bus , assigning return result value to a.
3.3.5.6.4 SPI object method: read(len, <SS_number>)
Receives a string of len bytes from SPI bus device at Slave Select number SS_number.
Optional Parameter SS_number is a Python byte representing the Slave number to be activated, if
not present no slave line is activated.
Return value is a Python string which is containing data received.
Example:
a = bus4.read(10,0)
receives a string of 10 bytes from SPI bus device on SS0 line, assigning it to a.
3.3.5.6.5 SPI object method: readwrite(string, len, <SS_number>)
Send the string "string" and contemporaneously receives a string of len bytes from SPI bus device
at Slave Select number SS_number.
Optional Parameter SS_number is a Python byte representing the Slave number to be activated, if
not present no slave line is activated.
Return value is a Python string which is containing data received.
Example:
a = bus4.readwrite("hello",10,0)