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

Enumerations

enum  ref_basicOpsMenu_commands {
  REF_BASICMENU_SET_FREQUENCY , REF_BASICMENU_SET_VOLTAGE , REF_BASICMENU_SET_CURRENT_LIMIT , REF_BASICMENU_SET_OUTPUT_ENABLE ,
  REF_BASICMENU_SET_FLOATING_POINT_ENABLE , REF_BASICMENU_SET_CHANNEL_RESET , REF_BASICMENU_SET_CHANNEL_STATUS_ENABLE , REF_BASICMENU_WD_MENU ,
  REF_BASICMENU_SET_PBIT , REF_BASICMENU_MODULE_POWER_RESET_MENU , REF_BASICMENU_CMD_COUNT
}
 
enum  ref_gen5_ref_watchdog_commands {
  REF_COMMON_CMD_WD_QUIETTIME , REF_COMMON_CMD_WD_WINDOWTIME , REF_COMMON_CMD_WD_DISPLAY , REF_COMMON_CMD_WD_STROBE ,
  REF_COMMON_CMD_WD_KILL , REF_COMMON_CMD_WD_BACK , REF_COMMON_CMD_WD_COUNT
}
 
enum  ref_module_power_reset_commands { REF_MODULE_POWER_RESET_CMD_BACK , REF_MODULE_POWER_RESET_CMD_CLEAR_MODULE_POWER_RESET_STATUS , REF_MODULE_POWER_RESET_CMD_SET_MODULE_POWER_RESET , REF_MODULE_POWER_RESET_CMD_COUNT }
 

Functions

static bool_t REFBasicMenu_Run (int32_t cardIndex, int32_t module, uint32_t modid)
 
static bool_t naiapp_REFBasicMenu_DisplayMeasurements (int32_t cardIndex, int32_t module, int32_t maxChannels, uint32_t modId)
 
static nai_status_t naiapp_REFBasicMenu_SetFrequency (int32_t paramCount, int32_t *params)
 
static nai_status_t naiapp_REFBasicMenu_SetVoltage (int32_t paramCount, int32_t *params)
 
static nai_status_t naiapp_REFBasicMenu_SetCurrentLimit (int32_t paramCount, int32_t *params)
 
static nai_status_t naiapp_REFBasicMenu_SetOutputEnable (int32_t paramCount, int32_t *params)
 
static nai_status_t naiapp_REFBasicMenu_SetFloatingPointEnable (int32_t paramCount, int32_t *params)
 
static nai_status_t naiapp_REFBasicMenu_SetChannelReset (int32_t paramCount, int32_t *params)
 
static nai_status_t naiapp_REFBasicMenu_ChannelStatusEnable (int32_t paramCount, int32_t *params)
 
static nai_status_t Handle_REF_CheckPowerOnBIT (int32_t paramCount, int32_t *params)
 Handle_REF_CheckPowerOnBIT() Checks to see if the power-on BIT test has been run on the module. If the PBIT test has run, it checks the result of the test and reports it back.
 
static nai_status_t Handle_REF_ModulePowerResetMenu (int32_t paramCount, int32_t *p_params)
 Configure_REF_ModulePowerResetMenu displays the menu for module power reset commands.
 
static nai_status_t Handle_REF_ClearModulePowerResetStatus (int32_t paramCount, int32_t *p_params)
 Configure_REF_ClearModulePowerResetStatus handles the user request to clear the module power reset status and calls the method in the naibrd library to clear the module power reset status. The user is prompted for the module power reset status type to clear.
 
static nai_status_t Handle_REF_SetModulePowerReset (int32_t paramCount, int32_t *p_params)
 Configure_REF_SetModulePowerReset handles the user request to set the module power reset request and calls the method in the naibrd library to set the module power reset request. The user is prompted for the module power reset request type to set, and then the user is prompted to set or reset the request bit.
 
static nai_status_t Handle_REF_WatchDogQuietTime (int32_t paramCount, int32_t *params)
 This function sets the watchdog quiet time for the module. The user is prompted for the value in ms.
 
static nai_status_t Handle_REF_WatchDogWindowTime (int32_t paramCount, int32_t *params)
 This function sets the watchdog window time for the module. The user is prompted for the value in ms.
 
static nai_status_t Handle_REF_DisplayWatchdog (int32_t paramCount, int32_t *params)
 This function displays the Watchdog Operations data.
 
