Software Library API naibrd 1.62
See all documentation at naii.docs.com
1553 IP Core Functions

Functions

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_Initialize (int16_t swDevice, uint16_t wAccess, uint16_t wMode, uint32_t dwSizeOfAllocatedMemory, uint32_t dwRegistersAddress, uint32_t dwMemoryAddress)
 Initializes hardware resources such as memory and register space for a particular mode of operation.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_Free (int16_t swDevice)
 Frees all resources used by the hardware based on the type of access used.
 
NAIBRDFUNC uint16_t NAIAPI naibrd_1553_ReadReg (int16_t swDevice, uint32_t wRegisterAddress)
 Reads a register on the device at the specified memory location.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteReg (int16_t swDevice, uint32_t wRegisterAddress, uint16_t wRegisterValue)
 Writes to the specified register location.
 
NAIBRDFUNC uint16_t NAIAPI naibrd_1553_ReadAuxReg (int16_t swDevice, uint32_t wAuxRegisterAddress)
 Reads an Auxiliary register on the device at the specified memory location.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteAuxReg (int16_t swDevice, uint32_t wAuxRegisterAddress, uint16_t wAuxRegisterValue)
 Writes to the specified auxiliary register location.
 
NAIBRDFUNC uint32_t NAIAPI naibrd_1553_ReadIntReg (int16_t swDevice, uint32_t wIntRegisterAddress)
 Reads an Interrupt register on the device at the specified memory location.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteIntReg (int16_t swDevice, uint32_t wIntRegisterAddress, uint32_t wIntRegisterValue)
 Writes to the specified interrupt register location.
 
NAIBRDFUNC uint16_t NAIAPI naibrd_1553_ReadMem (int16_t swDevice, uint32_t wDeviceMemoryAddress)
 Reads a memory location.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteMem (int16_t swDevice, uint32_t wDeviceMemoryAddress, uint16_t wDeviceMemoryValue)
 Writes to the specified memory location.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ReadMemMultiple (int16_t swDevice, uint32_t wDeviceMemoryAddress, uint16_t wBufferSize, uint16_t *wapBuffer)
 Reads from a block of core memory starting from the specified memory location. This function is only supported in the assisted module.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteMemMultiple (int16_t swDevice, uint32_t wDeviceMemoryAddress, uint16_t wBufferSize, uint16_t *wapBuffer)
 Writes to a block of core memory starting from the specified memory location. This function is only supported in the assisted module.
 
NAIBRDFUNC char_t *NAIAPI naibrd_1553_GetBlockStatusWordErrorString (uint16_t wMode, uint16_t wBlockStatus)
 Build and return a string in which the designated errors are textually reported. If no error is designated, a null string is returned.
 
NAIBRDFUNC char_t *NAIAPI naibrd_1553_GetMessageTypeString (uint16_t wMessageType)
 Build and return a text string describing given message type.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetTimeTag (int16_t swDevice, uint16_t wTimeTag)
 Sets the value of the time tag register. NOTE: For FTJ/FTK modules, the device must be initialized as BC, RT or MT prior to calling this function. Otherwise, an error is returned.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_GetTimeTag (int16_t swDevice, uint16_t *wpTimeTag)
 Gets the value of the time tag register. NOTE: For FTJ/FTK modules, the device must be initialized as BC, RT or MT prior to calling this function. Otherwise, an error is returned.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ResetTimeTag (int16_t swDevice)
 Resets the value of the time tag register. NOTE: For FTJ/FTK modules, the device must be initialized as BC, RT or MT prior to calling this function. Otherwise, an error is returned.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetTimeTagResolution (int16_t swDevice, uint16_t wTimeTagResolution)
 Sets the time tag resolution of the device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ConfigureOperationalStatistics (int16_t swDevice, uint16_t bIsOperationalStatisticsCollected)
 Configure whether operational statistics shall be collected for given device. These operational statistics include GPQ fullness statistics. NOTE: This function is currently not supported for FTJ/FTK modules. Note: Collected operational statistics isn't reset in case operational statistics collection is turned on/off. Collected operational statistics simply aren't updated while collection is off.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetIrqConfig (int16_t swDevice, uint16_t wInterruptMode, uint16_t wAutoClear)
 Sets the type of interrupt signal to be generated by the device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetIrqManipulate (int16_t swDevice, uint16_t bIsInterruptEnabled, uint32_t dwIrqMask, void(*funcpExternalIsr)(void *param, uint32_t vector))
 Enables the interrupt conditions specified by the interrupt mask. NOTE: This function is not supported for FTJ/FTK modules. Please use naibrd_1760_SetIrqManipulate instead.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetInterruptSteering (int16_t swDevice, naibrd_int_steering_t steering)
 Sets the Interrupt Steering which indicates the interrupt direction for the 1553 device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetIntVector (int16_t swDevice, int32_t intvector)
 Set the interrupt vector for 1553 device.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_GetIntStatus (int16_t swDevice, uint16_t *status1, uint16_t *status2)
 Reads the interrupt status registers #1 and #2. NOTE: This function is not supported for FTJ/FTK modules. Please use naibrd_1760_GetIntStatus instead.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ClearIntLatch (int16_t swDevice)
 Clears the interrupt latch register. When an interrupt is generated by the core, bit 0 of the latch register is set high. This must be cleared by writing a '1' to the bit in order to receive more interrupts.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetClockFrequency (int16_t swDevice, uint16_t wClockFrequency)
 Sets the hardware clock input frequency. This function has no effect in the FTx module. NOTE: This function is not supported in FTJ/FTK modules.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetResponseTimeout (int16_t swDevice, uint16_t wResponseTimeout)
 Sets the RT response timeout timer.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ConfigureWatchdogTimeout (int16_t swDevice, uint16_t bIsWatchdogEnabled, uint16_t wWatchdogTimeout)
 Configure the watchdog timeout for given device, that is, either enable and set it to given timeout, or disable it, as requested.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetDecoderConfig (int16_t swDevice, uint16_t wDecodedInput, uint16_t wExpendedXingOption)
 Configure the Manchester-II decoder. NOTE: This function is not supported in FTJ/FTK modules.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetRamParityCheck (int16_t swDevice, uint16_t wRamParityCheckEnabler)
 Enable or disable RAM parity checking. NOTE: This function is not supported in FTJ/FTK modules.
 
NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_InternalLoopback (int32_t cardIndex, int32_t module, int32_t channel, bool_t *busAPassed, bool_t *busBPassed)
 Execute internal loopback test. This may be useful for startup BIT to verify transceiver and other hardware capabilities. If this test is to be executed on a particular channel, this function should be called prior to naibrd_1553_Open().
 

Detailed Description


Function Documentation

◆ naibrd_1553_ClearIntLatch()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ClearIntLatch ( int16_t swDevice)

Clears the interrupt latch register. When an interrupt is generated by the core, bit 0 of the latch register is set high. This must be cleared by writing a '1' to the bit in order to receive more interrupts.

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_OPERATION_FAIL when the latch bit failed to clear

◆ naibrd_1553_ConfigureOperationalStatistics()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ConfigureOperationalStatistics ( int16_t swDevice,
uint16_t bIsOperationalStatisticsCollected )

Configure whether operational statistics shall be collected for given device. These operational statistics include GPQ fullness statistics. NOTE: This function is currently not supported for FTJ/FTK modules. Note: Collected operational statistics isn't reset in case operational statistics collection is turned on/off. Collected operational statistics simply aren't updated while collection is off.

Equivalent DDC definition: aceSetMetrics

Parameters
swDevice: (Input) Logical Device Number (0-31).
bIsOperationalStatisticsCollected: (Input) A flag that says whether operational statistics should be collected with this device.
Returns
  • NAI_SUCCESS when function is successfully completed
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state

◆ naibrd_1553_ConfigureWatchdogTimeout()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ConfigureWatchdogTimeout ( int16_t swDevice,
uint16_t bIsWatchdogEnabled,
uint16_t wWatchdogTimeout )

Configure the watchdog timeout for given device, that is, either enable and set it to given timeout, or disable it, as requested.

Parameters
swDevice: (Input) Logical Device Number (0-31).
bIsWatchdogEnabled: (Input) A flag that says if the watchdog should be enabled or not.
wWatchdogTimeout: (Input) The watchdog timeout (in units of 100us) to set for given device.
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when value of wResponseTimeout is invalid

◆ naibrd_1553_Free()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_Free ( int16_t swDevice)

Frees all resources used by the hardware based on the type of access used.

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_SUCCESS when the device has been freed successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input

◆ naibrd_1553_GetBlockStatusWordErrorString()

NAIBRDFUNC char_t *NAIAPI naibrd_1553_GetBlockStatusWordErrorString ( uint16_t wMode,
uint16_t wBlockStatus )

Build and return a string in which the designated errors are textually reported. If no error is designated, a null string is returned.

