Document number
204911
Version
Rev. K
Issue date
2016-10-11
Sirius Breadboard User Manual
www.aacmicrotec.com
Page
49
of
106
5.8. Spacewire
5.8.1. Description
This section describes the SpaceWire driver’s design and usability.
5.8.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.8.2.5.
5.8.2.1.
int open(…)
Registers the application to the device name for data transactions. Although multiple
accesses for data transaction is allowed, only one access per unique device name is valid.
Device name must be set with a logical number as described in usage description in
subchapter 5.8.3.1.
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-2.
Return value
Description
>0
A file descriptor for the device.
- 1
see
errno
values
errno values
ENOENT
Invalid device name
EEXIST
Device already opened.
EEGAIN
Opening of device failed due to internal
error. Try again.
Table 5-2 - Open flag symbols
Symbol
Description
O_RDONLY
Open for reading only
O_WRONLY
Open writing only
O_RDWR
Open for reading and writing
5.8.2.2.
int close(…)
Deregisters the device name from data transactions.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
.