Telit EZ10-GPRS/-PCS
Product Description
80269ST10014a, Rev. 3 – 26/09/05
Reproduction forbidden without written authorization by Telit Communications S.p.A.
Page 49 of 74
All Rights reserved – Right of modification reserved
Input parameter speed is a Python string which is the value of the serial port speed. It can be the
same speeds as the +IPR command.
NOTE: sending the +IPR command to the device is not affecting the physical serial, when using
Python engine you must use this function to set the speed of the port.
Optional Parameter <char format> is a Python string that represents the character format to be
used:
first is the number of bits per char (7 or 8), then the parity setting (N - none, E- even, O- odd) and
the number of stop bits (1 or 2). Default is "8N1"
Return value is a Python integer which is -1 if an error occurred otherwise is 1.
Example:
b = SER.SetSpeed('115200')
sets serial port speed to 115200, assigning return value to b.
3.3.5.3 GPIO built-in module
GPIO built-in module is the interface between Python core and module internal general purpose
input output direct handling.
You need to use GPIO built-in module if you want to set GPIO values from Python script and to
read GPIO values from Python script.
You can control GPIO pins also by sending internal 'AT#GPIO' commands using the MDM module,
but using the GPIO module is faster because no command parsing is involved, therefore it's use is
suggested.
Note that Python core does not verify if the pins are already used for other purposes (IIC module or
SPI module) by other functions, it's the applicator responsibility to ensure that no conflict over pins
occurs.
If you want to use GPIO built-in module you need to import it first:
import GPIO
then you can use GPIO built-in module methods like in the following example:
a = GPIO.getIOvalue(5)
b = GPIO.setIOvalue(4, 1)
which reads GPIO 5 value and sets GPIO 4 to output with value 1.
More details about GPIO built-in module methods are in the following paragraphs.
3.3.5.3.1 GPIO.setIOvalue(GPIOnumber, value)
Sets output value of a GPIO pin.
First input parameter GPIOnumber is a Python integer which is the number of the GPIO.
Second input parameter value is a Python integer which is the ouput value. It can be 0 or 1.
Return value is a Python integer which is -1 if an error occurred otherwise is 1.
Example:
b = GPIO.setIOvalue(4, 1)
sets GPIO 4 to output with value 1, assigning return value to b.
3.3.5.3.2 GPIO.getIOvalue(GPIOnumber)
Gets input or output value of a GPIO.
Input parameter GPIOnumber is a Python integer which is the number of the GPIO.