Note:

  • Block status word errors are relevant only with modes BC, RT, and MT, and the interpretation of errors is mode-dependent.
  • This function returns the same error string as the DDC library, though without the redundant trailing space, in order to stay compatible with DDC.
  • This function returns a pointer to a static string and not to a dynamically allocated string or a user supplied string only in order to stay compatible with DDC. This behavior isn't thread safe, and in case thread-1 calls this function right after thread-0, the string that has been originally returned to thread-0 is principally changed.

Equivalent DDC definition: aceGetBSWErrString

Parameters
wMode: (Input) Operation mode.
wBlockStatus(Input) A block status word that typically designates one or more errors.
Returns
  • Pointer to an error string, or null string if no error.

◆ naibrd_1553_GetIntStatus()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_GetIntStatus ( int16_t swDevice,
uint16_t * status1,
uint16_t * status2 )

Reads the interrupt status registers #1 and #2. NOTE: This function is not supported for FTJ/FTK modules. Please use naibrd_1760_GetIntStatus instead.

Parameters
swDevice: (Input) Logical Device Number (0-31).
status1: (Output) Interrupt Status Register #1. This value will be an OR'ed combination of the following:
NAI_1553_INT_REG1_MASK_END_OF_MESSAGE
Bit 0. End of message (BC, RT and MT).
NAI_1553_INT_REG1_MASK_BC_STATUS_SET
Bit 1. RT status received with incorrect RT address.
NAI_1553_INT_REG1_MASK_RT_MODE_CODE
Bit 1. Mode code message received.
NAI_1553_INT_REG1_MASK_MT_PATTERN_TRIGGER
Bit 1. Pattern Trigger interrupt if command word matches bit pattern in
the Monitor Trigger Register.
NAI_1553_INT_REG1_MASK_FORMAT_ERROR
Bit 2. Loop test failure or message error.
NAI_1553_INT_REG1_MASK_BC_END_OF_FRAME
Bit 3. In non-enhanced BC mode, end of message frame.
NAI_1553_INT_REG1_MASK_BC_END_OF_MESSAGE
Bit 4. BC end of message.
NAI_1553_INT_REG1_MASK_RT_SUBADDRESS_END_OF_MESSAGE
Bit 4. RT subaddress end of message.
NAI_1553_INT_REG1_MASK_RT_CIRCULAR_BUFFER_ROLLOVER
Bit 5. RT circular buffer rollover.
NAI_1553_INT_REG1_MASK_TIME_TAG_ROLLOVER
Bit 6. Time tag register rollover.
NAI_1553_INT_REG1_MASK_RT_ADDRESS_PARITY_ERROR
Bit 7. RT address parity error.
NAI_1553_INT_REG1_MASK_BC_RETRY
Bit 8. BC message retry.
NAI_1553_INT_REG1_MASK_HANDSHAKE_FAILURE
Bit 9. Handshake timeout.
NAI_1553_INT_REG1_MASK_MT_DATA_STACK_ROLLOVER
Bit 10. Data stack rollover.
NAI_1553_INT_REG1_MASK_MT_COMMAND_STACK_ROLLOVER
Bit 11. MT command stack rollover.
NAI_1553_INT_REG1_MASK_BC_RT_COMMAND_STACK_ROLLOVER
Bit 12. BC/RT command stack rollover.
NAI_1553_INT_REG1_MASK_BC_RT_TRANSMITTER_TIMEOUT
Bit 13. BC/RT Tx timeout.
NAI_1553_INT_REG1_MASK_RAM_PARITY_ERROR
Bit 14. RAM parity error.
NAI_1553_INT_REG1_MASK_MASTER_INTERRUPT
Bit 15. Master Interrupt (Indicates pending hardware interrupt).
status2: (Output) Interrupt Status Register #2. This value will be an OR'ed combination of the following:
NAI_1553_INT_REG2_MASK_INTERRUPT_CHAIN
Bit 0. Indicates Interrupt Register #1 is requesting interrupt.
NAI_1553_INT_REG2_MASK_BUILT_IN_TEST_COMPLETE
Bit 1. Built in test complete.
NAI_1553_INT_REG2_MASK_BC_IRQ0
Bit 2. BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_BC_IRQ1
Bit 3. BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_BC_IRQ2
Bit 4. BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_BC_IRQ3
Bit 5. BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_MT_DATA_STACK_HALF_ROLLOVER
Bit 6. MT data stack 50% full.
NAI_1553_INT_REG2_MASK_MT_COMMAND_STACK_HALF_ROLLOVER
Bit 7. MT command stack 50% full.
NAI_1553_INT_REG2_MASK_RT_CIRCULAR_BUFFER_HALF_ROLLOVER
Bit 8. RT circular buffer rollover.
NAI_1553_INT_REG2_MASK_RT_COMMAND_STACK_HALF_ROLLOVER
Bit 9. RT command stack rollover.
NAI_1553_INT_REG2_MASK_BC_TRAP
Bit 10. BC trap - illegal opcode or watchdog timeout.
NAI_1553_INT_REG2_MASK_BC_CALL_STACK_ERROR
Bit 11. BC call stack overflow/underflow error.
NAI_1553_INT_REG2_MASK_GPQ_ISQ_ROLLOVER
Bit 12. BC GPQ rollover/RT ISQ rollover.
NAI_1553_INT_REG2_MASK_RT_ILLEGAL_COMMAND
Bit 13. RT received illegal message.
NAI_1553_INT_REG2_MASK_BC_OPCODE_PARITY_ERROR
Bit 14. BC instruction opcode parity error.
NAI_1553_INT_REG2_MASK_MASTER_INTERRUPT
Bit 15. Master Interrupt (Indicates pending hardware interrupt).
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_1553_GetMessageTypeString()

