Software Library API naibrd 1.62
See all documentation at naii.docs.com
naibrd_dt.c File Reference
#include <stdlib.h>
#include "functions/naibrd_modCommon.h"
#include "functions/naibrd_dt.h"
#include "maps/nai_map_modCommon.h"
#include "maps/nai_map_dt.h"
#include "maps/nai_map_ka.h"
#include "maps/nai_map_pdkb.h"
#include "advanced/naibrd_adv.h"
#include "naibrd_config.h"
#include "boards/naibrd_gen5.h"
#include "include_local/functions/naibrd_dt_map_arrays.h"

Macros

#define NAI_DT_MAX_VCC_VOLT   80.0 /* Volt */
 
#define NAI_DT_VCC_LSB_VOLT   0.10 /* Volt (100 mV) */
 
#define NAI_DT_MAX_THRESHOLD_VOLT   80.0 /* Volt */
 
#define NAI_DT_VOLTAGE_LSB_VOLT   0.10 /* Volts (100 mV) */
 
#define NAI_DT_PD_MAX_THRESHOLD_VOLT   30.0 /* Volt */
 
#define NAI_DT_PD_VOLTAGE_LSB_VOLT   0.015 /* Volt (150 mV) */
 
#define NAI_DT_KB_MAX_THRESHOLD_VOLT   30.0 /* Volt */
 
#define NAI_DT_KB_VOLTAGE_LSB_VOLT   0.015 /* Volt (150 mV) */
 
#define NAI_DT_KA_MAX_THRESHOLD_VOLT   40.0 /* Volt */
 
#define NAI_DT_KA_VOLTAGE_LSB_VOLT   0.0098 /* Volt (9.8 mV) */
 
#define NAI_DT_GEN3_CURRENT_LSB_AMP   0.003 /* Amps (3.0 mA) */
 
#define NAI_DT_GEN5_CURRENT_LSB_AMP   0.003 /* Amps (3.0 mA) (was previously defined as 10mA) */
 
#define NAI_DT_MAX_SOURCE_SINK_CURRENT_AMP   0.005 /* Amps (5 mA) */
 
#define NAI_DT_GEN3_SOURCE_SINK_CURRENT_LSB_AMP   0.0001 /* Amps (0.1 mA) */
 
#define NAI_DT_GEN5_SOURCE_SINK_CURRENT_LSB_AMP   0.0001 /* Amps (0.1 mA) */
 
#define NAI_DT_GEN3_MAX_DEBOUNCE_TIME_MSEC   1342.1568 /* msec (1.34 sec) */
 
#define NAI_DT_KA_MAX_DEBOUNCE_TIME_MSEC   167.77000 /* msec (0.1677 sec) */
 
#define NAI_DT_PD_MAX_DEBOUNCE_TIME_MSEC   335.53920 /* msec (0.336 sec)*/
 
#define NAI_DT_KB_MAX_DEBOUNCE_TIME_MSEC   978.65600 /* msec (0.979 sec) */
 
#define NAI_DT_GEN3_DEBOUNCE_TIME_LSB_MSEC   0.0204800 /* msec (20.48 us) */
 
#define NAI_DT_KA_DEBOUNCE_TIME_LSB_MSEC   0.0051200 /* msec (5.12 us) */
 
#define NAI_DT_PD_DEBOUNCE_TIME_LSB_MSEC   0.0051200 /* msec (5.12 us) */
 
#define NAI_DT_KB_DEBOUNCE_TIME_LSB_MSEC   0.0149333 /* msec (14.933 us) */
 
#define NAI_DT_GEN5_DEBOUNCE_LSB_MSEC   0.00844025 /* msec (8.44025us ) Empirical*/
 
#define NAI_DT_GEN5_DEBOUNCE_LSB_MSEC_REV10   0.01000000 /* LSB for mod fpga rev 10.0+ */
 
#define NAI_DT_GEN3_PWM_LSB_MSEC   0.0204800 /* msec (20.48 us) */
 
#define NAI_DT_KA_PWM_LSB_MSEC   0.0010000 /* msec (1 us) */
 
#define NAI_DT_GEN5_TIMER_LSB_MSEC   0.003608 /* msec (3608ns ) Empirical*/
 
#define NAI_DT_GEN5_TIMER_STD_LSB_MSEC   0.010000 /* LSB for mod fpga rev 10.0+ */
 
#define NAI_DT_GEN5_UNLOCK_CALIBRATION_CODE   0xCA11B78Eu /* Calibration Unlock (and defeat Over current) Code */
 
#define NAI_DT_GEN5_WATCHDOG_STATUS_MASK   0x80000000u
 
#define NAI_DT_GEN5_WATCHDOG_STATUS_SHIFT   31
 
#define NAI_DT_GEN5_MB_COMMON_MODULE_NUM   0
 
#define NAI_DT_GEN5_MODULE_POWER_RESET_COUNT   8
 

Enumerations

