Software Library API naibrd 2.24.0
See all documentation at naii.docs.com
naibrd_fg.c File Reference

Functions

static nai_status_t naibrd_FG_VerifyChannel (uint32_t modId, int32_t channel)
 
static nai_status_t naibrd_FG_VerifyFrequency (uint32_t modId, float64_t frequency)
 
static nai_status_t naibrd_FG_VerifyAmplitude (uint32_t modId, float64_t amplitude)
 
static nai_status_t naibrd_FG_VerifyDCOffset (uint32_t modId, float64_t dc_offset)
 
static nai_status_t naibrd_FG_VerifyMeasure (uint32_t modID, naibrd_fg_measure_t measure_select)
 
static nai_status_t naibrd_FG_VerifyPhase (uint32_t modId, float64_t phase)
 
static nai_status_t naibrd_FG_VerifyMode (uint32_t modID, naibrd_fg_mode_t mode)
 
static nai_status_t naibrd_FG_VerifyChanMappedStatusType (naibrd_fg_chan_mapped_status_type_t statusType)
 
static nai_status_t naibrd_FG_VerifyInterruptTriggerType (naibrd_int_trigger_type_t triggerType)
 
static nai_status_t naibrd_FG_VerifyInterruptSteeringType (naibrd_int_steering_t steeringType)
 