NAIBRDFUNC char_t *NAIAPI naibrd_1553_GetMessageTypeString ( uint16_t wMessageType)

Build and return a text string describing given message type.

Note:

  • This function returns a pointer to a static string and not to a dynamically allocated string or a user supplied string only in order to stay compatible with DDC. This behavior isn't thread safe, and in case thread-1 calls this function right after thread-0, the string that has been originally returned to thread-0 is principally changed.

Equivalent DDC definition: aceGetMsgTypeString

Parameters
wMessageType: (Input) Message Type.
Returns
  • Pointer to an error string, or null string if no error.

◆ naibrd_1553_GetTimeTag()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_GetTimeTag ( int16_t swDevice,
uint16_t * wpTimeTag )

Gets the value of the time tag register. NOTE: For FTJ/FTK modules, the device must be initialized as BC, RT or MT prior to calling this function. Otherwise, an error is returned.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wpTimeTag: (Output) Time Tag Value.
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_ERROR_INVALID_MODE if the device is not initialized (FTJ/FTK only)

◆ naibrd_1553_Initialize()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_Initialize ( int16_t swDevice,
uint16_t wAccess,
uint16_t wMode,
uint32_t dwSizeOfAllocatedMemory,
uint32_t dwRegistersAddress,
uint32_t dwMemoryAddress )

Initializes hardware resources such as memory and register space for a particular mode of operation.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wAccess: (Input) Specifies the type of access to be used by the device (NAI_1553_ACCESS_CARD, NAI_1553_ACCESS_SIM, NAI_1553_ACCESS_USR).
wMode: (Input) Specifies the mode of operation that the device is to be initialized to.
NAI_1553_MODE_BC
Sets up the device to run as a bus controller
NAI_1553_MODE_RT
Sets up the device to run as a remote terminal
NAI_1553_MODE_MT
Sets up the device to run as a monitor
NAI_1553_MODE_RTMT
Sets up the device to run in combination remote terminal and
monitor mode
To enable retrieval of messages via the 1553 Message FIFO, the wMode should be OR'ed with NAI_1553_MESSAGE_FIFO_MODE. When this mode is enabled, the following functions are disabled: naibrd_1553_BcGetMessageByIdRaw naibrd_1553_BcMessageGetByIdDecoded naibrd_1553_RtMessageGetFromStackRaw naibrd_1553_RtMessageGetFromStackDecoded naibrd_1553_MtMessageGetFromStackRaw naibrd_1553_MtMessageGetFromStackDecoded
dwSizeOfAllocatedMemory: (Input) Unused.
dwRegistersAddress: (Input) Unused.
dwMemoryAddress: (Input) Unused.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_ACCESS when the access type specified is invalid
  • NAI_1553_RC_INVALID_MODE when the mode of operation selected is invalid
  • NAI_1553_RC_INVALID_MODE_OPTIONS when the mode options selected are invalid

◆ naibrd_1553_InternalLoopback()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_InternalLoopback ( int32_t cardIndex,
int32_t module,
int32_t channel,
bool_t * busAPassed,
bool_t * busBPassed )

