Document number
204911
Version
Rev. K
Issue date
2016-10-11
Sirius Breadboard User Manual
www.aacmicrotec.com
Page
27
of
106
5.4. SCET
5.4.1. Description
This section describes the driver as a utility for accessing the SCET device.
5.4.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.
SCET accesses can either be done by reading and writing to the device file. In this way the
second and subsecond values can be read and/or modified.
The SCET RTEMS driver also supports a number of different IOCTLs.
Finally there is a message queue interface allowing the application to act upon different
events.
5.4.2.1.
int open(…)
Opens access to the device, it 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. SCET device is defined as
RTEMS_SCET_DEVICE_NAME.
oflags
int
in
A bitwise 'or' separated list of values that
determine the method in which the file is to be
opened (whether it should be read only,
read/write, whether it should be cleared when
opened, etc).
Return value
Description
*
A file descriptor for the device on
success
- 1
see
errno
values
errno values
EALREADY
Device already opened
5.4.2.2.
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