Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
75
of
174
errno values
EINVAL
Invalid options
ETIMEDOUT
Driver timed out waiting for the edge
detection to trigger
5.8.2.4. Function ssize_t write(...)
Sets the output value of the specified GPIO pin. If the pin is in input mode, the write is
allowed, but its value will not be reflected on the pin until it is set in output mode.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at open.
buf
const void*
in
Pointer to character buffer to get the write data
from.
count
size_t
in
Number of bytes to write, must be set to 1.
Return value
Description
>=0
Number of bytes that were written.
-1
See
errno
values
errno values
EINVAL
Invalid options
5.8.2.5. Function int ioctl(...)
The input/output control function can be used to configure the GPIO pin as a complement to
the simple data settings using the read/write file operations.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at open.
cmd
int
in
Command to send.
val
void *
in/out
Data according to the specific command.
Command table
Type
Direction Description
GPIO_IOCTL_GET_DIRECTION
uint32_t
out
Get input/output direction of the pin.
'0' output mode
'1' input mode
GPIO_IOCTL_SET_DIRECTION
uint32_t
in
Set input/output direction of the pin.
'0' output mode
'1' input mode
GPIO_IOCTL_GET_FALL_EDGE_DETECTION uint32_t
out
Get falling edge detection status of
the pin.
'0' detection disabled
'1' detection enabled
GPIO_IOCTL_SET_FALL_EDGE_DETECTION uint32_t
in
Set falling edge detection
configuration of the pin.
'0' detection disabled
'1' detection enabled