Software Library API naibrd 1.62
See all documentation at naii.docs.com
Processor Controlled RT Functions

Functions

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_SetCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_sum1553_procctrl_t mask)
 Sets the 1553 Processor Control Register for the specified 1553 channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_ClearFifo (int32_t cardIndex, int32_t module, int32_t channel, nai_sum1553_procfifo_t fifos)
 Clears the specified FIFO for the specified 1553 channel by resetting the count register for the FIFO to zero.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_RT_SetEventSAMask (int32_t cardIndex, int32_t module, int32_t channel, int32_t event, uint32_t samask)
 Sets the Subaddresses mask such that only the 1553 messages received from these subaddresses are placed on the "Event" FIFO and retrieved in the Interrupt Driven Reply (IDR) Unprompted Reply (UPR) message.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_SetEventVector (int32_t cardIndex, int32_t module, int32_t channel, int32_t event, uint16_t vector)
 Sets the Interrupt Event Vector for Ethernet Unprompted Replies (UPR) associated with the Event Subaddress Mask. Whenever the Interrupt Event Vector is generated the contents in the Event FIFO are read and sent to the host as a Unprompted Reply (UPR) message.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_RT_LoadDataBlock (int32_t cardIndex, int32_t module, int32_t channel, nai_sum1553_samctype_t samctype, uint16_t subaddr, const uint16_t datablock[], uint16_t offset, uint16_t count)
 Sets the 32 Data Words to be transmitted when a RT-BC message is received by placing a request on the "Request" FIFO for the 1553 Processor to write to the 1553 Core memory.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_RT_ReadDataBlock (int32_t cardIndex, int32_t module, int32_t channel, nai_sum1553_samctype_t samctype, uint16_t subaddr, uint16_t outdatablock[], uint16_t offset, uint16_t count)
 Retrieves the 32 Data Words for 1553 message by placing a request on the "Request" FIFO for the 1553 Processor to read the data and placing the response on the "Response" FIFO which is then read by this routine.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_SetEventUPR (int32_t cardIndex, int32_t module, int32_t channel, int32_t slot, nai_ether_upr_type_t uprtype, uint8_t ip[], uint16_t port, uint8_t seqhi, uint16_t vector)
 Sets up a Interrupt Driven Reply (IDR) Unprompted Reply (UPR) that will read EVENT_FIFO_FRAME_SIZE words from the "Event" FIFO whenever the interrupt associated with the vector passed in occurs.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_ProcessEventUPR (int32_t cardIndex, int32_t module, int32_t channel, uint8_t msg[], nai_ether_typecode_t typecode, nai_ether_gen_t gen, int32_t offset, nai_sum1553_eventtype_t *outevent, nai_sum1553_samctype_t *outtype, uint16_t *outsa, uint16_t *outwordcount, uint16_t *outinfo, uint16_t *outtimestamp, uint16_t outcmd[2], uint16_t outstatus[2], uint16_t data[32])
 Decodes the UPR Read message that is passed in and returns the data content.
 

Detailed Description


Function Documentation

◆ naibrd_SUM1553_Proc_ClearFifo()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_ClearFifo ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_sum1553_procfifo_t fifos )

Clears the specified FIFO for the specified 1553 channel by resetting the count register for the FIFO to zero.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
fifos: (Input) NAI_SUM1553_PROC_FIFO_EVENT, NAI_SUM1553_PROC_FIFO_REQ, NAI_SUM1553_PROC_FIFO_RESP and/or NAI_SUM1553_PROC_FIFO_ALL.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_Proc_ProcessEventUPR()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_ProcessEventUPR ( int32_t cardIndex,
int32_t module,
int32_t channel,
uint8_t msg[],
nai_ether_typecode_t typecode,
nai_ether_gen_t gen,
int32_t offset,
nai_sum1553_eventtype_t * outevent,
nai_sum1553_samctype_t * outtype,
uint16_t * outsa,
uint16_t * outwordcount,
uint16_t * outinfo,
uint16_t * outtimestamp,
uint16_t outcmd[2],
uint16_t outstatus[2],
uint16_t data[32] )

Decodes the UPR Read message that is passed in and returns the data content.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
msg: (Input) UPR Read Register message.
typecode: (Input) Expected UPR typecode.
gen: (Input) Ethernet message generation code.
offset: (Input) msg offset (0 for first element in msg).
outevent: (Output) NAI_SUM1553_EVENT_TYPE_SA or NAI_SUM1553_EVENT_TYPE_ERROR.
outtype: (Output) Word Count/Subaddress Word.
outsa: (Output) Subaddress.
outwordcount: (Output) Word Count.
outinfo: (Output) Message Information Word.
outtimestamp: (Output) Time-Tag.
outcmd: (Output) Command Word 1 and Command Word 2.
outstatus: (Output) Status Word 1 and Status Word 2.
data: (Output) Data Words (32 Words).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_INVALID_MESSAGE when the number of elements retrieved is not equal to EVENT_FIFO_FRAME_SIZE.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_Proc_RT_LoadDataBlock()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_RT_LoadDataBlock ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_sum1553_samctype_t samctype,
uint16_t subaddr,
const uint16_t datablock[],
uint16_t offset,
uint16_t count )