static nai_status_t Handle_REF_StrobeWatchdog (int32_t paramCount, int32_t *params)
 This function will start a thread to continuously strobe the watchdog. The user is prompted for the value in ms. NOTE: When this thread/application exits the module will shut off all outputs and will need to be power cycled in order to be operational.
 
static nai_status_t Handle_REF_kill_WDStrobe_Thread (int32_t paramCount, int32_t *params)
 This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.
 
static nai_status_t Handle_REF_WatchdogShowMenu (int32_t paramCount, int32_t *params)
 This function displays the menu for watchdog commands.
 
static void naiapp_kill_WDStrobe_Thread ()
 This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.
 
DWORD WINAPI WD_Strobe_ThreadEntryPoint (LPVOID param) void *WD_Strobe_ThreadEntryPoint(void *param) static int WD_Strobe_ThreadEntryPoint(int32_t param)
 This function will continuously loop, strobing the watchdog every QuietTime + Window/2.
 
void * WD_Strobe_ThreadEntryPoint (void *arg)
 
static int WD_Strobe_ThreadEntryPoint (int32_t nParam)
 
int32_t REF_RunBasicOps (void)
 

Variables

static const int8_t * SAMPLE_PGM_NAME = (const int8_t*)"REF Basic Operations"
 
static const int8_t * DEF_CONFIG_FILE = (const int8_t*)"default_RefBasicOps.txt"
 
static const int8_t * SAMPLE_WD_PGM_NAME = (const int8_t*)"REF Watchdog Operations"
 
naiapp_cmdtbl_params_t REF_BasicOpMenuCmds []
 
naiapp_cmdtbl_params_t REF_LD6_BasicOpMenuCmds []
 
naiapp_cmdtbl_params_t REF_WatchdogOpMenuCmds [REF_COMMON_CMD_WD_COUNT]
 
naiapp_cmdtbl_params_t REF_ModulePowerResetMenuCmds [REF_MODULE_POWER_RESET_CMD_COUNT]
 
static HANDLE thread = NULL
 
static bool_t terminateThread
 

Enumeration Type Documentation

◆ ref_basicOpsMenu_commands

Enumerator
REF_BASICMENU_SET_FREQUENCY 
REF_BASICMENU_SET_VOLTAGE 
REF_BASICMENU_SET_CURRENT_LIMIT 
REF_BASICMENU_SET_OUTPUT_ENABLE 
REF_BASICMENU_SET_FLOATING_POINT_ENABLE 
REF_BASICMENU_SET_CHANNEL_RESET 
REF_BASICMENU_SET_CHANNEL_STATUS_ENABLE 
REF_BASICMENU_WD_MENU 
REF_BASICMENU_SET_PBIT 
REF_BASICMENU_MODULE_POWER_RESET_MENU 
REF_BASICMENU_CMD_COUNT 

◆ ref_gen5_ref_watchdog_commands

Enumerator
REF_COMMON_CMD_WD_QUIETTIME 
REF_COMMON_CMD_WD_WINDOWTIME 
REF_COMMON_CMD_WD_DISPLAY 
REF_COMMON_CMD_WD_STROBE 
REF_COMMON_CMD_WD_KILL 
REF_COMMON_CMD_WD_BACK 
REF_COMMON_CMD_WD_COUNT 

◆ ref_module_power_reset_commands

Enumerator
REF_MODULE_POWER_RESET_CMD_BACK 
REF_MODULE_POWER_RESET_CMD_CLEAR_MODULE_POWER_RESET_STATUS 
REF_MODULE_POWER_RESET_CMD_SET_MODULE_POWER_RESET 
REF_MODULE_POWER_RESET_CMD_COUNT 

Function Documentation

◆ Handle_REF_CheckPowerOnBIT()

static nai_status_t Handle_REF_CheckPowerOnBIT ( int32_t paramCount,
int32_t * params )
static

Handle_REF_CheckPowerOnBIT() Checks to see if the power-on BIT test has been run on the module. If the PBIT test has run, it checks the result of the test and reports it back.

◆ Handle_REF_ClearModulePowerResetStatus()

static nai_status_t Handle_REF_ClearModulePowerResetStatus ( int32_t paramCount,
int32_t * p_params )
static

