Document number
204911
Version
Rev. K
Issue date
2016-10-11
Sirius Breadboard User Manual
www.aacmicrotec.com
Page
32
of
106
5.4.3.3. RTEMS application example
In order to use the scet driver on RTEMS environment, the following code structure is
suggested to be used:
Inclusion of
<fcntl.h>
and <unistd.h>
are required for using the POSIX functions:
open
,
close, ioctl
.
Inclusion of
<errno.h>
is required for retrieving error values on failures.
Inclusion of <
bsp/scet_rtems.h>
is required for accessing scet device name
RTEMS_SCET_DEVICE_NAME.
CONFIGURE_APPLICATION_NEEDS_SCET_DRIVER
must be defined for using the scet
driver. By defining this as part of RTEMS configuration, the driver will automatically be
initialized at boot up.
#include <bsp.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <bsp/scet_rtems.h>
#define CONFIGURE_APPLICATION_NEEDS_SCET_DRIVER
#define CONFIGURE_MAXIMUM_MESSAGE_QUEUES 20
#include <bsp/bsp_confdefs.h>
#include <rtems/confdefs.h>
#define CONFIGURE_INIT
rtems_task Init (rtems_task_argument argument);
rtems_task Init (rtems_task_argument ignored)
{
}