MX Foundation 4
MX Embedded Functions

Functions

uint32 mxfEmbeddedTxAperiodicWrite (MXF_EMBEDDED_TXAPERIODIC_MSG *txWriteInfo)
 
uint32 mxfEmbeddedTxPeriodicUpdateMsgWrite (MXF_EMBEDDED_TXPERIODIC_UPDATEMSG *txWriteInfo)
 
uint32 mxfEmbeddedDeviceTimerGet (uint64 *timer)
 
uint32 mxfEmbeddedSharedBufferRead (uint32 offset, uint32 size, uint32 *data)
 
uint32 mxfEmbeddedSharedBufferWrite (uint32 offset, uint32 size, uint32 *data)
 
uint32 mxfEmbeddedTimerHandlerEnableSet (uint32 period, uint32 enable)
 
uint32 mxfEmbeddedRxBufferWrite (uint32 index, uint32 count, MXF_EMBEDDED_DATAREC *rec)
 
uint32 mxfEmbeddedRxBufferCountGet (uint32 index, uint32 *count)
 
uint32 mxfEmbeddedTxBufferRead (uint32 index, uint32 maxMsgCount, uint32 maxBytesCount, uint32 *msgCount, uint32 *byteCount, MXF_EMBEDDED_DATAREC *rec)
 
uint32 mxfEmbeddedTxBufferCountGet (uint32 index, uint32 *count)
 
uint32 mxfEmbeddedPortDiscreteWrite (uint32 moduleIndex, uint32 portIndex, uint32 mask, uint32 data)
 
uint32 mxfEmbeddedPortDiscreteRead (uint32 moduleIndex, uint32 portIndex, uint32 mask, uint32 *data)
 
uint32 mxfEmbeddedNVStorageFileMsgWrite (uint32 index, uint32 maxCount, void *msg, uint32 *count)
 
uint32 mxfEmbeddedNVStorageFileStatusGet (uint32 index, uint64 *freeByte, uint64 *unreadByte, uint64 *bufferedWriteByte, uint32 *overflow)
 
uint32 mxfEmbeddedNextRecordPtrGet (uint64 channelClass, uint64 recType, void *currentRec, void **nextRec)
 

Detailed Description

Function Documentation

uint32 mxfEmbeddedTxAperiodicWrite ( MXF_EMBEDDED_TXAPERIODIC_MSG txWriteInfo)

Writes data records to the specified transmitter channel queue. Data items to be transmitted are specified within records, along with a time tag and a control word. This function is similar and use the same channel queues of the mxfTxAperiodicWrite() MX Foundation's function.

Note
When time tags are used, time tags cannot be greater than the current device time + 32767000 nanoseconds. Time tags are in nanoseconds.
Parameters
[in]txWriteInfotransmit information structure
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxPeriodicUpdateMsgWrite()
mxfTxAperiodicWrite()
Examples:
ar429_embedded_side_discrete.c, and ar429_embedded_side_timer.c.
uint32 mxfEmbeddedTxPeriodicUpdateMsgWrite ( MXF_EMBEDDED_TXPERIODIC_UPDATEMSG txWriteInfo)

Writes data records to the specified transmitter channel periodic update message buffer specified by the message ID structure. Data items to be transmitted are specified within a record, along with a control word, data size and repeat count. This function is similar and use the same channel periodic update message buffers as the mxfTxPeriodicUpdateMsgWrite() MX Foundation's function.

The last message of each TX periodic update message buffer is sent endlessly until a new message is written into the buffer. The user may delete old messages before writing new ones or add new messages at the end of the TX periodic update messages buffer using relevant MXF_EMBEDDED_TXPERIODIC_UPDATEMSG.options parameter options.

This service is supported by theses channel class: ARINC 429 and MIL-1553.

Parameters
[in]txWriteInfoperiodic update information structure
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxAperiodicWrite()
mxfTxPeriodicUpdateMsgWrite()
uint32 mxfEmbeddedDeviceTimerGet ( uint64 *  timer)