enum  naibrd_discrete_type {
  NAIBRD_DT_GEN5_MOD_24_CHAN , NAIBRD_DT_GEN5_MOD_24_CHAN_ENHANCED , NAIBRD_DT_GEN5_COMBO_12_CHAN_ENHANCED , NAIBRD_DT_GEN5_INBRD_24_CHAN ,
  NAIBRD_DT_GEN5_INBRD_24_CHAN_ENHANCED , NAIBRD_DT_GEN5_INBRD_COMBO_12_CHAN , NAIBRD_DT_GEN3_MOD_K6 , NAIBRD_DT_GEN3_MOD_K9 ,
  NAIBRD_DT_GEN3_MOD_KA , NAIBRD_DT_GEN3_MOD_KB , NAIBRD_DT_GEN3_MOD_PD , NAIBRD_DT_UNDEFINED
}
 

Functions

NAIBRDFUNC int32_t NAIAPI naibrd_DT_GetChannelCount (uint32_t modid)
 Returns the number of channels for the specified Discrete Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_DT_GetGroupCount (uint32_t modid)
 Returns the number of channel groups for the specified Discrete Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_DT_GetGroupSize (uint32_t modid)
 Returns the number of channel in each group for the specified Discrete Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_DT_GetVCCBankCount (uint32_t modid)
 Returns the number of VCC channel banks for the specified Discrete Module ID.
 
NAIBRDFUNC int32_t NAIAPI naibrd_DT_GetVCCBankSize (uint32_t modid)
 Returns the number of channels in each VCC bank for the specified Discrete Module ID.
 
NAIBRDFUNC float64_t NAIAPI naibrd_DT_GetTimebaseLSB (uint32_t modid)
 Returns the LSB for the timer interval for Measurement, PWM and Pattern Generator clocks for the specified DT Module ID.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetOutputState (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_state_t state)
 Sets the Output State for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetOutputState (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_state_t *p_outstate)
 Retrieves the Output State for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetInputState (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_state_t *p_outstate)
 Retrieves the Input State for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetVoltage (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outvoltage)
 Retrieves the voltage measurement for the specified Discrete channel. Feature only available on newer K6 Ver.4 releases.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetCurrent (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outcurrent)
 Retrieves the current measurement for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetCurrent_mA (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outcurrent_mA)
 Retrieves the current measurement in milliamps for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBankVccVoltage (int32_t cardIndex, int32_t module, int32_t bank, float64_t *p_outvoltage)
 Retrieves the Vcc voltage reading at the input pin for the channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_status_type_t type, nai_status_bit_t *p_outstatusBit)
 Retrieves the status for the specified Discrete channel and status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBitStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_bit_status_type_t type, nai_status_bit_t *p_outstatusBit)
 Retrieves the BIT error trigger type for the specified channel and BIT status error trigger type, when BIT status has been set. A return of 1 indicates the BIT was a result of the queried trigger type (voltage measurement, or driver error).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ClearStatus (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_status_type_t type)
 Clears the latched status for the specified Discrete channel and status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetChanStatusEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t enable)
 Enables/disables status reporting for the specified Discrete channel. Feature supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetChanStatusEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *p_outenable)
 Retrieves the enabled/disabled state of status reporting for the specified Discrete channel. Feature supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetIOFormat (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_ioformat_t format)
 Sets the Input/Output configuration for the specified Discrete channel. For KA modules, only channels 13-16 are configurable, channels 1-12 are output-only channels, and channels 17-28 are input-only channels.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetIOFormat (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_ioformat_t *p_outformat)
 Retrieves the Input/Output configuration for the specified Discrete channel. For KA modules, only channels 13-16 are configurable, channels 1-12 are output-only channels, and channels 17-28 are input-only channels.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_IsIOConfigurable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *p_outconfigurable)
 Indicates if the specified Discrete channel is Input/Output configurable. For KA modules, only channels 13-16 are configurable, channels 1-12 are output-only channels, and channels 17-28 are input-only channels.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetBasicOpModeEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_iomode_t enable)
 This routine applies for Gen 5 Discrete Modules with FPGA Revision 10.2 or earlier. Sets the mode to either Basic or Enhanced mode for the specified Discrete channel.
