User's Manual

TECHNICAL MANUAL
Telit GM862-GPS
Quad Band GPS Data Terminal Module
Pag.42 of 79
Rev. 0
3.13.5.3 MOD.reactivatePython()
Reactivates Python script after exiting from actual Python script.
This method is useful for Python script restart.
The effect of this method is to restart the complete procedure of selecting the Python script
to be executed and of executing it.
If you want this method to have the expected effect you need to exit actual Python script
as soon as possible after calling it (for example braking while or for loops).
No input parameter.
No return value.
Example:
MOD.reactivatePython()
reactivates Python after next exiting from Python script.
3.13.6 IIC built-in module
IIC built-in module is an implementation on the Python core of the IIC bus Master (No
Multi-Master) using the "bit-banging" technique.
You need to use IIC built-in module if you want to create one or more IIC bus on the
available GPIO pins. This IIC bus handling module is mapped on creation on two GPIO
pins that will become the Serial Data and Serial Clock pins of the bus. It can be multi-
instantiated (you can create more than one IIC 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 (SPI
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 IIC built-in module you need to import it first:
import IIC
then you can create the new bus over the GPIO pins (for example over the pins GPIO3,
GPIO4) and then use IIC built-in module methods like in the following example:
IICbus = IIC.new(3,4)
IICbus.init()
res = IICbus.send('test')
c = IICbus.sendbyte(0x0d)
d = IICbus.readbyte()
which sends 'test' followed by CR and receives data waiting for one second.
NOTE that you must provide external pull-up on SDA line since the line is working as open
collector, SCLK instead is driven with a complete push pull.
More details about IIC built-in module object methods are in the following paragraphs.
3.13.6.1 IIC.new(SDA_pin, SCL_pin)
Creates a new IIC bus object on the GPIO pins number.
Input parameter SDA_pin, SCL_pin are Python bytes which are the GPIO pin number
where the SDA (Serial DAta) and SCL (Serial CLock) lines are mapped.
Return value is the Python custom IIC bus object pointer which then shall be used to
interface with the IIC bus created.
Example:
bus1 = IIC.new(3,4)