Configure_REF_ClearModulePowerResetStatus handles the user request to clear the module power reset status and calls the method in the naibrd library to clear the module power reset status. The user is prompted for the module power reset status type to clear.

◆ Handle_REF_DisplayWatchdog()

static nai_status_t Handle_REF_DisplayWatchdog ( int32_t paramCount,
int32_t * params )
static

This function displays the Watchdog Operations data.

◆ Handle_REF_kill_WDStrobe_Thread()

static nai_status_t Handle_REF_kill_WDStrobe_Thread ( int32_t paramCount,
int32_t * params )
static

This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.

◆ Handle_REF_ModulePowerResetMenu()

static nai_status_t Handle_REF_ModulePowerResetMenu ( int32_t paramCount,
int32_t * p_params )
static

Configure_REF_ModulePowerResetMenu displays the menu for module power reset commands.

◆ Handle_REF_SetModulePowerReset()

static nai_status_t Handle_REF_SetModulePowerReset ( int32_t paramCount,
int32_t * p_params )
static

Configure_REF_SetModulePowerReset handles the user request to set the module power reset request and calls the method in the naibrd library to set the module power reset request. The user is prompted for the module power reset request type to set, and then the user is prompted to set or reset the request bit.

◆ Handle_REF_StrobeWatchdog()

static nai_status_t Handle_REF_StrobeWatchdog ( int32_t paramCount,
int32_t * params )
static

This function will start a thread to continuously strobe the watchdog. The user is prompted for the value in ms. NOTE: When this thread/application exits the module will shut off all outputs and will need to be power cycled in order to be operational.

◆ Handle_REF_WatchDogQuietTime()

static nai_status_t Handle_REF_WatchDogQuietTime ( int32_t paramCount,
int32_t * params )
static

This function sets the watchdog quiet time for the module. The user is prompted for the value in ms.

◆ Handle_REF_WatchdogShowMenu()

static nai_status_t Handle_REF_WatchdogShowMenu ( int32_t paramCount,
int32_t * params )
static

This function displays the menu for watchdog commands.

◆ Handle_REF_WatchDogWindowTime()

static nai_status_t Handle_REF_WatchDogWindowTime ( int32_t paramCount,
int32_t * params )
static

This function sets the watchdog window time for the module. The user is prompted for the value in ms.

◆ naiapp_kill_WDStrobe_Thread()

static void naiapp_kill_WDStrobe_Thread ( )
static

This function will terminate the WD strobing thread. Module will shut off outputs at this state and will need to be power cycled to be operational.

◆ naiapp_REFBasicMenu_ChannelStatusEnable()

static nai_status_t naiapp_REFBasicMenu_ChannelStatusEnable ( int32_t paramCount,
int32_t * params )
static

◆ naiapp_REFBasicMenu_DisplayMeasurements()

static bool_t naiapp_REFBasicMenu_DisplayMeasurements ( int32_t cardIndex,
int32_t module,
int32_t maxChannels,
uint32_t modId )
static

◆ naiapp_REFBasicMenu_SetChannelReset()

static nai_status_t naiapp_REFBasicMenu_SetChannelReset ( int32_t paramCount,
int32_t * params )
static

◆ naiapp_REFBasicMenu_SetCurrentLimit()

static nai_status_t naiapp_REFBasicMenu_SetCurrentLimit ( int32_t paramCount,
int32_t * params )
static

◆ naiapp_REFBasicMenu_SetFloatingPointEnable()

static nai_status_t naiapp_REFBasicMenu_SetFloatingPointEnable ( int32_t paramCount,
int32_t * params )
static

◆ naiapp_REFBasicMenu_SetFrequency()

static nai_status_t naiapp_REFBasicMenu_SetFrequency ( int32_t paramCount,
int32_t * params )
static

◆ naiapp_REFBasicMenu_SetOutputEnable()

static nai_status_t naiapp_REFBasicMenu_SetOutputEnable ( int32_t paramCount,
int32_t * params )
static

◆ naiapp_REFBasicMenu_SetVoltage()

static nai_status_t naiapp_REFBasicMenu_SetVoltage ( int32_t paramCount,
int32_t * params )
static

◆ REF_RunBasicOps()

int32_t REF_RunBasicOps ( void )

◆ REFBasicMenu_Run()

static bool_t REFBasicMenu_Run ( int32_t cardIndex,
int32_t module,
uint32_t modid )
static