Default configuration for the channels is Enhanced Input.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBasicOpModeEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_iomode_t *p_outenable)
 This routine applies for Gen 5 Discrete Modules with FPGA Revision 10.2 or earlier. Retrieves the present mode setting of either Basic or Enhanced mode for the specified Discrete channel. Default configuration for the channels is Enhanced Input.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetEnhanceTriggerEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_enable_t enable)
 Sets enhanced operation to disabled or enabled for specified Discrete channel.

 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetEnhanceTriggerEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_enable_t *p_outenable)
 Retrieves the present enhance operation enable state for the specified Discrete channel. Power on default configuration for the channels is Enhanced Input.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetOpMode (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_enhanced_mode_t mode)
 Sets the Operation mode in Enhanced mode for the specified Discrete channel. Default configuration for the channels is Enhanced Input. For KA and K6 modules, valid modes will be limited to PWM_FOREVER and basic modes only.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetOpMode (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_enhanced_mode_t *p_outmode)
 Retrieves the Operation mode in Enhanced mode for the specified Discrete channel. Default configuration for the channels is Enhanced Input.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetThreshold (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_thresh_type_t type, float64_t threshold)
 Sets the threshold value for the specified Discrete channel and threshold type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetThreshold (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_thresh_type_t type, float64_t *p_outthreshold)
 Sets the threshold value for the specified Discrete channel and threshold type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPullUpDownResConfig (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_pullresconfig_t config)
 Sets the Pull-Up/Down Resistor configuration for the specified Discrete channel. Feature available only on PD and KB modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPullUpDownResConfig (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_pullresconfig_t *p_outconfig)
 Retrieves the Pull-Up/Down Resistor configuration for the specified Discrete channel. Feature available only on PD and KB modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetGndSwitchConfig (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_gndswcfg_t config)
 Sets the Ground Switch configuration for the specified Discrete channel. Feature available only on PD and KB modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetGndSwitchConfig (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_gndswcfg_t *p_outconfig)
 Retrieves the Ground Switch configuration for the specified Discrete channel. Feature available only on PD and KB modules.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_CheckPowerOnBITComplete (int32_t cardIndex, int32_t module, bool_t *p_outpbitComplete)
 Retrieves the Power-On BIT (PBIT) status (complete or incomplete) for the specified module. The PBIT result will be in the BIT status register.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetModuleBITErrorThreshold (int32_t cardIndex, int32_t module, uint32_t threshold)
 Sets the BIT Error Threshold for continuous BIT conditions. The Error Threshold is a scalar for the internal BIT +2/-1 counter. To filter out momentary or intermittent anomalies in background BIT errors, this value can be increased to allow the error to "come and go" before the BIT status is flagged.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetModuleBITErrorThreshold (int32_t cardIndex, int32_t module, uint32_t *p_outthreshold)
 Retrieves the BIT Error Threshold for continuous BIT conditions. The Error Threshold is a scalar for the internal BIT +2/-1 counter. To filter out momentary or intermittent anomalies in background BIT errors, this value can be increased to allow the error to "come and go" before the BIT status is flagged.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ClearModuleBITLogic (int32_t cardIndex, int32_t module, int32_t channel)
 Resets the Continuous BIT internal circuitry and counter mechanism for the specified channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_Reset (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_reset_type_t resetType)
 Resets the Discrete channel as specified by the reset type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ResetAll (int32_t cardIndex, int32_t module, nai_dt_reset_type_t resetType)
 Resets all channels on the module as specified by the reset type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetDebounceTime (int32_t cardIndex, int32_t module, int32_t channel, float64_t debounceTime)
 Sets the debounce time for the specified Discrete channel. Enter time in milliseconds. When a signal level is within a valid logic range (Logic High > 2.0 v, and Logic Low < 0.6 v) and maintains that level for a period longer than the Debounce time a logic transition is validated. Signal pulse widths less than debounce time are filtered or ignored. Once valid, the interrupt transition register channel flag is set and the output logic changes state. Enter a value of 0 to disable debounce filtering. Debounce defaults to 0 upon power on or reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetDebounceTime (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outdebounceTime)
 Retrieves the debounce time for the specified Discrete channel in milliseconds. When a signal level is within a valid logic range (Logic High > 2.0 v, and Logic Low < 0.6 v) and maintains that level for a period longer than the Debounce time a logic transition is validated. Signal pulse widths less than debounce time are filtered or ignored. Once valid, the interrupt transition register channel flag is set and the output logic changes state. Enter a value of 0 to disable debounce filtering. Debounce defaults to 0 upon power on or reset.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetDebounceLSB (int32_t cardIndex, int32_t module, float64_t *p_outdebounceLSB)
 Retrieves the debounce LSB unit value in milliseconds, applicable for all Discrete channels on the module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ClearFIFO (int32_t cardIndex, int32_t module, int32_t channel)
 Clears the FIFO Data for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_StartMeasurement (int32_t cardIndex, int32_t module, int32_t channel)
 Starts the Input Measurement for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetFIFOStatus (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_outcount, nai_dt_fifo_status_t *p_outstatus)
 Retrieves the Discrete channel's FIFO Buffer Status.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetFIFOCount (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_outcount)
 Retrieves the number of elements in FIFO for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ReadFIFORaw (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, uint32_t outdata[], uint32_t *p_outread)
 Retrieves the data elements from the Discrete channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ReadFIFORawEx (int32_t cardIndex, int32_t module, int32_t channel, uint32_t count, uint32_t timeout, uint32_t outdata[], uint32_t *outread, uint32_t *countRemaining)
 Retrieves the data elements from the Discrete channel's FIFO buffer.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetTimebaseInterval (int32_t cardIndex, int32_t module, int32_t channel, float64_t interval)
 Sets the timebase for frequency measurements for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetTimebaseInterval (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outinterval)
 Retrieves the timebase for frequency measurements for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ClearCountData (int32_t cardIndex, int32_t module, int32_t channel)
 Clears the measurement count data for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetCountData (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_outcount)
 Retrieves the measurement count data for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_EnablePatternGen (int32_t cardIndex, int32_t module, int32_t channel, bool_t enable)
 Starts or stops the RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPatternGenPeriod (int32_t cardIndex, int32_t module, int32_t channel, float64_t period_mS)
 Sets the period for the Pattern Generator for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPatternGenPeriod (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outperiod_mS)
 Retrieves the period for the Pattern Generator for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPatternGen_BurstNum (int32_t cardIndex, int32_t module, uint32_t burstNum)
 Sets the number of cycles to output in the PatternGen burst mode for the specified Discrete module. The set value is applicable for enhanced IO PatternGen burst mode.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPatternGen_BurstNum (int32_t cardIndex, int32_t module, uint32_t *p_outburstNum)
 Retrieves the number of cycles set to output in the PatternGen burst mode for the specified Discrete module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPatternGenBuf (int32_t cardIndex, int32_t module, int32_t dataPatternLen, uint32_t *dataPattern)
 Sets the pattern for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPatternGenBuf (int32_t cardIndex, int32_t module, int32_t dataPatternLen, uint32_t *dataPattern)
 Retrieves the pattern for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPatternGenStartAddr (int32_t cardIndex, int32_t module, uint32_t startAddr)
 Sets the starting address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPatternGenStartAddr (int32_t cardIndex, int32_t module, uint32_t *outstartAddr)
 Gets the starting address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPatternGenEndAddr (int32_t cardIndex, int32_t module, uint32_t EndAddr)
 Sets the Ending address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPatternGenEndAddr (int32_t cardIndex, int32_t module, uint32_t *p_outEndAddr)
 Gets the Ending address to look at for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPatternGenCtrl (int32_t cardIndex, int32_t module, nai_dt_pattern_ctrl_t controlBit, nai_dt_enable_t state)
 Sets the state for the RAM Pattern Generator for the selected control bit on the module. Options are enable and disable.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPatternGenCtrl (int32_t cardIndex, int32_t module, nai_dt_pattern_ctrl_t controlBit, nai_dt_enable_t *p_outstate)
 Gets the state for the RAM Pattern Generator for the selected control bit on the module. Options are enable and disable.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPatternGenCtrlRaw (int32_t cardIndex, int32_t module, uint32_t controlRaw)
 Sets the control bits for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPatternGenCtrlRaw (int32_t cardIndex, int32_t module, uint32_t *outcontrolRaw)
 Retrieves the control bits for RAM Pattern Generator.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_StartPWM (int32_t cardIndex, int32_t module, int32_t channel)
 Starts the PWM output for the selected channel on the module. For GEN5 module, PWM mode should be set up first, to the desired mode (continuous or burst).