Reads the device real time clock in nanoseconds.

Parameters
[out]timerdevice timer
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxAperiodicWrite()
uint32 mxfEmbeddedSharedBufferRead ( uint32  offset,
uint32  size,
uint32 *  data 
)

Reads data from shared buffer memory on the device.

A specific region of memory must be reserved on the device before the initialization by using the mxfSystemInitAttributeUint64CallbackHandler() and the KMXF_DEVICE_EMBEDDED_SHARED_SIZE attribute.

Parameters
[in]offsetoffset from the beginning of the shared memory in 32-bit basis
[in]sizenumber of 32-bit word to read
[out]datapointer to read buffer
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedSharedBufferWrite()
mxfSystemInitAttributeUint64CallbackHandler()
uint32 mxfEmbeddedSharedBufferWrite ( uint32  offset,
uint32  size,
uint32 *  data 
)

This function writes data to the shared space memory on the device.

A specific region of memory must be reserved on the device before the initialization by using the mxfSystemInitAttributeUint64CallbackHandler() and the KMXF_DEVICE_EMBEDDED_SHARED_SIZE attribute.

Parameters
[in]offsetoffset from the beginning of the shared memory in 32-bit basis
[in]sizenumber of 32-bit word to write
[in]datapointer to write buffer
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedSharedBufferRead()
uint32 mxfEmbeddedTimerHandlerEnableSet ( uint32  period,
uint32  enable 
)

Enables or disables the timer handler. When enabled, at each elapsed timer period the mxfEmbeddedTimerHandler() function handler is called.

Note
This timer cannot be very precise because module interrupts and data handling have the same priority. This may cause a little time jitter on the timer handler.
Parameters
[in]periodPeriod of the timer (5000 – 30000000 microseconds)
[in]enableEnables state (0:disabled, 1:enabled)
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Call mxfSystemErrorStringGet() to transform the return code into a text string.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTimerHandler()
Examples:
ar429_embedded_side_timer.c.
uint32 mxfEmbeddedRxBufferWrite ( uint32  index,
uint32  count,
MXF_EMBEDDED_DATAREC rec 
)

Writes records in the RX queue buffer. RX queue are used to transfer data from MX-Embedded to the host. This function will write data in the RX queue buffer so the host application can read it with mxfEmbeddedRxBufferRead(). This function uses the MXF_EMBEDDED_DATAREC structure.

Note
Data in the buffer is copied using 32-bit access. To avoid any endianness mapping issues, it is recommended to use only 32-bit data format for this buffer.
Parameters
[in]indexRX queue index
[in]countnumber of records to write
[in]recpointer to record array (MXF_EMBEDDED_DATAREC). The records are packed in the buffer. The mxfEmbeddedNextRecordPtrGet() function must be used to navigate from one record to the other in the buffer.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferRead()
mxfEmbeddedRxBufferCountGet()
mxfEmbeddedTxBufferRead()
mxfEmbeddedNextRecordPtrGet()
uint32 mxfEmbeddedRxBufferCountGet ( uint32  index,
uint32 *  count 
)

Returns the count of records in the RX queue buffer (i.e. count of pending records not read yet).

Parameters
[in]indexRX queue index
[out]countnumber of records
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedRxBufferRead()
mxfEmbeddedRxBufferWrite()
mxfEmbeddedTxBufferCountGet()
uint32 mxfEmbeddedTxBufferRead ( uint32  index,
uint32  maxMsgCount,
uint32  maxBytesCount,
uint32 *  msgCount,
uint32 *  byteCount,
MXF_EMBEDDED_DATAREC rec 
)

Reads records present in the TX bufferqueue. TX queues are used to transfer data from the host to MX-Embedded. This function will read data written in the TX queue buffer by the host application with mxfEmbeddedTxBufferWrite(). This function uses MXF_EMBEDDED_DATAREC structure.

