USER MANUAL RC188x-GPR
2019 Radiocrafts AS
RIIM User Manual (rev.1.2)
Page
15
of
23
8.6. GPIO
The GPIO module is used to control the GPIOs. By default all GPIOs are tri-state inputs with no pullup or pulldown.
The following example shows how to configure GPIO 9 as output and setting it to logical ‘1’.
Example : ICI code
RIIM_SETUP
()
{
// Set up GPIO 9
GPIO
.
setDirection
(
GPIO_9
,
OUTPUT
);
GPIO
.
setValue
(
GPIO_9
,
HIGH
);
return
UAPI_OK
;
}
Example 6 - GPIO example code
The following functions are part of the GPIO module.
Function
Description
Init
()
Initialize the GPIO module
setDirection
(Pin, Direction)
Set the GPIO direction to input or output
setPull
(Pin,Pull)
Set pullup, pulldown or no pull on an input pin
setHandler
(Pin, InterruptEdge,
Handler)
Register a handler to be called when a specific transition happen on a
GPIO
setValue
(Pin, Value)
Set the value on an output GPIO to logical 0 or 1
toggle
(Pin)
Invert the output value on an GPIO
getValue
(Pin)
Read the value of a GPIO pin
Table 6 - GPIO functions