◆ WD_Strobe_ThreadEntryPoint() [1/3]

static int WD_Strobe_ThreadEntryPoint ( int32_t nParam)
static

◆ WD_Strobe_ThreadEntryPoint() [2/3]

DWORD WINAPI WD_Strobe_ThreadEntryPoint ( LPVOID param)

This function will continuously loop, strobing the watchdog every QuietTime + Window/2.

◆ WD_Strobe_ThreadEntryPoint() [3/3]

void * WD_Strobe_ThreadEntryPoint ( void * arg)

Variable Documentation

◆ DEF_CONFIG_FILE

const int8_t* DEF_CONFIG_FILE = (const int8_t*)"default_RefBasicOps.txt"
static

◆ REF_BasicOpMenuCmds

naiapp_cmdtbl_params_t REF_BasicOpMenuCmds[]
Initial value:
=
{
#if !defined (NAIBSP_CONFIG_SOFTWARE_OS_DEOS)
{"WATCHDOG", "Show Watchdog Menu Options", REF_BASICMENU_WD_MENU, Handle_REF_WatchdogShowMenu},
#endif
{"PBIT", "Check Power-On BIT", REF_BASICMENU_SET_PBIT, Handle_REF_CheckPowerOnBIT},
{"PWRRESET","Show Module Power Reset Menu Options", REF_BASICMENU_MODULE_POWER_RESET_MENU, Handle_REF_ModulePowerResetMenu}
}
static nai_status_t naiapp_REFBasicMenu_SetVoltage(int32_t paramCount, int32_t *params)
Definition ref_basic_ops.c:382
static nai_status_t naiapp_REFBasicMenu_SetCurrentLimit(int32_t paramCount, int32_t *params)
Definition ref_basic_ops.c:412
static nai_status_t naiapp_REFBasicMenu_SetFloatingPointEnable(int32_t paramCount, int32_t *params)
Definition ref_basic_ops.c:473
static nai_status_t Handle_REF_CheckPowerOnBIT(int32_t paramCount, int32_t *params)
Handle_REF_CheckPowerOnBIT() Checks to see if the power-on BIT test has been run on the module....
Definition ref_basic_ops.c:914
@ REF_BASICMENU_WD_MENU
Definition ref_basic_ops.c:69
@ REF_BASICMENU_MODULE_POWER_RESET_MENU
Definition ref_basic_ops.c:71
@ REF_BASICMENU_SET_CURRENT_LIMIT
Definition ref_basic_ops.c:64
@ REF_BASICMENU_SET_CHANNEL_RESET
Definition ref_basic_ops.c:67
@ REF_BASICMENU_SET_OUTPUT_ENABLE
Definition ref_basic_ops.c:65
@ REF_BASICMENU_SET_CHANNEL_STATUS_ENABLE
Definition ref_basic_ops.c:68
@ REF_BASICMENU_SET_VOLTAGE
Definition ref_basic_ops.c:63
@ REF_BASICMENU_SET_FLOATING_POINT_ENABLE
Definition ref_basic_ops.c:66
@ REF_BASICMENU_SET_FREQUENCY
Definition ref_basic_ops.c:62
@ REF_BASICMENU_SET_PBIT
Definition ref_basic_ops.c:70
static nai_status_t naiapp_REFBasicMenu_SetOutputEnable(int32_t paramCount, int32_t *params)
Definition ref_basic_ops.c:442
static nai_status_t Handle_REF_ModulePowerResetMenu(int32_t paramCount, int32_t *p_params)
Configure_REF_ModulePowerResetMenu displays the menu for module power reset commands.
Definition ref_basic_ops.c:969
static nai_status_t Handle_REF_WatchdogShowMenu(int32_t paramCount, int32_t *params)
This function displays the menu for watchdog commands.
Definition ref_basic_ops.c:557
static nai_status_t naiapp_REFBasicMenu_ChannelStatusEnable(int32_t paramCount, int32_t *params)
Definition ref_basic_ops.c:527
static nai_status_t naiapp_REFBasicMenu_SetFrequency(int32_t paramCount, int32_t *params)
Definition ref_basic_ops.c:352
static nai_status_t naiapp_REFBasicMenu_SetChannelReset(int32_t paramCount, int32_t *params)
Definition ref_basic_ops.c:504

◆ REF_LD6_BasicOpMenuCmds

