Software Library API naibrd 2.24.0
See all documentation at naii.docs.com

Functions

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcCmdCreate (int16_t device, int16_t commandId, naibrd_1553_bc_opcode_t opcode, naibrd_1553_bc_condition_t condition, uint32_t parameter1, uint32_t parameter2, uint32_t reserved)
 Create an opcode command for use in the creation of a frame.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcCmdDelete (int16_t device, int16_t commandId)
 Delete an opcode command.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcFrmCreate (int16_t device, int16_t frameId, naibrd_1553_bc_frameType_t frameType, const int16_t *p_commandIds, uint16_t commandCount, uint16_t frameTime, naibrd_1553_bc_frameoptions_t flags)
 Create a BC frame from an array of opcode IDs input by the user.
 
NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcFrmDelete (int16_t device, int16_t frameId)
 Delete a BC frame.
 

Detailed Description

Function Documentation

◆ naibrd_1553_BcCmdCreate()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcCmdCreate ( int16_t device,
int16_t commandId,
naibrd_1553_bc_opcode_t opcode,
naibrd_1553_bc_condition_t condition,
uint32_t parameter1,
uint32_t parameter2,
uint32_t reserved )

Create an opcode command for use in the creation of a frame.

Parameters
device: (Input) Logical Device Number (0-31).
commandId: (Input) Unique command ID.
opcode: (Input) Type of opcode operated by the new command.
* NAIBRD_1553_OPCODE_TRAP
* Trap.
*
* NAIBRD_1553_OPCODE_EXECUTE_MESSAGE
* Execute message. Use parameter1 input parameter to
* specify the Message ID to execute.
*
* NAIBRD_1553_OPCODE_JUMP
* Jump. Use parameter1 input parameter to specify
* the number of commands to jump forward or back from
* the current frame position. parameter1 value of
* zero should be avoided.
*
* NAIBRD_1553_OPCODE_CALL_SUBROUTINE
* Call subroutine. Use parameter1 input parameter to
* specify the minor frame ID to jump to.
*
* NAIBRD_1553_OPCODE_RETURN_FROM_SUBROUTINE
* Return from subroutine. parameter1 and parameter2
* are not used.
*
* NAIBRD_1553_OPCODE_INTERRUPT_REQUEST
* Interrupt request. Use parameter1 input parameter
* to specify which IRQ bit will be set in Interrupt
* Status Register #2 when an interrupt is generated.
* Set bit 0 in parameter1 for IRQ0, bit 1 for IRQ1,
* bit 2 for IRQ2, and/or bit 3 for IRQ3.
*
* NAIBRD_1553_OPCODE_HALT
* Halt the BC. parameter1 and parameter2 are not
* used.
*
* NAIBRD_1553_OPCODE_DELAY
* Delay in microseconds. Use parameter1 to set the
* delay value.
*
* NAIBRD_1553_OPCODE_WAIT_END_OF_FRAME
* Wait until frame counter is zero. parameter1 and
* parameter2 are not used.
*
* NAIBRD_1553_OPCODE_COMPARE_TO_FRAME_TIMER
* Compare frame timer to value set in the parameter1
* input parameter. The resolution of the value is 100
* microseconds. This command will set the value of
* the Less Than flag and Equal To flag bits in the BC
* Condition Code Register. The condition input
* parameter is not used.
*
* NAIBRD_1553_OPCODE_COMPARE_TO_MESSAGE_TIMER
* Compare message timer to value set in the parameter1
* input parameter. The resolution of the value is 1
* microseconds. This command will set the value of the
* Less Than flag and Equal To flag bits in the BC
* Condition Code Register. The condition input
* parameter is not used.
*
* NAIBRD_1553_OPCODE_UPDATE_GENERAL_PURPOSE_FLAG
* Set/clear/toggle the 8 general purpose bits. Use
* parameter1 to set, clear or toggle one or more
* general purpose flags (GPF). Bits n and n+8 of parameter1
* affect the general purpose flag n. n is used to set
* and n+8 is used to clear. If both n and n+8 are set,
* this will toggle flag n. For example, to set GPF0,
* parameter1 should be 0x0001. To clear GPF6, parameter1
* should be 0x4000. To toggle GPF3, parameter1 should be
* 0x0808. The condition input parameter is not used.
*
* NAIBRD_1553_OPCODE_LOAD_TIME_TAG_COUNTER
* Load time tag counter with value specified by parameter1.
*
* NAIBRD_1553_OPCODE_LOAD_FRAME_TIMER
* Load frame time register with value specified by
* parameter1. The resolution is 100 microseconds.
*
* NAIBRD_1553_OPCODE_START_FRAME_TIMER
* Start frame time counter. parameter1 and parameter2
* are not used.
*
* NAIBRD_1553_OPCODE_PUSH_TIME_TAG_COUNTER
* Push time tag to General Purpose Queue. parameter1
* and parameter2 are not used.
*
* NAIBRD_1553_OPCODE_PUSH_BLOCK_STATUS_WORD
* Push block status word to General Purpose Queue.
* parameter1 and parameter2 are not used.
*
* NAIBRD_1553_OPCODE_PUSH_VALUE
* Push data to General Purpose Queue. Use parameter1
* input parameter to specify the data value.
*
* NAIBRD_1553_OPCODE_PUSH_INDERCT_VALUE
* Push data at a memory location to General Purpose
* Queue. Use parameter1 input parameter to specify
* the memory location address.
*
* NAIBRD_1553_OPCODE_WAIT_FOR_TRIGGER
* Wait for rising edge in the external trigger.
* parameter1 and parameter2 are not used.
*
* NAIBRD_1553_OPCODE_EXECUTE_AND_FLIP
* Execute and flip message. parameter1 should be used
* to specify the address of a dual message block.
* Every time this command is executed (and if the
* condition tests true), bit 4 of parameter1 toggles
* such that the parameter ping-pongs back and forth
* between the address of message 1 and the address
* of message 2. In this way, message execution
* alternates between message 1 and 2.
*
* NAIBRD_1553_OPCODE_FOCUS_ON_VARIABLE
* Focus on variable. Use parameter1 to specify
* the variable number (0 to 7).
*
* NAIBRD_1553_OPCODE_ADD_TO_VARIABLE
* Add the two's complement value to the currently
* focused variable. The value is specified in
* parameter1.
*
* NAIBRD_1553_OPCODE_LOAD_TO_VARIABLE
* Load value to the currently focused variable.
* The value is specified in parameter1.
*
* NAIBRD_1553_OPCODE_COMPARE_VARIABLE
* Compare the currently focused variable to value
* given by parameter1. If parameter1 is less than
* the variable value, the Less Than flag will be
* set in the BC Condition Code Register and if
* they are equal, the Equal To flag will be set.
*
* NAIBRD_1553_OPCODE_PUSH_VARIABLE
* Focus on variable and push its value to the General Purpose Queue.
* Use parameter1 to specify the variable number (0 to 7).
*
* NAIBRD_1553_OPCODE_TIME_CONDITIONED_MESSAGE_TX
* A software opcode that is parsed into a series of hardware opcodes
* that condition the Tx of a message with available frame time, similar
* to what’s done with asynchronous messages.
* 
condition: (Input) Condition that must be true for the opcode to run.
* NAIBRD_1553_OPCODE_COND_LESS_THAN
* Less than.
*
* NAIBRD_1553_OPCODE_COND_GREATER_THAN
* Greater than.
*
* NAIBRD_1553_OPCODE_COND_EQUAL
* Equal.
*
* NAIBRD_1553_OPCODE_COND_NOT_EQUAL
* Not equal.
*
* NAIBRD_1553_OPCODE_COND_GP1_1
* GP1 is logic 1.
*
* NAIBRD_1553_OPCODE_COND_GP1_0
* GP1 is logic 0.
*
* NAIBRD_1553_OPCODE_COND_GP2_1
* GP2 is logic 1.
*
* NAIBRD_1553_OPCODE_COND_GP2_0
* GP2 is logic 0.
*
* NAIBRD_1553_OPCODE_COND_GP3_1
* GP3 is logic 1.
*
* NAIBRD_1553_OPCODE_COND_GP3_0
* GP3 is logic 0.
*
* NAIBRD_1553_OPCODE_COND_GP4_1
* GP4 is logic 1.
*
* NAIBRD_1553_OPCODE_COND_GP4_0
* GP4 is logic 0.
*
* NAIBRD_1553_OPCODE_COND_GP5_1
* GP5 is logic 1.
*
* NAIBRD_1553_OPCODE_COND_GP5_0
* GP5 is logic 0.
*
* NAIBRD_1553_OPCODE_COND_GP6_1
* GP6 is logic 1.
*
* NAIBRD_1553_OPCODE_COND_GP6_0
* GP6 is logic 0.
*
* NAIBRD_1553_OPCODE_COND_GP7_1
* GP7 is logic 1.
*
* NAIBRD_1553_OPCODE_COND_GP7_0
* GP7 is logic 0.
*
* NAIBRD_1553_OPCODE_COND_NO_RESPONSE
* No response from RT.
*
* NAIBRD_1553_OPCODE_COND_RESPONSE
* Response from RT.
*
* NAIBRD_1553_OPCODE_COND_FORMAT_ERROR
* Format error.
*
* NAIBRD_1553_OPCODE_COND_NO_FORMAT_ERROR
* No format error.
*
* NAIBRD_1553_OPCODE_COND_GOOD_TRANSFER
* Good data block transfer.
*
* NAIBRD_1553_OPCODE_COND_BAD_TRANFER
* Bad data block transfer.
*
* NAIBRD_1553_OPCODE_COND_MASKED_STATUS_SET
* Masked status set.
*
* NAIBRD_1553_OPCODE_COND_MASKED_STATUS_CLEAR
* Masked status clear.
*
* NAIBRD_1553_OPCODE_COND_BAD_MESSAGE
* Bad message.
*
* NAIBRD_1553_OPCODE_COND_GOOD_MESSAGE
* Good message.
*
* NAIBRD_1553_OPCODE_COND_NO_RETRY
* No retries.
*
* NAIBRD_1553_OPCODE_COND_1_RETRY
* One retry.
*
* NAIBRD_1553_OPCODE_COND_2_RETRIES
* Two retries.
*
* NAIBRD_1553_OPCODE_COND_ALWAYS
* Always run opcode.
*
* NAIBRD_1553_OPCODE_COND_NEVER
* Never run opcode.
* 
parameter1: (Input) Parameter that may or may not be required, depending on the opcode.
parameter2: (Input) Another parameter that may or may not be required, depending on the opcode.
reserved: (Input) Reserved for future use.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid commandId, wOpcode, condition, dwParameter1 or dwParameter2 is specified
  • NAIBRD_1553_RC_BC_OBJECT_ALREADY_EXISTS when the command identified by commandId already exists
  • NAIBRD_1553_RC_ASYNCHRONOUS_MESSAGE_ERROR when the message specified in a XEQ, XQF or time conditioned message opcode command is asynchronous

