Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
66
of
174
5.7. Spacewire
5.7.1. Description
This section describes the SpaceWire driver’s design and usability.
5.7.2. RTEMS API
This API represents the
driver interface from a user application’s perspective for the RTEMS
driver.
The driver functionality is accessed through RTEMS POSIX API for ease of use. In case of
failure on a function call,
errno
value is set for determining the cause. Additional
functionalities are supported via POSIX Input/Output Control API as described in subchapter
5.7.2.5.
5.7.2.1. int open
(…)
Opens a file descriptor associated with the named device, and registers with the
corresponding logic address. Each unique device may only be opened once for read-only
and once for write-only at the same time, or alternatively opened only once for read-write at
the same time. The device name must be set with a logical address number as described in
the usage description in subchapter 5.7.3
Argument name
Type
Direction Description
filename
char *
in
Device name to register to for data transaction.
oflags
int
in
Device must be opened by exactly one of the
symbols defined in Table 5-4.
Return value
Description
>0
A file descriptor for the
device.
- 1
see
errno
values
errno values
EIO
Internal RTEMS resource
error.
EALREADY
Device already opened for the
requested access mode (read
or write).
ENOENT
Invalid filename.