Software Library API naibrd 1.62
See all documentation at naii.docs.com
naibrd_ioct.c File Reference
#include <stdlib.h>
#include "functions/naibrd_ioct.h"
#include "maps/nai_map_ioct.h"
#include "advanced/naibrd_adv.h"
#include "naibrd_config.h"
#include "boards/naibrd_gen5.h"

Functions

NAIBRDFUNC int32_t NAIAPI naibrd_IOCT_GetChannelCount (uint32_t modid)
 Returns the number of channels for the specified IOCT Module ID.
 
NAIBRDFUNC uint32_t NAIAPI naibrd_IOCT_GetFifoSize (uint32_t modid)
 Returns the size of the FIFO buffer for the specified IOCT Module ID.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetFIFOCount (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_fifo_type_t type, uint32_t *outcount)
 Retrieves the FIFO counter registers that indicate the number of data elements in the IOCT channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetRxFIFOData (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, uint32_t outdata[], uint32_t *outread)
 Retrieves data elements from the IOCT channel's Receive FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetTxFIFOData (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, uint32_t data[], uint32_t *outwrite)
 Loads 32-bit data elements in the IOCT channel's Transmit FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_StartTransmit (int32_t cardIndex, int32_t module, int32_t channel)
 Initiates the transmission of the data in the IOCT channel's Transmit FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_status_t *outstatus)
 Retrieves the IOCT channel's status.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetCommand (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_cmd_t command)
 Sets the IOCT channel's command configuration settings.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetCommand (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_cmd_t *outcommand)
 Retrieves the IOCT channel's command configuration settings.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetPermittedXmitSegMap (int32_t cardIndex, int32_t module, int32_t channel, uint32_t segmap)
 Sets the Transmission Segments Map that are permitted for the IOCT channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetPermittedXmitSegMap (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outsegmap)
 Retrieves the Transmission Segments Map that are permitted for the IOCT channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetInvertCommand (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_invert_cmd_t command)
 Sets the IOCT channel's inverted command configuration settings.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetInvertCommand (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_invert_cmd_t *outcommand)
 Retrieves the IOCT channel's inverted command configuration settings.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_group_type_t grouptype, nai_ioct_group_interrupt_t intenable)
 Sets the IOCT Interrupt Enable state for the specified IOCT channel. By default, interrupts are disabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_group_type_t grouptype, nai_ioct_group_interrupt_t *outintenable)
 Retrieves the IOCT Interrupt Enable state for the specified IOCT channel. By default, interrupts are disabled.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetEdgeLevelInterrupt (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_interrupt_t interruptType)
 Sets the Interrupt Edge/Level property for the specified IOCT channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetEdgeLevelInterrupt (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_interrupt_t *outinterruptType)
 Retrieves the Interrupt Edge/Level property for the specified IOCT channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetInterruptVector (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_group_type_t grouptype, uint32_t vector)
 Sets the IOCT Interrupt Vector for the specified IOCT module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetInterruptVector (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_group_type_t grouptype, uint32_t *outvector)
 Retrieves the IOCT Interrupt Vector for the specified IOCT module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetInterruptSteering (int32_t cardIndex, int32_t module, int32_t channel, naibrd_int_steering_t steering)
 Sets the Interrupt Steering which indicates the interrupt direction for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetInterruptSteering (int32_t cardIndex, int32_t module, int32_t channel, naibrd_int_steering_t *outsteering)
 Retrieves the Interrupt Steering which indicates the interrupt direction for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetInterruptStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_group_type_t grouptype, nai_ioct_interrupt_status_type_t type, nai_ioct_group_interrupt_t *outstatus)
 Retrieves the IOCT channel's interrupt status.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_ClearInterruptStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_group_type_t grouptype, nai_ioct_group_interrupt_t intstatus)
 Clears the latched status for the specified IOCT channel and status type. (Applicable for latched status types only)
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetSEPPulse (int32_t cardIndex, int32_t module, int32_t channel, float64_t pulsewidth_ms)
 Sets the IOCT SEP pulse high time for the specified IOCT module. The IOCT SEP pulse high time is user-configurable, with a default of 1.25 msec. The value is set in steps of the internal high-speed clock (11.303 nsec).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetSEPPulse (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outpulsewidth_ms)
 Retrieves the IOCT SEP pulse high time for the specified IOCT module. The IOCT SEP pulse high time is user-configurable, with a default of 1.25 msec. The value is set in steps of the internal high-speed clock (11.303 nsec).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetSEPPulseLowTime (int32_t cardIndex, int32_t module, int32_t channel, float64_t lowtime_ms)
 Sets the IOCT SEP pulse low time for the specified IOCT module. The IOCT SEP pulse low time is user-configurable, with a default of 98.75 msec. The value is set in steps of the internal high-speed clock (11.303 nsec).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetSEPPulseLowTime (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outlowtime_ms)
 Retrieves the IOCT SEP pulse low time for the specified IOCT module. The IOCT SEP pulse low time is user-configurable, with a default of 98.75 msec. The value is set in steps of the internal high-speed clock (11.303 nsec).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetSEPTxWindow (int32_t cardIndex, int32_t module, int32_t channel, float64_t txwindow_ms)
 Sets the window after the triggering edge of the SEP pulse during which a message may be initiated for the specified IOCT module. The IOCT SEP Tx Window is user-configurable, with a default of 340 usec. The value is set in steps of the internal high-speed clock (11.303 nsec).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetSEPTxWindow (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outtxwindow_ms)
 Retrieves the window after the triggering edge of the SEP pulse during which a message may be initiated for the specified IOCT module. The IOCT SEP Tx Window is user-configurable, with a default of 340 usec. The value is set in steps of the internal high-speed clock (11.303 nsec).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetSEPManualMode (int32_t cardIndex, int32_t module, int32_t channel, bool_t enable)
 Sets the manual SEP mode enable bit. When the manual SEP mode is enabled, the SEP may be controlled directly calling the naibrd_IOCT_SetSEPManualState to set the SEP state. As such, control will be limited to the speed of the software, and underlying communication method (Ethernet versus Bus). When loopback testing, the receiver will nominally ignore messages received outside of a specified time window following the SEP edge (2 msec for Master and 500 usec for Slave). The window may be disabled by setting the RX Always bit (IOCT_CMD_RX_ALWAYS) in the Command Register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetSEPManualMode (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outenable)
 Retrieves the manual SEP mode enable bit. When the manual SEP mode is enabled, the SEP may be controlled directly calling the naibrd_IOCT_SetSEPManualState to set the SEP state. As such, control will be limited to the speed of the software, and underlying communication method (Ethernet versus Bus). When loopback testing, the receiver will nominally ignore messages received outside of a specified time window following the SEP edge (2 msec for Master and 500 usec for Slave). The window may be disabled by setting the RX Always bit (IOCT_CMD_RX_ALWAYS) in the Command Register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetSEPManualState (int32_t cardIndex, int32_t module, int32_t channel, uint8_t state)
 Sets the manual SEP state. When the manual SEP mode is enabled, the SEP may be controlled directly calling the naibrd_IOCT_SetSEPManualState to set the SEP state. As such, control will be limited to the speed of the software, and underlying communication method (Ethernet versus Bus). When loopback testing, the receiver will nominally ignore messages received outside of a specified time window following the SEP edge (2 msec for Master and 500 usec for Slave). The window may be disabled by setting the RX Always bit (IOCT_CMD_RX_ALWAYS) in the Command Register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetSEPManualState (int32_t cardIndex, int32_t module, int32_t channel, uint8_t *outstate)
 Retrieves the manual SEP state. When the manual SEP mode is enabled, the SEP may be controlled directly calling the naibrd_IOCT_SetSEPManualState to set the SEP state. As such, control will be limited to the speed of the software, and underlying communication method (Ethernet versus Bus). When loopback testing, the receiver will nominally ignore messages received outside of a specified time window following the SEP edge (2 msec for Master and 500 usec for Slave). The window may be disabled by setting the RX Always bit (IOCT_CMD_RX_ALWAYS) in the Command Register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_channel_raw_t type, uint32_t rawdata)
 Sets the raw data value in the register associated with the channel and channel register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_ioct_channel_raw_t type, uint32_t *outrawdata)
 Retrieves the raw data value in the register associated with the channel and channel register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetTestMode (int32_t cardIndex, int32_t module, nai_ioct_test_cmd_t testmode)
 Sets the test mode for Engineering Testing (available on PE Module only - uses Channel 2 as test points).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetTestMode (int32_t cardIndex, int32_t module, nai_ioct_test_cmd_t *outtestmode)
 Retrieves the test mode for Engineering Testing (available on PE Module only - uses Channel 2 as test points).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetTestPattern (int32_t cardIndex, int32_t module, uint32_t pattern)
 Sets the test pattern for Engineering Testing (available on PE Module only - uses Channel 2 as test points).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetTestPattern (int32_t cardIndex, int32_t module, uint32_t *outpattern)
 Retrieves the test pattern for Engineering Testing (available on PE Module only - uses Channel 2 as test points).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_SetTestRegister (int32_t cardIndex, int32_t module, int32_t testreg, uint32_t testval)
 Sets the value in test register for Engineering Testing (available on PE Module only - uses Channel 2 as test points).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_IOCT_GetTestRegister (int32_t cardIndex, int32_t module, int32_t testreg, uint32_t *outtestval)
 Retrieves the value in test register for Engineering Testing (available on PE Module only - uses Channel 2 as test points).