◆ naibrd_1553_BcCmdDelete()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcCmdDelete ( int16_t device,
int16_t commandId )

Delete an opcode command.

Parameters
device: (Input) Logical Device Number (0-31).
commandId: (Input) Unique command ID.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid swCommandId is specified
  • NAIBRD_1553_RC_UNDEFINED_NODE when the command identified by swCommandId is not defined
  • NAIBRD_1553_RC_NOT_SUPPORTED when the command identified by swCommandId is still in use

◆ naibrd_1553_BcFrmCreate()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcFrmCreate ( int16_t device,
int16_t frameId,
naibrd_1553_bc_frameType_t frameType,
const int16_t * p_commandIds,
uint16_t commandCount,
uint16_t frameTime,
naibrd_1553_bc_frameoptions_t flags )

Create a BC frame from an array of opcode IDs input by the user.

Parameters
device: (Input) Logical Device Number (0-31).
frameId: (Input) Unique frame ID.
frameType: (Input) Frame type (NAIBRD_1553_BC_FRAME_MAJOR, NAIBRD_1553_BC_FRAME_MINOR).
p_commandIds: (Input) Array of command IDs, each associated with an opcode message.
commandCount: (Input) Number of command IDs in p_CommandIds to be included in the frame.
frameTime: (Input) Time for the frame to complete. Unit is 100 microseconds.
flags: (Input) Special options. Select from the following.
* NAIBRD_1553_BC_FRAME_DEFAULT
* Default frame options.
*
* NAIBRD_1553_BC_MINOR_FRAME_IRQ_DISABLE
* Disable interrupt at the end of frame.
* 
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid swFrameId, wFrameType, commandCount or wFlags is specified
  • NAIBRD_1553_RC_BC_OBJECT_ALREADY_EXISTS when the frame identified by swFrameId already exists
  • NAIBRD_1553_RC_UNDEFINED_COMMAND when the commandID is invalid or not associated with an opcode message
  • NAIBRD_1553_RC_NOT_SUPPORTED when an invalid opcode and parameter combination is specified in a command

◆ naibrd_1553_BcFrmDelete()

NAIBRDFUNC naibrd_1553_t NAIAPI naibrd_1553_BcFrmDelete ( int16_t device,
int16_t frameId )

Delete a BC frame.

Parameters
device: (Input) Logical Device Number (0-31).
frameId: (Input) Unique frame ID.
Returns
  • NAI_SUCCESS when function is completed successfully
  • NAIBRD_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAIBRD_1553_RC_INVALID_MODE when device mode is not set to BC
  • NAIBRD_1553_RC_INVALID_STATE when device is in an invalid state
  • NAIBRD_1553_RC_INVALID_PARAMETER when an invalid swFrameId is specified
  • NAIBRD_1553_RC_UNDEFINED_NODE when the frame identified by swFrameId is not defined
  • NAIBRD_1553_RC_NOT_SUPPORTED when the frame identified by swFrameId is still in use