Document number
205065
Version
Rev. N
Issue date
2019-02-04
Sirius OBC and TCM User Manual
Page
97
of
174
5.11.4.7. Function int ioctl(...)
Input/output control for SPI RAM.
Argument name
Type
Direction Description
fd
int
in
File descriptor received at open.
cmd
uint32_t / uint32_t*
in
Command to send.
val
int
in/out
Value to write or a pointer to a buffer where
data will be written.
Command table
Type
Direction Description
SPI_RAM_SET_EDAC_IOCTL
uint32_t
in
Configures the error correction and
detection for the SPI RAM, see
[5.11.4.1.]
SPI_RAM_SET_DIVISOR_IOCTL
uint32_t
in
Configures the serial clock divisor.
SPI_RAM_GET_EDAC_STATUS_IOCTL
uint32_t*
out
Get EDAC status for previous read
operations.
SPI_RAM_GET_DEBUG_DETECT_IOCTL
uint32_t*
out
Get Debug detect status.
EDAC Status
Description
SPI_RAM_EDAC_STATUS_MULT_ERROR
Multiple errors
detected.
SPI_RAM_EDAC_STATUS_DOUBLE_ERROR Double error
corrected.
SPI_RAM_EDAC_STATUS_SINGLE_ERROR
Single error corrected.
Debug Detect Status
Description
SPI_RAM_DEBUG_DETECT_TRUE
Debugger detected.
SPI_RAM_DEBUG_DETECT_FALSE
Debugger not
detected.
Return value
Description
0
Command executed successfully
-1
See
errno
values
errno values
EINVAL
Invalid options
ENODEV
Internal RTEMS resource error.
5.11.5. Usage description
The following #define needs to be set by the user application to be able to use the SPI RAM:
CONFIGURE_APPLICATION_NEEDS_SPI_RAM_DRIVER
The SPI RAM RTEMS driver supports multiple file descriptors opened simultaneously.