Execute internal loopback test. This may be useful for startup BIT to verify transceiver and other hardware capabilities. If this test is to be executed on a particular channel, this function should be called prior to naibrd_1553_Open().

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]).
busAPassed: (Output) Bus A Loopback Test Result: Pass = TRUE (1), Fail = FALSE (0).
busBPassed: (Output) Bus B Loopback Test Result: Pass = TRUE (1), Fail = FALSE (0).
Returns
  • NAI_SUCCESS
  • NAI_ERROR_INVALID_CARD when invalid card parameter is specified.
  • NAI_ERROR_INVALID_MODULE when invalid module parameter is specified.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter is specified.
  • NAI_ERROR_INVALID_VALUE when busAPassed or busBPassed are null.
  • NAI_ERROR_NOT_SUPPORTED when this function is not supported.

◆ naibrd_1553_ReadAuxReg()

NAIBRDFUNC uint16_t NAIAPI naibrd_1553_ReadAuxReg ( int16_t swDevice,
uint32_t wAuxRegisterAddress )

Reads an Auxiliary register on the device at the specified memory location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wAuxRegisterAddress(Input) Specifies the register address to be read (0-15).
Returns
Contents of the register that was read.

◆ naibrd_1553_ReadIntReg()

NAIBRDFUNC uint32_t NAIAPI naibrd_1553_ReadIntReg ( int16_t swDevice,
uint32_t wIntRegisterAddress )

Reads an Interrupt register on the device at the specified memory location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wIntRegisterAddress(Input) Specifies the register address to be read (0-3).
Returns
Contents of the register that was read.

◆ naibrd_1553_ReadMem()

NAIBRDFUNC uint16_t NAIAPI naibrd_1553_ReadMem ( int16_t swDevice,
uint32_t wDeviceMemoryAddress )

Reads a memory location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wDeviceMemoryAddress(Input) Specifies the the memory location to read.
Returns
Contents of the memory location that was read.

◆ naibrd_1553_ReadMemMultiple()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ReadMemMultiple ( int16_t swDevice,
uint32_t wDeviceMemoryAddress,
uint16_t wBufferSize,
uint16_t * wapBuffer )

Reads from a block of core memory starting from the specified memory location. This function is only supported in the assisted module.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wDeviceMemoryAddress(Input) Specifies the starting core memory location to read from.
wBufferSize(Input) Specifies the size of the data block to write. Maximum size supported is 512.
wapBuffer(Output) Output array containing read data. The array size must be greater than or equal to wBufferSize.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_ERROR_NOT_SUPPORTED when the function is not supported by this device
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_PARAMETER when invalid wBufferSize is specified
  • NAI_1553_RC_INVALID_ADDRESS when one or all of the addresses specified in wDeviceMemoryAddress is invalid

◆ naibrd_1553_ReadReg()

NAIBRDFUNC uint16_t NAIAPI naibrd_1553_ReadReg ( int16_t swDevice,
uint32_t wRegisterAddress )

Reads a register on the device at the specified memory location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wRegisterAddress(Input) Specifies the register address to be read (0-63).
Returns
Contents of the register that was read.

◆ naibrd_1553_ResetTimeTag()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_ResetTimeTag ( int16_t swDevice)

Resets the value of the time tag register. NOTE: For FTJ/FTK modules, the device must be initialized as BC, RT or MT prior to calling this function. Otherwise, an error is returned.

Parameters
swDevice: (Input) Logical Device Number (0-31).
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_ERROR_INVALID_MODE if the device is not initialized (FTJ/FTK only)

◆ naibrd_1553_SetClockFrequency()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetClockFrequency ( int16_t swDevice,
uint16_t wClockFrequency )

Sets the hardware clock input frequency. This function has no effect in the FTx module. NOTE: This function is not supported in FTJ/FTK modules.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wClockFrequency: (Input) Clock Frequency to set (NAI_1553_CLOCK_16MHZ, NAI_1553_CLOCK_12MHZ, NAI_1553_CLOCK_20MHZ, NAI_1553_CLOCK_10MHZ).
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_NOT_SUPPORTED when device is not in advanced mode
  • NAI_1553_RC_INVALID_CLOCK_FREQUENCY when value of wClockFrequency is invalid
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_1553_SetDecoderConfig()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetDecoderConfig ( int16_t swDevice,
uint16_t wDecodedInput,
uint16_t wExpendedXingOption )

Configure the Manchester-II decoder. NOTE: This function is not supported in FTJ/FTK modules.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wDecodedInput: (Input) Select Input Type (NAI_1553_INPUT_SINGLE_ENDED, NAI_1553_INPUT_DOUBLE_ENDED).
wExpendedXingOption: (Input) Select Sampling Method (NAI_1553_EXPANDED_XING_DISABLE, NAI_1553_EXPANDED_XING_ENABLE).
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_NOT_SUPPORTED when device is not in advanced mode
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_1553_SetInterruptSteering()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetInterruptSteering ( int16_t swDevice,
naibrd_int_steering_t steering )

