Software Library API naibrd 1.62
See all documentation at naii.docs.com
naibrd_ds.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "functions/naibrd_ds.h"
#include "maps/nai_map_ds.h"
#include "naibrd_config.h"
#include "functions/naibrd_ds_util.h"
#include "naibrd_ether.h"
#include "naibrd.h"
#include "boards/naibrd_gen5.h"

Functions

NAIBRDFUNC int32_t NAIAPI naibrd_DS_GetChannelCount (uint32_t modid)
 Returns the number of channels for the specified D/S Module based on its module id.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetAngle (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_angle_info_type_t type, float64_t inAngle)
 Sets various angle properties on a D/S module for a specified channel. Use nai_ds_angle_info_type_t to select the specified angle properties to be written to the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetAngle (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_angle_info_type_t type, float64_t *outAngle)
 Gets various angle properties on a D/S module from a specified channel. Use nai_ds_angle_info_type_t to select the specified angle properties to be read from the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetChanOutputEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t inOutputEnable)
 Sets the output on/off for a specified channel for D/S module. Currently, this function only supports single channel Gen 3 D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetChanOutputEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outOutputEnable)
 Gets the output on/off for a specified channel for D/S module. Currently, this function only supports single channel D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetPowerEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t inPwrEnable)
 Sets the module power state on/off for a specified channel of the D/S module. Currently, only the three channels modules allow power state control for their individual channels. Single and dual channels modules only allow power to their channels be all on or off.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetPowerEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outPowerEnable)
 Gets the module power state on/off for a specified channel of the D/S module. Currently, only the three channels modules allow power state control for their individual channels. Single and dual channels modules only allow power to their channels be all on or off.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetMeasuredValue (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_measured_Info_type_t type, float64_t *outMeasValue)
 Gets internally measured values from the D/S module for their specified channels. Internally measured vlues; such as, angle, reference, output line-to-line voltages, and reference frequency.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetAllWrapAngles (int32_t cardIndex, int32_t module, int32_t arraySize, float64_t *outAngle[])
 Gets all internally measured angles from the D/S module. Use this function for single speed operations only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_status_type_t type, nai_ds_module_status_t *outStatus)
 Gets the module status for a specific channel from the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_ClearStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_status_type_t type)
 Clears latched status for a specific D/S channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetRotationStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_rotation_status_t *outStatus)
 Gets the latch rotation status for a specific channel from the D/S module. For Gen5 D/S module, to unlatch a latched channel, write a one to the bit mask value for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetRealTimeRotationStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_rotation_status_t *outStatus)
 Gets the real time rotation status for a specific channel from the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetRotationEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t inRotEnable)
 Sets the start or stop rotation command for a specified channel in the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetRotationEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outRotEnable)
 Gets the start or stop rotation command for a specified channel in the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetExpectedVoltage (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_expected_voltage_type_t type, float64_t inExpVolt)
 Sets the expected reference and output line-line for a specified channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetExpectedVoltage (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_expected_voltage_type_t type, float64_t *outExpVolt)
 Sets the expected reference and output line-line for a specified channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetThresholdVoltage (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_threshold_voltage_type_t type, float64_t inThresVolt)
 Sets the expected reference and output line-line threshold voltatge for a specified channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetThresholdVoltage (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_threshold_voltage_type_t type, float64_t *outThresVolt)
 Gets the expected reference and output line-line threshold voltatge for a specified channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetThresholdCurrent (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_expected_current_type_t type, float64_t inThresCurrent)
 Sets the output line-line threshold current(RMS) for a specified channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetThresholdCurrent (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_expected_current_type_t type, float64_t *outThresCurrent)
 Gets the output line-line threshold current(RMS) for a specified channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetRatioFixedMode (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_output_ratio_fixed_mode_t inRatioFixMode)
 Sets the D/S channel ratio/fixed mode for a specified D/S channel for the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetRatioFixedMode (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_output_ratio_fixed_mode_t *outRatioFixMode)
 Gets the D/S Ratio/Fixed selection of a specified D/S channel for the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetSynRslMode (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_synchro_resolver_t inSynRslMode)
 Sets the Synchro or Resolver mode for a specified channel for the D/S module. Only mixed mode programming module support this function.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetSynRslMode (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_synchro_resolver_t *outSynRslMode)
 Gets the Synchro or Resolver mode for a specified channel for the D/S module. Only mixed mode programming module support this function.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetActiveChannel (int32_t cardIndex, int32_t module, int32_t channel, bool_t inActiveChan)
 Sets the active channel state for a specified D/S channel for the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetActiveChannel (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outActChanEnable)
 Gets the active channel state for a specified D/S channel for the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetChanStatusEnable (int32_t cardIndex, int32_t module, int32_t channel, uint32_t inSetting)
 Sets the channel status enable/disable for the specified D/S channel for the D/S module. When it is set to disable, ref loss, sig loss, bit fault, and phase loss status will not be updated.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetChanStatusEnable (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *outSetting)
 Gets the channel status enable/disable for the specified D/S channel for the D/S module. When it is set to disable, ref loss, sig loss, bit fault, and phase loss status will not be updated.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetRotationCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_rotation_configuration_type_t type, float64_t inRotationCtrl)
 Sets the Rotation control for a specified D/S channel of a D/S module. Refer to the Operation Manual for information on how to set each rotation control setting.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetRotationCtrl (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_rotation_configuration_type_t type, float64_t *outRotCtrl)
 Gets the Rotation control for a specified D/S channel of a D/S module. Refer to the Operation Manual for information on the rotation control settings.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetMultiSpeedRatio (int32_t cardIndex, int32_t module, nai_ds_multi_speed_chan_pair_type_t chanPairType, uint32_t inMultSpd)
 Sets the D/S multi-speed ratio for a specified D/S channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetMultiSpeedRatio (int32_t cardIndex, int32_t module, nai_ds_multi_speed_chan_pair_type_t chanPairType, uint32_t *outMultSpd)
 Gets the D/S multi-speed ratio for a specified D/S channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetPhaseOffset (int32_t cardIndex, int32_t module, int32_t channel, float64_t inPhase)
 Sets the phase offset of a specified D/S channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetPhaseOffset (int32_t cardIndex, int32_t module, int32_t channel, float64_t *outPhase)
 Gets the phase offset of a specified D/S channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetTorqueRxEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t inEnable)
 Sets the Torque receiver on/off state for a specified channel of a D/S module. Currently, this function is available only in single channel D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetTorqueRxEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *outEnable)
 Gets the Torque receiver on/off state for a specified channel of a D/S module. Currently, this function is available only in single channel D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetWrapIntExt (int32_t cardIndex, int32_t module, uint32_t channel, nai_ds_wrap_int_ext_sel_t inWrapAngleIntExtSelect)
 Sets the measured angle internal/external selection for a specified channel of a D/S module. This function is supported by single channel D/S only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetWrapIntExt (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_wrap_int_ext_sel_t *outWrapIntExt)
 Gets the measured angle internal/external selection for a specified channel of a D/S module. This function is supported by single channel D/S only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetMultiSpeedViaMultiBoard (int32_t multiBoardPairIdx, int32_t coarseCardIdx, int32_t coarseModuleNo, int32_t coarseChan, int32_t fineCardIdx, int32_t fineModuleNo, int32_t fineChan, nai_ds_multSpeedViaMultiBoad_config_type_t dsMSVMBConfigType, float64_t value)
 Set the multi-speed via multi-board propety for the selected D/S channel. This function assigns the coarse and the fine angles for multi-speed operation via the selected channel on two seperate boards.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetTestModeEnable (int32_t cardIndex, int32_t module, nai_ds_test_mode_type_t type, bool_t inEnable)
 Sets the test enable state for on-line(D2), and off-line(D3) test for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetTestModeEnable (int32_t cardIndex, int32_t module, nai_ds_test_mode_type_t type, bool_t *outEnable)
 Gets the test enable state for on-line(D2), and off-line(D3) test for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetTestVerify (int32_t cardIndex, int32_t module, uint32_t inTestVerify)
 Sets the test verify value for for on-line(D2) test for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetTestVerify (int32_t cardIndex, int32_t module, uint32_t *outTestVerify)
 Gets the test verify value for for on-line(D2) test for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetOnBoardRefCtrl (int32_t cardIndex, int32_t module, nai_ds_on_board_ref_type_t type, float64_t inRefCtrl)
 Sets the on board internal reference properties from a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetOnBoardRefCtrl (int32_t cardIndex, int32_t module, nai_ds_on_board_ref_type_t type, float64_t *outRefCtrl)
 Gets the on board internal reference controls from the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetInterruptVector (int32_t cardIndex, int32_t module, nai_ds_interrupt_type_t type, uint32_t inInterruptVector)
 Sets the interrupt vector for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetInterruptVector (int32_t cardIndex, int32_t module, nai_ds_interrupt_type_t type, uint32_t *outIntVector)
 Gets the D/S interrupt vector that is assigned to the its interrupt function in the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_interrupt_type_t type, uint32_t inEnable)
 Sets the D/S interrupt enable state for a specific channel in a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_interrupt_type_t type, uint32_t *outEnable)
 Gets the D/S interrupt enable state for a specific channel in the D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetInterruptSteering (int32_t cardIndex, int32_t module, nai_ds_status_type_t type, naibrd_int_steering_t steering)
 Sets the Interrupt Steering which indicates the interrupt direction for the DS modules. Interrupt steering used for NAI GEN 5 modules and with latched interrupt types.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetInterruptSteering (int32_t cardIndex, int32_t module, nai_ds_status_type_t type, naibrd_int_steering_t *outsteering)
 Gets the Interrupt Steering which indicates the interrupt direction for the DS modules. Interrupt steering used for NAI GEN 5 modules and with latched interrupt types.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetEdgeLevelInterrupt (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_interrupt_type_t type, nai_ds_interruptMode_type_t interruptType)
 Sets the Interrupt Edge/Level mode for the D/S modules. This feature only applies to NAI GEN 5 D/S modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetEdgeLevelInterrupt (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_interrupt_type_t type, nai_ds_interruptMode_type_t *outinterruptType)
 Gets the Interrupt Edge/Level mode for the D/S modules. This feature only applies to NAI GEN 5 D/S modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetRaw (int32_t cardIndex, int32_t module, nai_ds_raw_module_value_type_t type, uint32_t inRawdata)
 Sets the raw data value in the register associated to the register type specified for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetRaw (int32_t cardIndex, int32_t module, nai_ds_raw_module_value_type_t type, uint32_t *outRawData)
 Gets the raw data value in the register associated to the register type specified from a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_raw_channel_value_type_t type, uint32_t inChanRaw)
 Sets the raw data value for a specified channel associated a specified type for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_raw_channel_value_type_t type, uint32_t *outChanRaw)
 Gets the raw data value for a specified channel with a specified type from a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetStatusRaw (int32_t cardIndex, int32_t module, nai_ds_status_type_t type, uint32_t *outStatusRaw)
 Gets the latch raw status value for a specified status type from a D/S module. For Gen 5 modules, to unlatch the latched status, write a one to the latched channel mask position.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_ClearStatusRaw (int32_t cardIndex, int32_t module, nai_ds_status_type_t type, uint32_t rawdata)
 Clears the status data value in the register associated to the group and status type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_SetAdvancedFunction (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_adv_function_type_t type, uint32_t inAdvData)
 Sets advanced function value to a specified channel associated with a specified type for a D/S module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DS_GetAdvancedFunction (int32_t cardIndex, int32_t module, int32_t channel, nai_ds_adv_function_type_t type, float64_t *outAdvData)
 Sets advanced function value to a specified channel associated with a specified type for a D/S module.
 

Variables

naiDsMSVMB naiDsMultiSpdViaMultBoard [MAX_MULTI_SPD_VIA_MULIT_BOARD_COUNT]
 

Variable Documentation

◆ naiDsMultiSpdViaMultBoard

naiDsMSVMB naiDsMultiSpdViaMultBoard[MAX_MULTI_SPD_VIA_MULIT_BOARD_COUNT]