The PWM mode setup will need to be done before each start command.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_StopPWM (int32_t cardIndex, int32_t module, int32_t channel)
 Stops the PWM output for the selected channel on the module. For Gen5 modules, this is done by taking the channel out of PWM mode and resetting to the input mode. To restart PWM, the PWM mode setting will need to be independently set up again.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ResetPWMMasterChannelAll (int32_t cardIndex, int32_t module)
 Resets all master channel configurations for the module. This restores the power on default of independent PWM triggering on all channels.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ResetPWMMasterChannel (int32_t cardIndex, int32_t module, int32_t channel)
 Resets the master channel configuration for the channel group associated with the selected channel. Associated channel groupings are Channels [1 to 6], [6 to 12], [13 to 18], [19 to 24].

 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPWMMasterChannel (int32_t cardIndex, int32_t module, int32_t channel)
 Sets the channel to be designated as a master within its channel group on the module. The master channel allows synchronization of output timing for the other channels each respective 6 channel group.
Associated channel groupings are Channels [1 to 6], [6 to 12], [13 to 18], [19 to 24].
Note: Selection of a master channel will affect only the channels within its group. The master channel is used for timing synchronization of the output channels in the group.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPWMMasterChannel (int32_t cardIndex, int32_t module, int32_t channel, int32_t *p_outchannel)
 Retrieves the master channel associated with the selected channel, in the associated channel group on the module. A zero return value indicates no master channel is set for the channel, so it operates independently.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPWM_Period (int32_t cardIndex, int32_t module, int32_t channel, float64_t period)
 Sets the PWM period for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPWM_Period (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outperiod)
 Retrieves the PWM period value set for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPWM_Pulsewidth (int32_t cardIndex, int32_t module, int32_t channel, float64_t pulsewidth)
 Sets the PWM pulsewidth for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPWM_Pulsewidth (int32_t cardIndex, int32_t module, int32_t channel, float64_t *p_outpulsewidth)
 Retrieves the PWM pulsewidth value set for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPWM_BurstNum (int32_t cardIndex, int32_t module, int32_t channel, uint32_t burstNum)
 Sets the number of cycles to output in the PWM burst mode for the specified Discrete channel. The set value is applicable for enhanced IO PWM burst mode (mode 12).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPWM_BurstNum (int32_t cardIndex, int32_t module, int32_t channel, uint32_t *p_outburstNum)
 Retrieves the number of cycles set to output in the PWM burst mode for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetPWM_Polarity (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_pwm_polarity_t polarity)
 Sets the polarity for the PWM output for the selected channel on the module. Options are positive and negative polarity, where positive indicates the high state corresponds to the pulsewidth setting, and negative inverts it for a negative going pulse output.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetPWM_Polarity (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_pwm_polarity_t *p_outpolarity)
 Retrieves the polarity setting for the PWM output for the selected channel on the module. Options are positive and negative polarity, where positive setting indicates the high state corresponds to the pulsewidth setting, and negative setting inverts it for a negative going pulse output.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetBankSourceSinkCurrent (int32_t cardIndex, int32_t module, int32_t bank, float64_t current)
 Sets Source/Sink Current configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBankSourceSinkCurrent (int32_t cardIndex, int32_t module, int32_t bank, float64_t *p_outcurrent)
 Retrieves Source/Sink Current configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetBankSourceSinkCurrent_mA (int32_t cardIndex, int32_t module, int32_t bank, float64_t current_mA)
 Sets Source/Sink Current configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBankSourceSinkCurrent_mA (int32_t cardIndex, int32_t module, int32_t bank, float64_t *p_outcurrent_mA)
 Retrieves Source/Sink Current configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetBankCurrentShareCfg (int32_t cardIndex, int32_t module, int32_t bank, nai_dt_cursharecfg_t config)
 Sets the current share configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBankCurrentShareCfg (int32_t cardIndex, int32_t module, int32_t bank, nai_dt_cursharecfg_t *p_outconfig)
 Retrieves the current share configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetBankPullUpDownCfg (int32_t cardIndex, int32_t module, int32_t bank, nai_dt_pullconfig_t config)
 Sets the Pull-Up/Down Current Configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBankPullUpDownCfg (int32_t cardIndex, int32_t module, int32_t bank, nai_dt_pullconfig_t *p_outconfig)
 Retrieves the Pull-Up/Down Current Configuration for the specified Discrete channel bank.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetWatchdogQuietTime (int32_t cardIndex, int32_t module, uint32_t quietTime)
 Sets the quiet time duration for the watchdog timer. The watchdog timer is comprised of two parts: quiet time, and window. The quiet time is the time where a strobe is NOT expected to occur, and the window is the time where a SINGLE strobe is expected. A strobe is made by the application by calling naibrd_DT_WatchdogStrobe().
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetWatchdogQuietTime (int32_t cardIndex, int32_t module, uint32_t *p_outquietTime)
 Retrieves the quiet time duration for the watchdog timer. The watchdog timer is comprised of two parts: quiet time, and window. The quiet time is the time where a strobe is NOT expected to occur, and the window is the time where a SINGLE strobe is expected. A strobe is made by the application by calling naibrd_DT_WatchdogStrobe().
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetWatchdogWindow (int32_t cardIndex, int32_t module, uint32_t window)
 Sets the window that a call to naibrd_DT_WatchdogStrobe() will be made. If a call to naibrd_DT_WatchdogStrobe() is not made by the application within the 'window' ('quiet time' + 'window'), the Watchdog Timer Fault will occur.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetWatchdogWindow (int32_t cardIndex, int32_t module, uint32_t *p_outwindow)
 Retrieves the window that a call to naibrd_DT_WatchdogStrobe() will be made. If a call to naibrd_DT_WatchdogStrobe() is not made by the application within the 'window' ('quiet time' + 'window'), the Watchdog Timer Fault will occur.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_WatchdogStrobe (int32_t cardIndex, int32_t module)
 Strobes the Watchdog Timer. A SINGLE call to this function MUST be made by the application within the 'window' or a Watchdog Timer Fault will occur.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_WatchdogReset (int32_t cardIndex, int32_t module)
 Resets the Watchdog Timer. A reset will stop the Watchdog process and no faults will occur. The process starts again upon the first strobe. NOTE: Function not yet supported. Please refer to naibrd_DT_SetWatchdogQuietTime for an example. Feature supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetModulePowerResetStatus (int32_t cardIndex, int32_t module, nai_dt_module_power_reset_status_type_t modulePowerResetStatusType, bool_t *p_outmodulePowerResetStatusBit)
 Retrieves the bit specified by the module power reset status type from the module power reset status register for the specified Discrete module. Feature supported in Motherboard FPGA Version >= X.X.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ClearModulePowerResetStatus (int32_t cardIndex, int32_t module, nai_dt_module_power_reset_status_type_t modulePowerResetStatusType)
 Clears the bit specified by the module power reset status type in the module power reset status register for the specified Discrete module. Feature supported in Motherboard FPGA Version >= X.X.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetModulePowerReset (int32_t cardIndex, int32_t module, nai_dt_module_power_reset_type_t modulePowerResetType, bool_t modulePowerResetBit)
 Sets the bit specified by the module power reset type in the module power reset register for the specified Discrete module. Feature supported in Motherboard FPGA Version >= X.X.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetModulePowerReset (int32_t cardIndex, int32_t module, nai_dt_module_power_reset_type_t modulePowerResetType, bool_t *p_outmodulePowerResetBit)
 Retrieves the bit specified by the module power reset type from the module power reset register for the specified Discrete module. Feature supported in Motherboard FPGA Version >= X.X.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_status_type_t type, bool_t enable)
 Sets the Interrupt Enable for the specified Discrete channel and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_status_type_t type, bool_t *p_outenable)
 Retrieves the Interrupt Enable for the specified Discrete channel and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetEdgeLevelInterrupt (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_status_type_t type, nai_dt_interrupt_t interruptType)
 Sets the Interrupt Edge/Level property for the specified Discrete channel and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetEdgeLevelInterrupt (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_status_type_t type, nai_dt_interrupt_t *p_outinterruptType)
 Retrieves the Interrupt Edge/Level property for the specified Discrete channel and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetGroupInterruptVector (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, uint32_t vector)
 Sets the Interrupt Vector for the specified Discrete channel and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetGroupInterruptVector (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, uint32_t *p_outvector)
 Retrieves the Interrupt Vector for the specified Discrete channel and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetGroupInterruptSteering (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, naibrd_int_steering_t steering)
 Sets the Interrupt Steering which indicates the interrupt direction for the specified Discrete group and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetGroupInterruptSteering (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, naibrd_int_steering_t *p_outsteering)
 Retrieves the Interrupt Steering which indicates the interrupt direction for the specified Discrete group and interrupt status type. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ConvertToVoltage (uint32_t modid, uint32_t rawdata, float64_t *p_outvoltage)
 Calculates the voltage in volts associated with the Discrete Module ID from the given raw data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ConvertToVoltageRaw (uint32_t modid, float64_t voltage, uint32_t *outrawdata)
 Calculates the raw data associated with the Discrete Module ID and a given voltage.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ConvertToCurrent (uint32_t modid, uint32_t rawdata, float64_t *outcurrent)
 Calculates the current in Amps associated with the Discrete Module ID and given raw data.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ConvertToCurrentRaw (uint32_t modid, float64_t current, uint32_t *outrawdata)
 Calculates the raw current associated with the Discrete Module ID and given current.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetRaw (int32_t cardIndex, int32_t module, nai_dt_raw_module_t type, uint32_t rawdata)
 Sets the raw data value in the register associated to the register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetRaw (int32_t cardIndex, int32_t module, nai_dt_raw_module_t type, uint32_t *outrawdata)
 Retrieves the raw data value in the register associated to the register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetGroupRaw (int32_t cardIndex, int32_t module, int32_t group, nai_dt_raw_group_t type, uint32_t rawdata)
 Sets the raw data value in the register associated to the group and register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetGroupRaw (int32_t cardIndex, int32_t module, int32_t group, nai_dt_raw_group_t type, uint32_t *outrawdata)
 Retrieves the raw data value in the register associated to the group and register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetGroupStatusRaw (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, uint32_t *outrawdata)
 Retrieves the raw status data value in the register associated to the group and status type specified. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_ClearGroupStatusRaw (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, uint32_t rawdata)
 Clears the status data value in the register associated to the group and status type specified. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetGroupInterruptEnableRaw (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, uint32_t rawdata)
 Sets the raw interrupt enable data value in the register associated to the group and status type specified. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetGroupInterruptEnableRaw (int32_t cardIndex, int32_t module, int32_t group, nai_dt_status_type_t type, uint32_t *outrawdata)
 Retrieves the raw interrupt enable data value in the register associated to the group and status type specified. Inter-FPGA Status: Feature supported in FPGA Version >= 13.2 (8-bit rev, older than 1.9), SPL Rev >= 9 Summary Status and Watchdog Timer Status: Features supported in FPGA Version >= 1.9.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBitStatusRaw (int32_t cardIndex, int32_t module, nai_dt_bit_status_type_t type, uint32_t *p_outstatus)
 Retrieves the BIT error trigger type for the specified channel and BIT status error trigger type, when BIT status has been set. A return of 1 indicates the BIT was a result of the queried trigger type (voltage measurement, or driver error).
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetBankRaw (int32_t cardIndex, int32_t module, int32_t bank, nai_dt_raw_bank_t type, uint32_t rawdata)
 Sets the raw data value in the register associated to the bank and bank register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetBankRaw (int32_t cardIndex, int32_t module, int32_t bank, nai_dt_raw_bank_t type, uint32_t *outrawdata)
 Retrieves the raw data value in the register associated to the bank and bank register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_raw_channel_t type, uint32_t rawdata)
 Sets the raw data value in the register associated to the channel and register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetChannelRaw (int32_t cardIndex, int32_t module, int32_t channel, nai_dt_raw_channel_t type, uint32_t *outrawdata)
 Retrieves the raw data value in the register associated to the channel and register type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetVoltageCalFactors (int32_t cardIndex, int32_t module, int32_t channel, int32_t offset, uint32_t gain)
 Update the calibration factors for the voltage measurement function for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetCalFactors (int32_t cardIndex, int32_t module, int32_t channel, int32_t offset, uint32_t sourceGain, uint32_t sinkGain)
 Update the calibration factors for the current measurement function for the specified Discrete channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetCalData (int32_t cardIndex, int32_t module, int32_t addr, uint32_t value)
 Update the calibration factors for the specified Discrete Address.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetCalData (int32_t cardIndex, int32_t module, int32_t addr, uint32_t *value)
 Get the calibration factors for the specified Discrete Address.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_UnlockCalData (int32_t cardIndex, int32_t module)
 Unlock the calibration data area for writing.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_LockCalData (int32_t cardIndex, int32_t module)
 Lock the calibration data area from being writing.
 