Sets the Interrupt Steering which indicates the interrupt direction for the 1553 device.

Parameters
swDevice: (Input) Logical Device Number (0-31).
steering: (Input) Interrupt Steering: refer to naibrd_int_steering_t definition.
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_1553_SetIntVector()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetIntVector ( int16_t swDevice,
int32_t intvector )

Set the interrupt vector for 1553 device.

Parameters
swDevice: (Input) Logical Device Number (0-31).
intvector: (Input) Interrupt vector.
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_1553_SetIrqConfig()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetIrqConfig ( int16_t swDevice,
uint16_t wInterruptMode,
uint16_t wAutoClear )

Sets the type of interrupt signal to be generated by the device.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wInterruptMode: (Input) Interrupt Operation Mode Select (NAI_1553_IRQ_MODE_LEVEL, NAI_1553_IRQ_MODE_PULSE).
wAutoClear: (Input) Register Read and Clear Operation Mode Select (NAI_1553_IRQ_AUTO_CLEAR, NAI_1553_IRQ_NO_AUTO_CLEAR).
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when wInterruptMode and/or wAutoClear inputs are invalid

◆ naibrd_1553_SetIrqManipulate()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetIrqManipulate ( int16_t swDevice,
uint16_t bIsInterruptEnabled,
uint32_t dwIrqMask,
void(* funcpExternalIsr )(void *param, uint32_t vector) )

Enables the interrupt conditions specified by the interrupt mask. NOTE: This function is not supported for FTJ/FTK modules. Please use naibrd_1760_SetIrqManipulate instead.

Parameters
swDevice: (Input) Logical Device Number (0-31).
bIsInterruptEnabled: (Input) Enable or disable interrupts.
dwIrqMask: (Input) Bit mask to set the desired interrupt bits in the interrupt registers. The following bit masks, which correspond to a bit in the interrupt registers 1 and 2, may be logically OR'ed together to enable or disable multiple interrupt conditions.
NAI_1553_INT_REG1_MASK_END_OF_MESSAGE
End of message (BC, RT and MT).
NAI_1553_INT_REG1_MASK_BC_STATUS_SET
RT status received with incorrect RT address.
NAI_1553_INT_REG1_MASK_RT_MODE_CODE
Mode code message received.
NAI_1553_INT_REG1_MASK_MT_PATTERN_TRIGGER
Pattern Trigger interrupt if command word matches bit pattern in
the Monitor Trigger Register.
NAI_1553_INT_REG1_MASK_FORMAT_ERROR
Loop test failure or message error.
NAI_1553_INT_REG1_MASK_BC_END_OF_FRAME
In non-enhanced BC mode, end of message frame.
NAI_1553_INT_REG1_MASK_BC_END_OF_MESSAGE
BC end of message.
NAI_1553_INT_REG1_MASK_RT_SUBADDRESS_END_OF_MESSAGE
RT subaddress end of message.
NAI_1553_INT_REG1_MASK_RT_CIRCULAR_BUFFER_ROLLOVER
RT circular buffer rollover.
NAI_1553_INT_REG1_MASK_TIME_TAG_ROLLOVER
Time tag register rollover.
NAI_1553_INT_REG1_MASK_RT_ADDRESS_PARITY_ERROR
RT address parity error.
NAI_1553_INT_REG1_MASK_BC_RETRY
BC message retry.
NAI_1553_INT_REG1_MASK_HANDSHAKE_FAILURE
Handshake timeout.
NAI_1553_INT_REG1_MASK_MT_DATA_STACK_ROLLOVER
Data stack rollover.
NAI_1553_INT_REG1_MASK_MT_COMMAND_STACK_ROLLOVER
MT command stack rollover.
NAI_1553_INT_REG1_MASK_BC_RT_COMMAND_STACK_ROLLOVER
BC/RT command stack rollover.
NAI_1553_INT_REG1_MASK_BC_RT_TRANSMITTER_TIMEOUT
BC/RT Tx timeout.
NAI_1553_INT_REG1_MASK_RAM_PARITY_ERROR
RAM parity error.
NAI_1553_INT_REG2_MASK_BUILT_IN_TEST_COMPLETE
Built in test complete.
NAI_1553_INT_REG2_MASK_BC_IRQ0
BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_BC_IRQ1
BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_BC_IRQ2
BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_BC_IRQ3
BC IRQ h/w instruction generated.
NAI_1553_INT_REG2_MASK_MT_DATA_STACK_HALF_ROLLOVER
MT data stack 50% full.
NAI_1553_INT_REG2_MASK_MT_COMMAND_STACK_HALF_ROLLOVER
MT command stack 50% full.
NAI_1553_INT_REG2_MASK_RT_CIRCULAR_BUFFER_HALF_ROLLOVER
RT circular buffer rollover.
NAI_1553_INT_REG2_MASK_RT_COMMAND_STACK_HALF_ROLLOVER
RT command stack rollover.
NAI_1553_INT_REG2_MASK_BC_TRAP
BC trap - illegal opcode or watchdog timeout.
NAI_1553_INT_REG2_MASK_BC_CALL_STACK_ERROR
BC call stack overflow/underflow error.
NAI_1553_INT_REG2_MASK_GPQ_ISQ_ROLLOVER
BC GPQ rollover/RT ISQ rollover.
NAI_1553_INT_REG2_MASK_RT_ILLEGAL_COMMAND
RT received illegal message.
NAI_1553_INT_REG2_MASK_BC_OPCODE_PARITY_ERROR
BC instruction opcode parity error.
funcpExternalIsr: (Input) The ISR callback function to be called when the device generates an interrupt.
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state