NAIBRDFUNC int32_t NAIAPI naibrd_FG_GetChannelCount (uint32_t modId)
 Returns the number of channels for the specified Module ID.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetFrequency (int32_t cardIndex, int32_t module, int32_t channel, float64_t frequency)
 Sets the frequency for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetFrequency (int32_t cardIndex, int32_t module, int32_t channel, float64_t *out_frequency)
 Retrieves the frequency for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetAmplitude (int32_t cardIndex, int32_t module, int32_t channel, float64_t amplitude)
 If the user programmes a combined DC offset and amplitude over the specified range of the module, the output will be saturated at the maximum or minimum value or in a unknown state. This function sets the amplitude value for the function generator channel based on the given card index, module, and channel number.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetAmplitude (int32_t cardIndex, int32_t module, int32_t channel, float64_t *out_amplitude)
 Retrieves the amplitude for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetDCOffset (int32_t cardIndex, int32_t module, int32_t channel, float64_t dc_offset)
 Sets the DC offset for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetDCOffset (int32_t cardIndex, int32_t module, int32_t channel, float64_t *out_dc_offset)
 Gets the DC offset for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetPhase (int32_t cardIndex, int32_t module, int32_t channel, float64_t phase)
 Sets the phase for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetPhase (int32_t cardIndex, int32_t module, int32_t channel, float64_t *out_phase)
 Gets the phase for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetMode (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_mode_t mode_select)
 Sets the operating mode for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetMode (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_mode_t *out_mode)
 Gets the current operating mode of a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetPhaseLockEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t enable)
 Sets the phase lock state for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetPhaseLockEnable (int32_t cardIndex, int32_t module, int32_t channel, bool_t *out_enable)
 Gets the phase lock state for a specified function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_Measure (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_measure_t measure_select, float64_t *out_value)
 Measures the specified parameter for a function generator channel.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetChanMappedStatus (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_chan_mapped_status_type_t statusType, nai_status_bit_t *p_outstatusBit)
 Gets the mapped status for a specified function generator channel and status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_ClearChanMappedStatus (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_chan_mapped_status_type_t statusType)
 Clears the mapped status for a specified function generator channel and status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetChanMappedInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_chan_mapped_status_type_t statusType, bool_t enable)
 Sets the Interrupt Enable for the specified channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetChanMappedInterruptEnable (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_chan_mapped_status_type_t statusType, bool_t *p_outenable)
 Retrieves the Interrupt Enable for the specified channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetChanMappedInterruptTriggerType (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_chan_mapped_status_type_t statusType, naibrd_int_trigger_type_t triggerType)
 Sets the Interrupt Edge/Level property for the specified Discrete channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetChanMappedInterruptTriggerType (int32_t cardIndex, int32_t module, int32_t channel, naibrd_fg_chan_mapped_status_type_t statusType, naibrd_int_trigger_type_t *p_outtriggerType)
 Retrieves the Interrupt Edge/Level property for the specified channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetChanMappedInterruptVector (int32_t cardIndex, int32_t module, naibrd_fg_chan_mapped_status_type_t statusType, uint32_t vector)
 Sets the Interrupt Vector for the specified channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetChanMappedInterruptVector (int32_t cardIndex, int32_t module, naibrd_fg_chan_mapped_status_type_t statusType, uint32_t *p_outVector)
 Retrieves the Interrupt Vector for the specified channel and interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_SetChanMappedInterruptSteering (int32_t cardIndex, int32_t module, naibrd_fg_chan_mapped_status_type_t statusType, naibrd_int_steering_t steering)
 Sets the Interrupt Steering which indicates the interrupt direction for the specified interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetChanMappedInterruptSteering (int32_t cardIndex, int32_t module, naibrd_fg_chan_mapped_status_type_t statusType, naibrd_int_steering_t *p_outSteering)
 Retrieves the Interrupt Steering which indicates the interrupt direction for the specified interrupt status type.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetStatusRaw (int32_t cardIndex, int32_t module, naibrd_fg_chan_mapped_status_type_t type, uint32_t *outrawdata)
 Retrieves the raw status data value in the register associated to the group and status type specified.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_ClearStatusRaw (int32_t cardIndex, int32_t module, naibrd_fg_chan_mapped_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_FG_SetPowerEnable (int32_t cardIndex, int32_t module, bool_t enable)
 Sets the power enable state for the function generator module.
 
NAIBRDFUNC nai_status_t NAIAPI naibrd_FG_GetPowerEnable (int32_t cardIndex, int32_t module, bool_t *out_enable)
 Gets the power enable state for a function generator module.
 

Variables

static const uint32_t FG_FG1_GEN5_SetFrequency [4] = NAIBRD_FG_GEN5_REG_SET_FREQUENCY
 
static const uint32_t FG_FG1_GEN5_SetAmplitude [4] = NAIBRD_FG_GEN5_REG_SET_AMPLITUDE
 
static const uint32_t FG_FG1_GEN5_SetDCOffset [4] = NAIBRD_FG_GEN5_REG_SET_DCOFFSET
 
static const uint32_t FG_FG1_GEN5_SetPhase [4] = NAIBRD_FG_GEN5_REG_SET_PHASE
 
static const uint32_t FG_FG1_GEN5_SetMode [4] = NAIBRD_FG_GEN5_REG_SET_MODE
 
static const uint32_t FG_FG1_GEN5_MeasFrequency [4] = NAIBRD_FG_GEN5_REG_MEAS_FREQUENCY
 
static const uint32_t FG_FG1_GEN5_MeasAmplitude [4] = NAIBRD_FG_GEN5_REG_MEAS_AMPLITUDE
 
static const uint32_t FG_FG1_GEN5_MeasDCOffset [4] = NAIBRD_FG_GEN5_REG_MEAS_DCOFFSET
 
static const uint32_t FG_reg_status [NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
 
static const uint32_t FG_POWER_ENABLE = NAIBRD_FG_GEN5_REG_POWER_ENABLE
 
static const uint32_t fg_reg_int_enable [NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
 
static const uint32_t fg_reg_int_type [NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
 
static const int32_t fg_interrupt_num [NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
 

Function Documentation

◆ naibrd_FG_VerifyAmplitude()

static nai_status_t naibrd_FG_VerifyAmplitude ( uint32_t modId,
float64_t amplitude )
static

◆ naibrd_FG_VerifyChanMappedStatusType()

static nai_status_t naibrd_FG_VerifyChanMappedStatusType ( naibrd_fg_chan_mapped_status_type_t statusType)
static

◆ naibrd_FG_VerifyChannel()

static nai_status_t naibrd_FG_VerifyChannel ( uint32_t modId,
int32_t channel )
static

◆ naibrd_FG_VerifyDCOffset()

static nai_status_t naibrd_FG_VerifyDCOffset ( uint32_t modId,
float64_t dc_offset )
static

◆ naibrd_FG_VerifyFrequency()

static nai_status_t naibrd_FG_VerifyFrequency ( uint32_t modId,
float64_t frequency )
static

◆ naibrd_FG_VerifyInterruptSteeringType()

static nai_status_t naibrd_FG_VerifyInterruptSteeringType ( naibrd_int_steering_t steeringType)
static

◆ naibrd_FG_VerifyInterruptTriggerType()

static nai_status_t naibrd_FG_VerifyInterruptTriggerType ( naibrd_int_trigger_type_t triggerType)
static

◆ naibrd_FG_VerifyMeasure()

static nai_status_t naibrd_FG_VerifyMeasure ( uint32_t modID,
naibrd_fg_measure_t measure_select )
static

◆ naibrd_FG_VerifyMode()

static nai_status_t naibrd_FG_VerifyMode ( uint32_t modID,
naibrd_fg_mode_t mode )
static

◆ naibrd_FG_VerifyPhase()

static nai_status_t naibrd_FG_VerifyPhase ( uint32_t modId,
float64_t phase )
static

Variable Documentation

◆ FG_FG1_GEN5_MeasAmplitude

const uint32_t FG_FG1_GEN5_MeasAmplitude[4] = NAIBRD_FG_GEN5_REG_MEAS_AMPLITUDE
static

◆ FG_FG1_GEN5_MeasDCOffset

const uint32_t FG_FG1_GEN5_MeasDCOffset[4] = NAIBRD_FG_GEN5_REG_MEAS_DCOFFSET
static

◆ FG_FG1_GEN5_MeasFrequency

const uint32_t FG_FG1_GEN5_MeasFrequency[4] = NAIBRD_FG_GEN5_REG_MEAS_FREQUENCY
static

◆ FG_FG1_GEN5_SetAmplitude

const uint32_t FG_FG1_GEN5_SetAmplitude[4] = NAIBRD_FG_GEN5_REG_SET_AMPLITUDE
static

◆ FG_FG1_GEN5_SetDCOffset

const uint32_t FG_FG1_GEN5_SetDCOffset[4] = NAIBRD_FG_GEN5_REG_SET_DCOFFSET
static

◆ FG_FG1_GEN5_SetFrequency

const uint32_t FG_FG1_GEN5_SetFrequency[4] = NAIBRD_FG_GEN5_REG_SET_FREQUENCY
static

◆ FG_FG1_GEN5_SetMode

const uint32_t FG_FG1_GEN5_SetMode[4] = NAIBRD_FG_GEN5_REG_SET_MODE
static

◆ FG_FG1_GEN5_SetPhase

const uint32_t FG_FG1_GEN5_SetPhase[4] = NAIBRD_FG_GEN5_REG_SET_PHASE
static

◆ fg_interrupt_num

const int32_t fg_interrupt_num[NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
static
Initial value:
= {
NAIBRD_FG_GEN5_REG_BIT_INT_VECTOR_STEERING_INTNUM,
NAIBRD_FG_GEN5_REG_BIT_INT_VECTOR_STEERING_INTNUM,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_INT_VECTOR_STEERING_INTNUM,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_INT_VECTOR_STEERING_INTNUM
}

◆ FG_POWER_ENABLE

const uint32_t FG_POWER_ENABLE = NAIBRD_FG_GEN5_REG_POWER_ENABLE
static

◆ fg_reg_int_enable

const uint32_t fg_reg_int_enable[NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
static
Initial value:
= {
NAIBRD_FG_GEN5_REG_BIT_INT_ENABLE_ADD,
NAIBRD_FG_GEN5_REG_BIT_INT_ENABLE_ADD,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_STATUS_INT_ENABLE_ADD,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_STATUS_INT_ENABLE_ADD
}

◆ fg_reg_int_type

const uint32_t fg_reg_int_type[NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
static
Initial value:
= {
NAIBRD_FG_GEN5_REG_BIT_EDGE_LEVEL_INT_ADD,
NAIBRD_FG_GEN5_REG_BIT_EDGE_LEVEL_INT_ADD,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_EDGE_LEVEL_INT_ADD,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_EDGE_LEVEL_INT_ADD
}

◆ FG_reg_status

const uint32_t FG_reg_status[NAIBRD_FG_STATUS_TYPE_ENUM_COUNT]
static
Initial value:
= {
NAIBRD_FG_GEN5_REG_BIT_LATCHED_STATUS_ADD,
NAIBRD_FG_GEN5_REG_BIT_REALTIME_STATUS_ADD,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_LATCHED_STATUS_ADD,
NAIBRD_FG_GEN5_REG_WATCHDOG_TIMER_INTER_FPGA_FAULT_REALTIME_STATUS_ADD
}