TECHNICAL MANUAL
Telit GM862-GPS
Quad Band GPS Data Terminal Module
Pag.43 of 79
Rev. 0
bus2 = IIC.new(5,6)
This creates two IIC bus, one over the GPIO3 and GPIO4 and one over the GPIO5 and
GPIO6.
Available pins for the IIC bus are GPIO3 - GPIO13, while GPIO1 and GPIO2 are not
available for IIC.
3.13.6.2 IIC
object
method: init()
Does the first pin initialisation on the IIC bus previously created.
Return value is a Python integer which is -1 if an error occurred otherwise is 1.
Example:
a = bus1.init()
3.13.6.3
IIC object method: sendbyte(byte)
Sends a byte to the IIC bus previously created.
Input parameter byte is a Python byte which is the byte to be sent to the IIC bus.
The start and stop condition on the bus are added by the function.
Return value is a Python integer which is -1 if an error occurred otherwise is 1 the byte has
been acknowledged by the slave.
Example:
a = bus1.sendbyte(123)
sends byte 123 to the IIC bus , assigning return result value to a.
3.13.6.4 IIC
object
method: send(string)
Sends a string to the IIC bus previously created.
Input parameter string is a Python string which is the string to send to the IIC bus.
Return value is a Python integer which is -1 if an error occurred otherwise is 1 if all bytes
of the string have been acknowledged by the slave.
Example:
a = bus1.send('test')
sends string 'test' to the IIC bus , assigning return result value to a.
3.13.6.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.13.6.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.13.6.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.