◆ naibrd_1553_SetRamParityCheck()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetRamParityCheck ( int16_t swDevice,
uint16_t wRamParityCheckEnabler )

Enable or disable RAM parity checking. NOTE: This function is not supported in FTJ/FTK modules.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wRamParityCheckEnabler: (Input) Select RAM Checking Operation (NAI_1553_PARITY_CHECK_ENABLE, NAI_1553_PARITY_CHECK_DISABLE).
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_1553_SetResponseTimeout()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetResponseTimeout ( int16_t swDevice,
uint16_t wResponseTimeout )

Sets the RT response timeout timer.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wResponseTimeout: (Input) Message RT Response Timeout
FT[1-9] module:
NAI_1553_RESP_TIMEOUT_18US
BC Response timeout of 18.5us

NAI_1553_RESP_TIMEOUT_22US
BC Response timeout of 22.5us

NAI_1553_RESP_TIMEOUT_50US
BC Response timeout of 50.5us

NAI_1553_RESP_TIMEOUT_130US
BC Response timeout of 130us
FTJ/FTK module:
NAI_1760_BC_RESP_TIMEOUT_17US
BC Response timeout of 17.0us

NAI_1760_BC_RESP_TIMEOUT_22US
BC Response timeout of 22.0us

NAI_1760_BC_RESP_TIMEOUT_60US
BC Response timeout of 60.0us

NAI_1760_BC_RESP_TIMEOUT_140US
BC Response timeout of 140.0us

NAI_1760_BC_RTRT_RESP_TIMEOUT_60US
BC RT-RT Response timeout of 60.0us

NAI_1760_BC_RTRT_RESP_TIMEOUT_65US
BC RT-RT Response timeout of 65.0us

NAI_1760_BC_RTRT_RESP_TIMEOUT_100US
BC RT-RT Response timeout of 100.0us

NAI_1760_BC_RTRT_RESP_TIMEOUT_180US
BC RT-RT Response timeout of 180.0us

NAI_1760_MT_RESP_TIMEOUT_18US
MT Response timeout of 18.0us

NAI_1760_MT_RESP_TIMEOUT_23US
MT Response timeout of 23.0us

NAI_1760_MT_RESP_TIMEOUT_82US
MT Response timeout of 82.0us

NAI_1760_MT_RESP_TIMEOUT_140US
MT Response timeout of 140.0us

NAI_1760_MT_RTRT_RESP_TIMEOUT_61US
MT RT-RT Response timeout of 61.0us

NAI_1760_MT_RTRT_RESP_TIMEOUT_66US
MT RT-RT Response timeout of 66.0us

NAI_1760_MT_RTRT_RESP_TIMEOUT_122US
MT RT-RT Response timeout of 122.0us

NAI_1760_MT_RTRT_RESP_TIMEOUT_180US
MT RT-RT Response timeout of 180.0us

NAI_1760_RT_RTRT_RESP_TIMEOUT_57US
RT RT-RT Response timeout of 57.0us

NAI_1760_RT_RTRT_RESP_TIMEOUT_62US
RT RT-RT Response timeout of 62.0us

NAI_1760_RT_RTRT_RESP_TIMEOUT_100US
RT RT-RT Response timeout of 100.0us

