![Lightware UCX Series User Manual Download Page 79](http://html1.mh-extra.com/html/lightware/ucx-series/ucx-series_user-manual_1915481079.webp)
7. LW3 Programmers’ Reference
UCX series – User's Manual
79
Applied firmware package: v1.1.0b7 | LDC software: v2.5.4b3
7.13. GPIO Port Configuration
DIFFERENCE:
GPIO-related commands are available only from FW package 1.1.0b7.
7.13.1. Querying the Direction of a GPIO Pin
Command and Response
#gpio #new
ç
GET·/V1/MEDIA/GPIO/
<port>
.Direction
æ
pw·/V1/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
Parameters
Parameter
Parameter description
Value
Value description
<dir>
The direction of the GPIO pin.
Input
input
Output
output
Example
ç
GET /V1/MEDIA/GPIO/P1.Direction
æ
pw /V1/MEDIA/GPIO/P1.Direction=Input
7.13.2.
Setting the Direction of a GPIO Pin
Command and Response
ç
SET·/V1/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
æ
pw·/V1/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
Parameters
See the previous section.
Example
ç
SET /V1/MEDIA/GPIO/P1.Direction=Input
æ
pw /V1/MEDIA/GPIO/P1.Direction=Input
7.13.3. Querying the Output Level of a GPIO Pin
Command and Response
ç
GET·/V1/MEDIA/GPIO/
<port>
.Output
æ
pw·/V1/MEDIA/GPIO/
<port>
.Output(
<value>
)
Parameters
Parameter
Parameter description
Value
Value description
<value>
The output value of the GPIO pin.
High
high level
Low
low level
Example
ç
GET /V1/MEDIA/GPIO/P1.Output
æ
pw /V1/MEDIA/GPIO/P1.Output=Low
7.13.4.
Setting the Output Level of a GPIO Pin
Command and Response
ç
SET·/V1/MEDIA/GPIO/
<port>
.Output(
<value>
)
æ
pw·/V1/MEDIA/GPIO/
<port>
.Output(
<value>
)
Parameters
See the previous section.
Example
ç
SET /V1/MEDIA/GPIO/P1.Output=High
æ
pw /V1/MEDIA/GPIO/P1.Output=High
7.13.5. Setting the Output Level for a Specified Time
Command and Response
ç
CALL·/V1/MEDIA/GPIO/
<port>
:interval(
<value>
;
<time>
)
æ
mO·/V1/MEDIA/GPIO/
<port>
:interval=
Parameters
Parameter
Parameter description
Value
Value description
<value>
The output value of the GPIO pin.
High
high level
Low
low level
<time>
Duration of the desired value in seconds.
1-120
second
Example
ç
CALL /V1/MEDIA/GPIO/P1:interval(Low;1)
æ
mO /V1/MEDIA/GPIO/P1:interval=
7.13.6.
Toggling the Level of a GPIO Pin
The output level can be changed from high to low and low to high by the command below.
Command and Response
ç
CALL·/V1/MEDIA/GPIO/
<port>
:toggle()
æ
mO·/V1/MEDIA/GPIO/
<port>
:toggle
Example
ç
CALL /V1/MEDIA/GPIO/P1:toggle()
æ
mO /V1/MEDIA/GPIO/P1:toggle