7. LW3 Programmers’ Reference
MMX4x2 series – User's Manual
129
Applied firmware package: v1.6.0b19 | LDC software: v2.5.13b5
7.23. GPIO Port Configuration
DIFFERENCE:
This section refers to the MMX4x2-HDMI20-USB-L model only.
7.23.1. Querying the Direction of a GPIO Pin
Command and Response
#gpio
ç
GET·/MEDIA/GPIO/
<port>
.Direction
æ
pw·/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
Parameters
Parameter
Parameter description
Value
Value description
<dir>
The direction of the GPIO pin.
I
input
O
output
Example
ç
GET /MEDIA/GPIO/P1.Direction
æ
pw /MEDIA/GPIO/P1.Direction=I
7.23.2.
Setting the Direction of a GPIO Pin
Command and Response
ç
SET·/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
æ
pw·/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
Parameters
See the previous section.
Example
ç
SET /MEDIA/GPIO/P1.Direction=I
æ
pw /MEDIA/GPIO/P1.Direction=I
7.23.3. Querying the Output Level of a GPIO Pin
Command and Response
ç
GET·/MEDIA/GPIO/
<port>
.Output
æ
pw·/MEDIA/GPIO/
<port>
.Output(
<value>
)
Parameters
Parameter
Parameter description
Value
Value description
<value>
The output value of the GPIO pin.
H
high level
L
low level
Example
ç
GET /MEDIA/GPIO/P1.Direction
æ
pw /MEDIA/GPIO/P1.Direction=I
7.23.4.
Setting the Output Level of a GPIO Pin
Command and Response
ç
SET·/MEDIA/GPIO/
<port>
.Output(
<value>
)
æ
pw·/MEDIA/GPIO/
<port>
.Output(
<value>
)
Parameters
See the previous section.
Example
ç
SET /MEDIA/GPIO/P1.Direction=I
æ
pw /MEDIA/GPIO/P1.Direction=I
7.23.5.
Toggling the Level of a GPIO Pin
The output level can be changed from high to low and from low to high by the command below.
Command and Response
ç
CALL·/MEDIA/GPIO/
<port>
:toggle()
æ
mO·/MEDIA/GPIO/
<port>
:toggle
Example
ç
CALL /MEDIA/GPIO/P1:toggle()
æ
mO /MEDIA/GPIO/P1:toggle