Macro Definition Documentation

◆ NAI_DT_GEN3_CURRENT_LSB_AMP

#define NAI_DT_GEN3_CURRENT_LSB_AMP   0.003 /* Amps (3.0 mA) */

◆ NAI_DT_GEN3_DEBOUNCE_TIME_LSB_MSEC

#define NAI_DT_GEN3_DEBOUNCE_TIME_LSB_MSEC   0.0204800 /* msec (20.48 us) */

◆ NAI_DT_GEN3_MAX_DEBOUNCE_TIME_MSEC

#define NAI_DT_GEN3_MAX_DEBOUNCE_TIME_MSEC   1342.1568 /* msec (1.34 sec) */

◆ NAI_DT_GEN3_PWM_LSB_MSEC

#define NAI_DT_GEN3_PWM_LSB_MSEC   0.0204800 /* msec (20.48 us) */

◆ NAI_DT_GEN3_SOURCE_SINK_CURRENT_LSB_AMP

#define NAI_DT_GEN3_SOURCE_SINK_CURRENT_LSB_AMP   0.0001 /* Amps (0.1 mA) */

◆ NAI_DT_GEN5_CURRENT_LSB_AMP

#define NAI_DT_GEN5_CURRENT_LSB_AMP   0.003 /* Amps (3.0 mA) (was previously defined as 10mA) */