naiapp_cmdtbl_params_t REF_LD6_BasicOpMenuCmds[]

◆ REF_ModulePowerResetMenuCmds

naiapp_cmdtbl_params_t REF_ModulePowerResetMenuCmds[REF_MODULE_POWER_RESET_CMD_COUNT]
Initial value:
=
{
{"BACK", "Back to Main Menu", REF_MODULE_POWER_RESET_CMD_BACK, NULL},
}
static nai_status_t Handle_REF_ClearModulePowerResetStatus(int32_t paramCount, int32_t *p_params)
Configure_REF_ClearModulePowerResetStatus handles the user request to clear the module power reset st...
Definition ref_basic_ops.c:1051
@ REF_MODULE_POWER_RESET_CMD_SET_MODULE_POWER_RESET
Definition ref_basic_ops.c:127
@ REF_MODULE_POWER_RESET_CMD_CLEAR_MODULE_POWER_RESET_STATUS
Definition ref_basic_ops.c:126
@ REF_MODULE_POWER_RESET_CMD_BACK
Definition ref_basic_ops.c:125
static nai_status_t Handle_REF_SetModulePowerReset(int32_t paramCount, int32_t *p_params)
Configure_REF_SetModulePowerReset handles the user request to set the module power reset request and ...
Definition ref_basic_ops.c:1129

◆ REF_WatchdogOpMenuCmds

naiapp_cmdtbl_params_t REF_WatchdogOpMenuCmds[REF_COMMON_CMD_WD_COUNT]
Initial value:
=
{
{"BACK", "Back to Main Menu", 0, NULL},
{"DISPLAY", "Display Watchdog Settings", REF_COMMON_CMD_WD_DISPLAY, Handle_REF_DisplayWatchdog},
{"TIME QUIET", "Set Watchdog Quiet Time", REF_COMMON_CMD_WD_QUIETTIME, Handle_REF_WatchDogQuietTime},
{"WINDOW", "Set Watchdog Window Time", REF_COMMON_CMD_WD_WINDOWTIME, Handle_REF_WatchDogWindowTime},
{"STROBE", "Start thread to continuously strobe watchdog", REF_COMMON_CMD_WD_STROBE, Handle_REF_StrobeWatchdog},
{"KILL", "Kill Watchdog strobing thread", REF_COMMON_CMD_WD_KILL, Handle_REF_kill_WDStrobe_Thread}
}
static nai_status_t Handle_REF_WatchDogWindowTime(int32_t paramCount, int32_t *params)
This function sets the watchdog window time for the module. The user is prompted for the value in ms.
Definition ref_basic_ops.c:648
static nai_status_t Handle_REF_WatchDogQuietTime(int32_t paramCount, int32_t *params)
This function sets the watchdog quiet time for the module. The user is prompted for the value in ms.
Definition ref_basic_ops.c:615
static nai_status_t Handle_REF_StrobeWatchdog(int32_t paramCount, int32_t *params)
This function will start a thread to continuously strobe the watchdog. The user is prompted for the v...
Definition ref_basic_ops.c:718
static nai_status_t Handle_REF_kill_WDStrobe_Thread(int32_t paramCount, int32_t *params)
This function will terminate the WD strobing thread. Module will shut off outputs at this state and w...
Definition ref_basic_ops.c:895
@ REF_COMMON_CMD_WD_WINDOWTIME
Definition ref_basic_ops.c:104
@ REF_COMMON_CMD_WD_DISPLAY
Definition ref_basic_ops.c:105
@ REF_COMMON_CMD_WD_QUIETTIME
Definition ref_basic_ops.c:103
@ REF_COMMON_CMD_WD_STROBE
Definition ref_basic_ops.c:106
@ REF_COMMON_CMD_WD_KILL
Definition ref_basic_ops.c:107
static nai_status_t Handle_REF_DisplayWatchdog(int32_t paramCount, int32_t *params)
This function displays the Watchdog Operations data.
Definition ref_basic_ops.c:682

◆ SAMPLE_PGM_NAME

const int8_t* SAMPLE_PGM_NAME = (const int8_t*)"REF Basic Operations"
static

◆ SAMPLE_WD_PGM_NAME

const int8_t* SAMPLE_WD_PGM_NAME = (const int8_t*)"REF Watchdog Operations"
static

◆ terminateThread

bool_t terminateThread
static

◆ thread

static int thread = NULL
static