
S1S60000 Technical Manual
30
EPSON
Rev.1.5
(1)
Access to GPIO
When controlling GPIO, code “GPIO” in Target, port number of GPIO in Destination and the data to be output in
Data.
Table 5.2 shows the specification format for GPIO access on 1-port basis.
Table 5.3 shows the format on
16-port basis.
Using the mask, you can operate a specified GPIO alone by setting “1” on the bits corresponding
to the target GPIO and setting “0” on all other bits not corresponding to the target.
Table 5.2
GPIO Access Format (1-port basis)
Designation of port
Designation of output data
Return
value
Operation
Digit
Specifiable value
Digit
Specifiable value
Digit
1 port input
2
“00” to “0F” (*1)
-
None
1
1 port output
2
“00” to “0F” (*1)
1
“0”,“1”
1
*1 : Specify the corresponding GPIO with 2 digits hexadecimal numbers.
Table 5.3
GPIO Access Format (16-port basis)
Designation of port
Designation of
input/output
Designation of mask
Designation of
output value
Return
value
Operation
Digit
Specifiable
value
Digit
Specifiable
value
Digit
Specifiable
value
Digit
Specifiable
value
Digit
16 ports input
2
“0X”
1
“R” (*1)
16
“0”,“1” (*2)
-
None
16
16 ports output
2
“0X”
1
“W”
16
“0”,“1” (*2)
16
“0”,“1”
16
*1 : It can be omitted.
*2 : It can be omitted.
Omitting it automatically selects “1111111111111111”.
When 16 digits are specified, (when the mask, output value and return value are specified), GPIO15 and GPIO0
are arranged in the upper and the lower, respectively.
Table 5.4 shows state of data and return values.
Table 5.4
GPIO Data Designation/Return Value
Return
value
Description
“0”
Output is specified and LOW level is being output.
When the mask is specified, the port is
dropped from the target.
If the output value is specified, LOW level is output to the port.
“1”
Output is specified and HIGH level is being output.
When the mask is specified, the port is
selected as the target of operation.
When the output is specified, HIGH level is output to the port.
“L”
Input is specified and LOW level is currently input.
“H”
Input is specified and HIGH level is currently input.
“U”
Not selected as GPIO.
It is used as separate function.
“P”
Control from network is prohibited.
[ Example 1 ]
When outputting HIGH level to GPIO0 at IP address 192.168.1.1
URI:
http://192.168.1.1:8080/GPIO/00?1
Response (HIGH level being output): <DIV NAME=“DEVICE-VALUE”>1</DIV>
[ Example 2 ]
When checking input/output setup and input state of GPIO1 at IP address 192.168.1.1
URI:
http://192.168.1.1:8080/GPIO/01
Response (LOW level being input): <DIV NAME=“DEVICE-VALUE”>L</DIV>
[ Example 3 ]
When outputting LOW level to GPIO0 and HIGH level to GPIO4 at IP address 192.168.1.1
URI:
http://192.168.1.1:8080/GPIO/0X?W&0000000000010001&0000000000010000
Response: <DIV NAME=“DEVICE-VALUE”>LLLLPPPPLLL1PLL0</DIV>
[ Example 4 ]
When checking input/output setup and input state of GPIO15 from GPIO0 at IP address
192.168.1.1
URI:
http://192.168.1.1:8080/GPIO/0X
Response: <DIV NAME=“DEVICE-VALUE”>LLLLPPPPLLL0PLL0</DIV>