![Telit Wireless Solutions GM862GPS Series Technical Manual Download Page 40](http://html1.mh-extra.com/html/telit-wireless-solutions/gm862gps-series/gm862gps-series_technical-manual_1083661040.webp)
TECHNICAL MANUAL
Telit GM862-GPS
Quad Band GPS Data Terminal Module
Pag.40 of 79
Rev. 0
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.13.4 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.13.4.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.13.4.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.
Return value is a Python integer which is -1 if an error occurred otherwise is input or
output value. It is 0 or 1.
Example:
a = GPIO.getIOvalue(5)
gets GPIO 5 input or output value, assigning return value to b.
3.13.4.3 GPIO.setIOdir(GPIOnumber, value, direction)
Sets direction of a GPIO.
First input parameter GPIOnumber is a Python integer which is the number of the GPIO.