Sets the 32 Data Words to be transmitted when a RT-BC message is received by placing a request on the "Request" FIFO for the 1553 Processor to write to the 1553 Core memory.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
samctype: (Input) NAI_SUM1553_SAMCTYPE_SA | NAI_SUM1553_SAMCTYPE_TX or NAI_SUM1553_SAMCTYPE_MC | NAI_SUM1553_SAMCTYPE_TX or NAI_SUM1553_SAMCTYPE_BC | NAI_SUM1553_SAMCTYPE_TX.
subaddr: (Input) SubAddress.
datablock: (Input) Data Words to be transmitted to BC.
offset: (Input) Offset in datablock (0 for the first element).
count: (Input) Number of data words.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_Proc_RT_ReadDataBlock()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_RT_ReadDataBlock ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_sum1553_samctype_t samctype,
uint16_t subaddr,
uint16_t outdatablock[],
uint16_t offset,
uint16_t count )

Retrieves the 32 Data Words for 1553 message by placing a request on the "Request" FIFO for the 1553 Processor to read the data and placing the response on the "Response" FIFO which is then read by this routine.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
samctype: (Input) NAI_SUM1553_SAMCTYPE_SA | NAI_SUM1553_SAMCTYPE_TX or NAI_SUM1553_SAMCTYPE_MC | NAI_SUM1553_SAMCTYPE_TX or NAI_SUM1553_SAMCTYPE_BC | NAI_SUM1553_SAMCTYPE_TX or NAI_SUM1553_SAMCTYPE_SA | NAI_SUM1553_SAMCTYPE_RX or NAI_SUM1553_SAMCTYPE_MC | NAI_SUM1553_SAMCTYPE_RX or NAI_SUM1553_SAMCTYPE_BC | NAI_SUM1553_SAMCTYPE_RX .
subaddr: (Input) SubAddress.
outdatablock: (Output) Data Words.
offset: (Input) Offset in data to start reading from (0 for the first element).
count: (Input) Number of data words to read.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_Proc_RT_SetEventSAMask()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_RT_SetEventSAMask ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t event,
uint32_t samask )

Sets the Subaddresses mask such that only the 1553 messages received from these subaddresses are placed on the "Event" FIFO and retrieved in the Interrupt Driven Reply (IDR) Unprompted Reply (UPR) message.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
event: (Input) Currently only one Event is supported (value must be 0).
samask: (Input) Event Subaddress Mask. Each bit in the Mask is for a Subaddress (MSB (bit 31) for SA 31 and LSB (bit 0) for SA 0). If Subaddress bit is set to 1, the 1553 messages received from this subaddress will be placed on the "Event" FIFO.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_INVALID_RANGE when invalid event parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_Proc_SetCtrl()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_SetCtrl ( int32_t cardIndex,
int32_t module,
int32_t channel,
nai_sum1553_procctrl_t mask )

Sets the 1553 Processor Control Register for the specified 1553 channel.

If the NAI_SUM1553_PROC_CTRL_ENABLE is enabled (1), the 1553 Module Processor will take over the control the Remote Terminal handling of 1553 messages and requests. Using the 1553 Interrupt mechanism, the Processor will place any received 1553 messages on the "Event" FIFO. If using Ethernet communication, the host or subsystem needs to setup the "Unprompted Reply" (UPR) Ethernet message so that the data in the "Event" FIFO is automatically sent to the host or subsystem. For applications that want to use the Processor Controlled mechanism and do not use the UPR Ethernet mechanism, it is important to make sure that the "Event" FIFO does not become full which will result in lost 1553 messages.

When in 1553 Processor controlled mode, updates to the Core memory must be done via request on the "Request" FIFO and responses are placed in the "Response" FIFO. Note, while in Processor controlled mode, the host should not access the Core memory directly. Doing so may result in changing the value of the "page" register resulting in unpredictable behavior. If the NAI_SUM1553_PROC_CTRL_HPRIOREQ is enabled (1), the requests will have higher priority than the 1553 message interrupts.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
mask: (Input) NAI_SUM1553_PROC_CTRL_ENABLE and/or NAI_SUM1553_PROC_CTRL_HPRIOREQ masking.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_Proc_SetEventUPR()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_SetEventUPR ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t slot,
nai_ether_upr_type_t uprtype,
uint8_t ip[],
uint16_t port,
uint8_t seqhi,
uint16_t vector )

Sets up a Interrupt Driven Reply (IDR) Unprompted Reply (UPR) that will read EVENT_FIFO_FRAME_SIZE words from the "Event" FIFO whenever the interrupt associated with the vector passed in occurs.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
slot: (Input) UPR slot index (0 - 19).
uprtype: (Input) TCP (1) or UDP (2) .
ip: (Input) IP address that UDP response should go to Not used for TCP.
port: (Input) Port that UDP response should go to. For TCP return to the client's connected to Port 23.
seqhi: (Input) Upper byte of the Sequence Number that will be returned in the UPR.
vector: (Input) Module Interrupt vector (1 -255).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_SUM1553_Proc_SetEventVector()

NAIBRDFUNC nai_status_t NAIAPI naibrd_SUM1553_Proc_SetEventVector ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t event,
uint16_t vector )

Sets the Interrupt Event Vector for Ethernet Unprompted Replies (UPR) associated with the Event Subaddress Mask. Whenever the Interrupt Event Vector is generated the contents in the Event FIFO are read and sent to the host as a Unprompted Reply (UPR) message.

Parameters
cardIndex: (Input) Logical Card Index assigned to connection with the NAI_BOARD (0 - NAI_MAX_CARDS-1).
module: (Input) Module Number of the module to access (1 - [max modules for board]).
channel: (Input) Channel Number of the channel to access (1 - [max channels for module]).
event: (Input) Currently only one Event is supported (value must be 0).
vector: (Input) Interrupt vector associated with the Event Subaddress Mask.
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid card parameter is specified.
  • NAI_ERROR_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_INVALID_RANGE when invalid event parameter is specified.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.