◆ NAI_DT_GEN5_DEBOUNCE_LSB_MSEC

#define NAI_DT_GEN5_DEBOUNCE_LSB_MSEC   0.00844025 /* msec (8.44025us ) Empirical*/

◆ NAI_DT_GEN5_DEBOUNCE_LSB_MSEC_REV10

#define NAI_DT_GEN5_DEBOUNCE_LSB_MSEC_REV10   0.01000000 /* LSB for mod fpga rev 10.0+ */

◆ NAI_DT_GEN5_MB_COMMON_MODULE_NUM

#define NAI_DT_GEN5_MB_COMMON_MODULE_NUM   0

◆ NAI_DT_GEN5_MODULE_POWER_RESET_COUNT

#define NAI_DT_GEN5_MODULE_POWER_RESET_COUNT   8

◆ NAI_DT_GEN5_SOURCE_SINK_CURRENT_LSB_AMP

#define NAI_DT_GEN5_SOURCE_SINK_CURRENT_LSB_AMP   0.0001 /* Amps (0.1 mA) */

◆ NAI_DT_GEN5_TIMER_LSB_MSEC

#define NAI_DT_GEN5_TIMER_LSB_MSEC   0.003608 /* msec (3608ns ) Empirical*/

◆ NAI_DT_GEN5_TIMER_STD_LSB_MSEC

