Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
90
of
174
5.10.2.2. Function
int open(…)
Opens access to the ADC. Only one instance can be open at any time, only read access is
allowed and only blocking mode is supported.
Argument name
Type
Direction
Description
Pathname
const char *
in
The absolute path to the ADC to be opened.
ADC device is defined as
ADC_DEVICE_NAME.
Flags
int
in
Access mode flag, only O_RDONLY is
supported.
Return value
Description
Fd
A file descriptor for the device
on success
-1
See
errno
values
errno values
EEXISTS
Device not opened
EALREADY
Device is already open
EINVAL
Invalid options
5.10.2.3. Function
int close(…)
Closes access to the device.
Argument name
Type
Direction
Description
Fd
int
in
File descriptor received at open.
Return value
Description
0
Device closed successfully
-1
See
errno
values
errno values
EFAULT
Device not opened
5.10.2.4.
Function ssize_t read(…)
This is a blocking call to read data from the ADC.
Note!
The size of the given buffer must be a multiple of 32 bit.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at open.
buf
void*
in
Pointer to buffer to write data into.
count
size_t
in
Number of bytes to read. Only 4 bytes is
supported in this implementation.