Parameters
[in]indexTX queue index
[in]maxMsgCountmaximum number of records to read (0 means all messages).
[in]maxBytesCountmaximum number of bytes to read (minimum 1).
[out]msgCountreturned message count
[out]byteCountreturned byte count
[out]recpointer to data records (MXF_EMBEDDED_DATAREC). The records are packed in the buffer. The mxfEmbeddedNextRecordPtrGet() function must be used to navigate from one record to the other in the buffer.
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferWrite()
mxfEmbeddedTxBufferCountGet()
mxfEmbeddedRxBufferWrite()
mxfEmbeddedNextRecordPtrGet()
uint32 mxfEmbeddedTxBufferCountGet ( uint32  index,
uint32 *  count 
)

Returns the count of records in the TX buffer queue (i.e. count of pending records not read yet).

Parameters
[in]indexTX queue index
[out]countnumber of records
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxBufferWrite()
mxfEmbeddedTxBufferRead()
mxfEmbeddedRxBufferCountGet()
uint32 mxfEmbeddedPortDiscreteWrite ( uint32  moduleIndex,
uint32  portIndex,
uint32  mask,
uint32  data 
)

Sets the discrete output lines state of the specified discrete port.

Parameters
[in]moduleIndexmodule index
[in]portIndexport index
[in]maskport bit mask
[in]datadata to set

Port Mask Example

The mask bit 0 selects the channel first port, bit 1 the second port, etc.

Therefore, to set the state of the port #1, set the mask to 0x00000002.

Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedPortDiscreteRead()
mxfDiscreteChannelWrite()
uint32 mxfEmbeddedPortDiscreteRead ( uint32  moduleIndex,
uint32  portIndex,
uint32  mask,
uint32 *  data 
)

Reads the current discrete input lines state for the specified discrete port.

Parameters
[in]moduleIndexmodule index
[in]portIndexport index
[in]maskport mask.
[out]datadata returned.

Port Mask Example

The mask bit 0 selects the channel first port, bit 1 the second port, etc.

Therefore, to get the state of the port #1, set the mask to 0x00000002.

Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedPortDiscreteWrite()
mxfDiscreteChannelRead()
uint32 mxfEmbeddedNVStorageFileMsgWrite ( uint32  index,
uint32  maxCount,
void *  msg,
uint32 *  count 
)

This function writes messages to the specified file. The messages format must follow the message type of the file.

Parameters
[in]indexfile index
[in]maxCountmaximum number of messages to write
[in]msgpointer to messages to write
[out]countnumber of messages actually written
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedNVStorageFileStatusGet()
uint32 mxfEmbeddedNVStorageFileStatusGet ( uint32  index,
uint64 *  freeByte,
uint64 *  unreadByte,
uint64 *  bufferedWriteByte,
uint32 *  overflow 
)

This function gets the status of the specified file index.

Parameters
[in]indexfile index
[out]freeBytefile free byte count
[out]unreadBytefile unread byte count
[out]bufferedWriteBytefile buffered write count
[out]overflowfile overflow
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedNVStorageFileMsgWrite()
uint32 mxfEmbeddedNextRecordPtrGet ( uint64  channelClass,
uint64  recType,
void *  currentRec,
void **  nextRec 
)

Returns the next buffer address in a buffer array.

Parameters
[in]channelClasschannel class
[in]recTyperecord type. Should be MXF_EMBEDDED_RECTYPE_DATAREC for data record.
[in]currentRecpointer to the beginning or the current record in the buffer
[out]nextRecpointer to next record in the buffer
Returns
MAXT_SUCCESS is returned when the function has succeeded.
Refer to mxf_error.h for a list of defined errors.
Availability:
Available in MX Foundation 4.0 and later.
See also
mxfEmbeddedTxAperiodicWrite()
mxfEmbeddedTxPeriodicUpdateMsgWrite()
mxfEmbeddedSharedBufferRead()
mxfEmbeddedSharedBufferWrite()
Updated 10/23/2023