#define NAI_DT_GEN5_TIMER_STD_LSB_MSEC   0.010000 /* LSB for mod fpga rev 10.0+ */

◆ NAI_DT_GEN5_UNLOCK_CALIBRATION_CODE

#define NAI_DT_GEN5_UNLOCK_CALIBRATION_CODE   0xCA11B78Eu /* Calibration Unlock (and defeat Over current) Code */

◆ NAI_DT_GEN5_WATCHDOG_STATUS_MASK

#define NAI_DT_GEN5_WATCHDOG_STATUS_MASK   0x80000000u

◆ NAI_DT_GEN5_WATCHDOG_STATUS_SHIFT

#define NAI_DT_GEN5_WATCHDOG_STATUS_SHIFT   31

◆ NAI_DT_KA_DEBOUNCE_TIME_LSB_MSEC

#define NAI_DT_KA_DEBOUNCE_TIME_LSB_MSEC   0.0051200 /* msec (5.12 us) */

◆ NAI_DT_KA_MAX_DEBOUNCE_TIME_MSEC

#define NAI_DT_KA_MAX_DEBOUNCE_TIME_MSEC   167.77000 /* msec (0.1677 sec) */

◆ NAI_DT_KA_MAX_THRESHOLD_VOLT

#define NAI_DT_KA_MAX_THRESHOLD_VOLT   40.0 /* Volt */

◆ NAI_DT_KA_PWM_LSB_MSEC

#define NAI_DT_KA_PWM_LSB_MSEC   0.0010000 /* msec (1 us) */

◆ NAI_DT_KA_VOLTAGE_LSB_VOLT

#define NAI_DT_KA_VOLTAGE_LSB_VOLT   0.0098 /* Volt (9.8 mV) */

◆ NAI_DT_KB_DEBOUNCE_TIME_LSB_MSEC

#define NAI_DT_KB_DEBOUNCE_TIME_LSB_MSEC   0.0149333 /* msec (14.933 us) */

◆ NAI_DT_KB_MAX_DEBOUNCE_TIME_MSEC

#define NAI_DT_KB_MAX_DEBOUNCE_TIME_MSEC   978.65600 /* msec (0.979 sec) */

◆ NAI_DT_KB_MAX_THRESHOLD_VOLT

#define NAI_DT_KB_MAX_THRESHOLD_VOLT   30.0 /* Volt */

