Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
71
of
174
5.7.3. Usage description
5.7.3.1. RTEMS
5.7.3.2. Overview
The driver provides SpaceWire link setup and data transaction via the SpaceWire device.
Each application that wants to communicate via the SpaceWire device must register with a
logical address.
Registration to a logical address is performed by calling
open
with a device name consisting
of the predefined string SPWN_DEVICE_0_NAME_PREFIX concatenated with a string
corresponding to the chosen logical address number.
Deregistration is performed via
close
.
Multiple logic addresses may be registered at the same time. But each individual logic
address may only be registered for read and write once at the same time.
Logical addresses between 0
–
31 and 255 are reserved by the ESA’s ECSS SpaceWire
standard [RD2] and cannot be registered to.
Note!
A reception packet
buffer must be aligned to 4 bytes
in order to handle the packet’s
reception correctly. It is therefore recommended to assign the reception buffer in the
following way:
uint8_t __attribute__ ((aligned (4)) buf_rx[PACKET_SIZE];
5.7.3.3. Usage
The RTEMS driver must be opened before it can be used to access the SpaceWire device.
Once opened, all provided RTEMS API operations can be used as described subchapter 0.
And, if desired, the access can be closed when not needed.
Figure 5-6
–
RTEMS driver usage description
Note!
All calls to RTEMS driver are blocking calls.