Document number
204911
Version
Rev. K
Issue date
2016-10-11
Sirius Breadboard User Manual
www.aacmicrotec.com
Page
42
of
106
5.7. Mass memory
5.7.1. Description
This section describes the mass memory 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.
5.7.2.1.
int open(…)
Opens access to the driver. The device can only be opened once at a time.
Argument name
Type
Direction
Description
filename
char *
in
The absolute path to the file that is to be
opened. Mass memory device is defined as
MASSMEM_DEVICE_NAME.
oflags
int
in
Device must be opened by exactly one of the
symbols defined in Table 5-1.
Return value
Description
>0
A file descriptor for the device.
- 1
see
errno
values
errno values
ENOENT
Invalid filename
EEXIST
Device already opened.
Table 5-1 - Open flag symbols
Symbol
Description
O_RDONLY
Open for reading only
O_WRONLY
Open writing only
O_RDWR
Open for reading and writing
5.7.2.2.
int close(…)
Closes access to the device.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at
open
.