◆ NAI_DT_KB_VOLTAGE_LSB_VOLT

#define NAI_DT_KB_VOLTAGE_LSB_VOLT   0.015 /* Volt (150 mV) */

◆ NAI_DT_MAX_SOURCE_SINK_CURRENT_AMP

#define NAI_DT_MAX_SOURCE_SINK_CURRENT_AMP   0.005 /* Amps (5 mA) */

◆ NAI_DT_MAX_THRESHOLD_VOLT

#define NAI_DT_MAX_THRESHOLD_VOLT   80.0 /* Volt */

◆ NAI_DT_MAX_VCC_VOLT

#define NAI_DT_MAX_VCC_VOLT   80.0 /* Volt */

◆ NAI_DT_PD_DEBOUNCE_TIME_LSB_MSEC

#define NAI_DT_PD_DEBOUNCE_TIME_LSB_MSEC   0.0051200 /* msec (5.12 us) */

◆ NAI_DT_PD_MAX_DEBOUNCE_TIME_MSEC

#define NAI_DT_PD_MAX_DEBOUNCE_TIME_MSEC   335.53920 /* msec (0.336 sec)*/

◆ NAI_DT_PD_MAX_THRESHOLD_VOLT

#define NAI_DT_PD_MAX_THRESHOLD_VOLT   30.0 /* Volt */

◆ NAI_DT_PD_VOLTAGE_LSB_VOLT

#define NAI_DT_PD_VOLTAGE_LSB_VOLT   0.015 /* Volt (150 mV) */

◆ NAI_DT_VCC_LSB_VOLT

#define NAI_DT_VCC_LSB_VOLT   0.10 /* Volt (100 mV) */

◆ NAI_DT_VOLTAGE_LSB_VOLT

#define NAI_DT_VOLTAGE_LSB_VOLT   0.10 /* Volts (100 mV) */

Enumeration Type Documentation

◆ naibrd_discrete_type

Enumerator
NAIBRD_DT_GEN5_MOD_24_CHAN 
NAIBRD_DT_GEN5_MOD_24_CHAN_ENHANCED 
NAIBRD_DT_GEN5_COMBO_12_CHAN_ENHANCED 
NAIBRD_DT_GEN5_INBRD_24_CHAN 
NAIBRD_DT_GEN5_INBRD_24_CHAN_ENHANCED 
NAIBRD_DT_GEN5_INBRD_COMBO_12_CHAN 
NAIBRD_DT_GEN3_MOD_K6 
NAIBRD_DT_GEN3_MOD_K9 
NAIBRD_DT_GEN3_MOD_KA 
NAIBRD_DT_GEN3_MOD_KB 
NAIBRD_DT_GEN3_MOD_PD 
NAIBRD_DT_UNDEFINED 

Function Documentation

◆ naibrd_DT_GetCalData()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_GetCalData ( int32_t cardIndex,
int32_t module,
int32_t addr,
uint32_t * value )

Get the calibration factors for the specified Discrete Address.

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]).
addr: (Input) Offset into the calibration data (Calibration data Address).
value: (Output) Correction data read.
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_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_DT_LockCalData()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_LockCalData ( int32_t cardIndex,
int32_t module )

Lock the calibration data area from being writing.

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]).
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_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_DT_SetCalData()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetCalData ( int32_t cardIndex,
int32_t module,
int32_t addr,
uint32_t value )

Update the calibration factors for the specified Discrete Address.

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]).
addr: (Input) Offset into the calibration data (Cal. data Address).
value: (Input) Correction data to be written.
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_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_DT_SetCalFactors()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetCalFactors ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t offset,
uint32_t sourceGain,
uint32_t sinkGain )

Update the calibration factors for the current measurement function for the specified Discrete channel.

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]).
offset: (Input) Offset correction (nominally 0x0400, correction value will be subtracted from the reading).
sourceGain: (Input) Source Gain correction (nominally 0x3E00, correction value ratio will be used to adjust the base reading by Gain/0x3E00. Source gain factor is applied to high side output drive, (positive current values)).
sinkGain: (Input) Sink Gain correction, (nominally 0x3E00, correction value ratio will be used to adjust the base reading by Gain/0x3E00. Sink gain factor correction is applied to low side drive (negative current values).
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_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_DT_SetVoltageCalFactors()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_SetVoltageCalFactors ( int32_t cardIndex,
int32_t module,
int32_t channel,
int32_t offset,
uint32_t gain )

Update the calibration factors for the voltage measurement function for the specified Discrete channel.

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]).
offset: (Input) Offset correction (nominally 0x00, correction value will be subtracted from the reading).
gain: (Input) Gain correction (nominally 0x4000, correction value ratio will be used to adjust the base reading by Gain/0x4000).
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_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_INVALID_CHANNEL when invalid channel parameter.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.

◆ naibrd_DT_UnlockCalData()

NAIBRDFUNC nai_status_t NAIAPI naibrd_DT_UnlockCalData ( int32_t cardIndex,
int32_t module )

Unlock the calibration data area for writing.

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]).
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_NOT_OPEN when handle to board is invalid.
  • NAI_ERROR_NOT_SUPPORTED when function is not supported.