NAI_1760_RT_RTRT_RESP_TIMEOUT_180US
RT RT-RT Response timeout of 180.0us
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_PARAMETER when value of wResponseTimeout is invalid

◆ naibrd_1553_SetTimeTag()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetTimeTag ( int16_t swDevice,
uint16_t wTimeTag )

Sets the value of the time tag register. NOTE: For FTJ/FTK modules, the device must be initialized as BC, RT or MT prior to calling this function. Otherwise, an error is returned.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wTimeTag: (Input) Time Tag Value (0x0000-0xFFFF).
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_ERROR_INVALID_MODE if the device is not initialized (FTJ/FTK only)

◆ naibrd_1553_SetTimeTagResolution()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_SetTimeTagResolution ( int16_t swDevice,
uint16_t wTimeTagResolution )

Sets the time tag resolution of the device.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wTimeTagResolution: (Input) Time Tag Resolution.
NAI_1553_TIME_TAG_2US
2 uS resolution
NAI_1553_TIME_TAG_4US
4 uS resolution
NAI_1553_TIME_TAG_8US
8 uS resolution
NAI_1553_TIME_TAG_16US
16 uS resolution
NAI_1553_TIME_TAG_32US
32 uS resolution
NAI_1553_TIME_TAG_64US
64 uS resolution
NAI_1553_TIME_TAG_TEST
Increment manually
NAI_1553_TIME_TAG_EXTERNAL_CLOCK
Use External Clock
Returns
  • NAI_SUCCESS
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_TIME_TAG_RESOLUTION when wTimeTagResolution input is invalid

◆ naibrd_1553_WriteAuxReg()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteAuxReg ( int16_t swDevice,
uint32_t wAuxRegisterAddress,
uint16_t wAuxRegisterValue )

Writes to the specified auxiliary register location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wAuxRegisterAddress(Input) Specifies the auxiliary register address to be read (0-15).
wAuxRegisterValue(Input) Value to be written to the auxiliary register.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_ADDRESS when one or all of the addresses specified in wAuxRegisterAddress is invalid

◆ naibrd_1553_WriteIntReg()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteIntReg ( int16_t swDevice,
uint32_t wIntRegisterAddress,
uint32_t wIntRegisterValue )

Writes to the specified interrupt register location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wIntRegisterAddress(Input) Specifies the interrupt register address to write (0-3).
wIntRegisterValue(Input) Value to be written to the interrupt register.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_ADDRESS when one or all of the addresses specified in wIntRegisterAddress is invalid

◆ naibrd_1553_WriteMem()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteMem ( int16_t swDevice,
uint32_t wDeviceMemoryAddress,
uint16_t wDeviceMemoryValue )

Writes to the specified memory location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wDeviceMemoryAddress(Input) Specifies the the memory location to write to.
wDeviceMemoryValue(Input) Value to be written.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_ADDRESS when one or all of the addresses specified in wDeviceMemoryAddress is invalid

◆ naibrd_1553_WriteMemMultiple()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteMemMultiple ( int16_t swDevice,
uint32_t wDeviceMemoryAddress,
uint16_t wBufferSize,
uint16_t * wapBuffer )

Writes to a block of core memory starting from the specified memory location. This function is only supported in the assisted module.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wDeviceMemoryAddress(Input) Specifies the starting core memory location to write a block of data.
wBufferSize(Input) Specifies the size of the data block to write. Maximum size supported is 512.
wapBuffer(Input) Input array containing the data to write. The array size must be greater than or equal to wBufferSize.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_ERROR_NOT_SUPPORTED when the function is not supported by this device
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_PARAMETER when invalid wBufferSize is specified
  • NAI_1553_RC_INVALID_ADDRESS when one or all of the addresses specified in wDeviceMemoryAddress is invalid

◆ naibrd_1553_WriteReg()

NAIBRDFUNC nai_1553_t NAIAPI naibrd_1553_WriteReg ( int16_t swDevice,
uint32_t wRegisterAddress,
uint16_t wRegisterValue )

Writes to the specified register location.

Parameters
swDevice: (Input) Logical Device Number (0-31).
wRegisterAddress(Input) Specifies the register address to be read (0-63).
wRegisterValue(Input) Value to be written to the register.
Returns
  • NAI_SUCCESS when the device has been initialized successfully
  • NAI_1553_RC_INVALID_DEVICE_NUMBER when incorrect device number was input
  • NAI_1553_RC_INVALID_STATE when device is in an invalid state
  • NAI_1553_RC_INVALID_ADDRESS when one or all of the addresses specified in wRegisterAddress is invalid