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

Enumerations

enum  sd_basicOpsMenu_commands {
  SD_BASICMENU_CMD_SET_MODE , SD_BASICMENU_CMD_SET_CHAN_STATUS_ENABLE , SD_BASICMENU_CMD_CLEAR_STATUS , SD_BASICMENU_CMD_SET_SIGLOSS_THRESHOLD ,
  SD_BASICMENU_CMD_SET_REFLOSS_THRESHOLD , SD_BASICMENU_CMD_SET_SIG_HI_THRESHOLD , SD_BASICMENU_CMD_SET_REF_HI_THRESHOLD , SD_BASICMENU_CMD_SET_OPEN_THRESHOLD ,
  SD_BASICMENU_CMD_SET_SHORT_THRESHOLD , SD_BASICMENU_CMD_SET_DELTA_ANGLE , SD_BASICMENU_CMD_INIT_DELTA_ANGLE , SD_BASICMENU_CMD_FLOATING_POINT ,
  SD_BASICMENU_CMD_TEST , SD_BASICMENU_CMD_DISPLAY_CONVERTED , SD_BASICMENU_CMD_DISPLAY_HEX , SD_BASICMENU_CMD_READ_REG ,
  SD_BASICMENU_CMD_WRITE_REG , SD_BASICMENU_CMD_COUNT
}
 
enum  sd_basicOpsMenu_test_commands {
  SD_TESTMENU_CMD_CLEAR_BIT_STATUS , SD_TESTMENU_CMD_SET_BIT_ERROR_LIMIT , SD_TESTMENU_CMD_SET_TEST_ANGLE , SD_TESTMENU_CMD_ENABLE_D0_TEST ,
  SD_TESTMENU_CMD_CHECK_PBIT , SD_TESTMENU_CMD_DISPLAY_CONVERTED , SD_TESTMENU_CMD_DISPLAY_HEX , SD_TESTMENU_CMD_COUNT
}
 

Functions

static bool_t SDBasicMenu_Run (int32_t cardIndex, int32_t module, uint32_t modid)
 SDBasicMenu_Run illustrates the channel configuration and prepares the menu which will handle user command requests. Returns NAI_TRUE if the user enters the Quit Command at any point within its scope.
 
static void SDBasicMenu_displayMeasurements (int32_t cardIndex, int32_t module, uint32_t modid)
 SDBasicMenu_displayMeasurements illustrates the methods to call in the naibrd library to retrieve the basic operation configuration states and status states as well as the current SD reading for all channels.
 
static void SDBasicMenu_displayMode (naibrd_sd_format_t mode)
 SDBasicMenu_displayMode prints mode value.
 
static void SDBasicMenu_displayStatus (nai_status_bit_t BitStatus, nai_status_bit_t SigLoss, nai_status_bit_t RefLoss, nai_status_bit_t LockLossStat, nai_status_bit_t DeltaAngleStat, nai_status_bit_t OpenStat, nai_status_bit_t ShortStat, nai_status_bit_t RefHiStat, nai_status_bit_t SigHiStat, nai_status_bit_t SummaryStatus)
 SDBasicMenu_displayStatus prints to stdin the BIT Status, Signal Fault Low Status, Reference Fault Low Status, Signal Fault High Status, Reference Fault High Status, Two Speed Lock Loss Status, Open Status, Short Status, Delta Angle Status, and Summary Status.
 
static nai_status_t SDBasicMenu_SetMode (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetChanStatusEnable (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_ClearStatus (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetSigLossThreshold (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetRefLossThreshold (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetSigFaultHiThreshold (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetRefFaultHiThreshold (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetOpenThreshold (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetShortThreshold (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_SetDeltaAngle (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_InitDeltaAngle (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_FloatingPointMenu (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_TestMenu (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_ReadReg (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDBasicMenu_WriteReg (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDTestMenu_ClearBITStatus (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDTestMenu_SetBITErrorLimit (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDTestMenu_SetTestAngle (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDTestMenu_SetD0TestEnable (int32_t paramCount, int32_t *p_params)
 
static nai_status_t SDTestMenu_CheckPowerOnBIT (int32_t paramCount, int32_t *p_params)
 
int32_t SD_BasicOpsMenu (void)
 The purpose of the sd_basic_ops is to illustrate the methods to call in the naibrd library to perform basic operations with the SD modules for configuration setup and reading the channels.
 

Variables

static const int8_t * CONFIG_FILE = (const int8_t *)"default_sd_basic_ops.txt"
 
static bool_t DisplayAsHex = NAI_FALSE
 
static uint32_t g_modId = 0u
 
naiapp_cmdtbl_params_t SD_BasicOpMenuCmds []
 
naiapp_cmdtbl_params_t SD_TestMenuCmds []
 

Enumeration Type Documentation

◆ sd_basicOpsMenu_commands

Enumerator
SD_BASICMENU_CMD_SET_MODE 
SD_BASICMENU_CMD_SET_CHAN_STATUS_ENABLE 
SD_BASICMENU_CMD_CLEAR_STATUS 
SD_BASICMENU_CMD_SET_SIGLOSS_THRESHOLD 
SD_BASICMENU_CMD_SET_REFLOSS_THRESHOLD 
SD_BASICMENU_CMD_SET_SIG_HI_THRESHOLD 
SD_BASICMENU_CMD_SET_REF_HI_THRESHOLD 
SD_BASICMENU_CMD_SET_OPEN_THRESHOLD 
SD_BASICMENU_CMD_SET_SHORT_THRESHOLD 
SD_BASICMENU_CMD_SET_DELTA_ANGLE 
SD_BASICMENU_CMD_INIT_DELTA_ANGLE 
SD_BASICMENU_CMD_FLOATING_POINT 
SD_BASICMENU_CMD_TEST 
SD_BASICMENU_CMD_DISPLAY_CONVERTED 
SD_BASICMENU_CMD_DISPLAY_HEX 
SD_BASICMENU_CMD_READ_REG 
SD_BASICMENU_CMD_WRITE_REG 
SD_BASICMENU_CMD_COUNT 

◆ sd_basicOpsMenu_test_commands

Enumerator
SD_TESTMENU_CMD_CLEAR_BIT_STATUS 
SD_TESTMENU_CMD_SET_BIT_ERROR_LIMIT 
SD_TESTMENU_CMD_SET_TEST_ANGLE 
SD_TESTMENU_CMD_ENABLE_D0_TEST 
SD_TESTMENU_CMD_CHECK_PBIT 
SD_TESTMENU_CMD_DISPLAY_CONVERTED 
SD_TESTMENU_CMD_DISPLAY_HEX 
SD_TESTMENU_CMD_COUNT 

Function Documentation

◆ SD_BasicOpsMenu()

int32_t SD_BasicOpsMenu ( void )

The purpose of the sd_basic_ops is to illustrate the methods to call in the naibrd library to perform basic operations with the SD modules for configuration setup and reading the channels.

The following system configuration routines from the nai_sys_cfg.c file are called to assist with the configuration setup for this program prior to calling the naibrd SD routines.

  • ConfigDevice
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • CheckModule

◆ SDBasicMenu_ClearStatus()

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

◆ SDBasicMenu_displayMeasurements()

static void SDBasicMenu_displayMeasurements ( int32_t cardIndex,
int32_t module,
uint32_t modid )
static

SDBasicMenu_displayMeasurements illustrates the methods to call in the naibrd library to retrieve the basic operation configuration states and status states as well as the current SD reading for all channels.

◆ SDBasicMenu_displayMode()

static void SDBasicMenu_displayMode ( naibrd_sd_format_t mode)
static

SDBasicMenu_displayMode prints mode value.

◆ SDBasicMenu_displayStatus()

static void SDBasicMenu_displayStatus ( nai_status_bit_t BitStatus,
nai_status_bit_t SigLoss,
nai_status_bit_t RefLoss,
nai_status_bit_t LockLossStat,
nai_status_bit_t DeltaAngleStat,
nai_status_bit_t OpenStat,
nai_status_bit_t ShortStat,
nai_status_bit_t RefHiStat,
nai_status_bit_t SigHiStat,
nai_status_bit_t SummaryStatus )
static

SDBasicMenu_displayStatus prints to stdin the BIT Status, Signal Fault Low Status, Reference Fault Low Status, Signal Fault High Status, Reference Fault High Status, Two Speed Lock Loss Status, Open Status, Short Status, Delta Angle Status, and Summary Status.

◆ SDBasicMenu_FloatingPointMenu()

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

◆ SDBasicMenu_InitDeltaAngle()

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

◆ SDBasicMenu_ReadReg()

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

◆ SDBasicMenu_Run()

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

SDBasicMenu_Run illustrates the channel configuration and prepares the menu which will handle user command requests. Returns NAI_TRUE if the user enters the Quit Command at any point within its scope.

◆ SDBasicMenu_SetChanStatusEnable()

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

◆ SDBasicMenu_SetDeltaAngle()

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

◆ SDBasicMenu_SetMode()

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

◆ SDBasicMenu_SetOpenThreshold()

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

◆ SDBasicMenu_SetRefFaultHiThreshold()

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

◆ SDBasicMenu_SetRefLossThreshold()

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

◆ SDBasicMenu_SetShortThreshold()

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

◆ SDBasicMenu_SetSigFaultHiThreshold()

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

◆ SDBasicMenu_SetSigLossThreshold()

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

◆ SDBasicMenu_TestMenu()

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

◆ SDBasicMenu_WriteReg()

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

◆ SDTestMenu_CheckPowerOnBIT()

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

◆ SDTestMenu_ClearBITStatus()

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

◆ SDTestMenu_SetBITErrorLimit()

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

◆ SDTestMenu_SetD0TestEnable()

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

◆ SDTestMenu_SetTestAngle()

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

Variable Documentation

◆ CONFIG_FILE

const int8_t* CONFIG_FILE = (const int8_t *)"default_sd_basic_ops.txt"
static

◆ DisplayAsHex

bool_t DisplayAsHex = NAI_FALSE
static

◆ g_modId

uint32_t g_modId = 0u
static

◆ SD_BasicOpMenuCmds

naiapp_cmdtbl_params_t SD_BasicOpMenuCmds[]
Initial value:
= {
{"Enable", "Enable/Disable Channel Status Reporting", SD_BASICMENU_CMD_SET_CHAN_STATUS_ENABLE, SDBasicMenu_SetChanStatusEnable},
{"Clear", "Clear Latched Status", SD_BASICMENU_CMD_CLEAR_STATUS, SDBasicMenu_ClearStatus},
{"LoSig", "Set SD Signal Fault Low Threshold", SD_BASICMENU_CMD_SET_SIGLOSS_THRESHOLD, SDBasicMenu_SetSigLossThreshold},
{"LoRef", "Set SD Reference Fault Low Threshold", SD_BASICMENU_CMD_SET_REFLOSS_THRESHOLD, SDBasicMenu_SetRefLossThreshold},
{"HiSig", "Set SD Signal Fault High Threshold", SD_BASICMENU_CMD_SET_SIG_HI_THRESHOLD, SDBasicMenu_SetSigFaultHiThreshold},
{"HiRef", "Set SD Reference Fault High Threshold", SD_BASICMENU_CMD_SET_REF_HI_THRESHOLD, SDBasicMenu_SetRefFaultHiThreshold},
{"Delta", "Set SD Delta Angle Value", SD_BASICMENU_CMD_SET_DELTA_ANGLE, SDBasicMenu_SetDeltaAngle},
{"Init", "Initialize Delta Angle Status Reporting", SD_BASICMENU_CMD_INIT_DELTA_ANGLE, SDBasicMenu_InitDeltaAngle},
{"Float", "SD Floating-Point Menu", SD_BASICMENU_CMD_FLOATING_POINT, SDBasicMenu_FloatingPointMenu},
{"Test", "SD BIT Test Menu", SD_BASICMENU_CMD_TEST, SDBasicMenu_TestMenu},
{"Converted", "Display Values with Conversion", SD_BASICMENU_CMD_DISPLAY_CONVERTED, NULL},
{"Hex Display", "Display Value as Hex", SD_BASICMENU_CMD_DISPLAY_HEX, NULL},
{"Read", "Read Register", SD_BASICMENU_CMD_READ_REG, SDBasicMenu_ReadReg},
{"Write", "Write Register", SD_BASICMENU_CMD_WRITE_REG, SDBasicMenu_WriteReg}
}
static nai_status_t SDBasicMenu_TestMenu(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1322
static nai_status_t SDBasicMenu_InitDeltaAngle(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1135
static nai_status_t SDBasicMenu_SetSigLossThreshold(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:659
static nai_status_t SDBasicMenu_ClearStatus(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:572
static nai_status_t SDBasicMenu_SetDeltaAngle(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1067
static nai_status_t SDBasicMenu_SetShortThreshold(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:999
static nai_status_t SDBasicMenu_FloatingPointMenu(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1179
static nai_status_t SDBasicMenu_SetSigFaultHiThreshold(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:795
@ SD_BASICMENU_CMD_SET_CHAN_STATUS_ENABLE
Definition sd_basic_ops.c:72
@ SD_BASICMENU_CMD_SET_SIG_HI_THRESHOLD
Definition sd_basic_ops.c:76
@ SD_BASICMENU_CMD_FLOATING_POINT
Definition sd_basic_ops.c:82
@ SD_BASICMENU_CMD_SET_SIGLOSS_THRESHOLD
Definition sd_basic_ops.c:74
@ SD_BASICMENU_CMD_SET_REF_HI_THRESHOLD
Definition sd_basic_ops.c:77
@ SD_BASICMENU_CMD_DISPLAY_CONVERTED
Definition sd_basic_ops.c:84
@ SD_BASICMENU_CMD_SET_REFLOSS_THRESHOLD
Definition sd_basic_ops.c:75
@ SD_BASICMENU_CMD_SET_SHORT_THRESHOLD
Definition sd_basic_ops.c:79
@ SD_BASICMENU_CMD_CLEAR_STATUS
Definition sd_basic_ops.c:73
@ SD_BASICMENU_CMD_WRITE_REG
Definition sd_basic_ops.c:87
@ SD_BASICMENU_CMD_DISPLAY_HEX
Definition sd_basic_ops.c:85
@ SD_BASICMENU_CMD_SET_OPEN_THRESHOLD
Definition sd_basic_ops.c:78
@ SD_BASICMENU_CMD_TEST
Definition sd_basic_ops.c:83
@ SD_BASICMENU_CMD_READ_REG
Definition sd_basic_ops.c:86
@ SD_BASICMENU_CMD_SET_DELTA_ANGLE
Definition sd_basic_ops.c:80
@ SD_BASICMENU_CMD_SET_MODE
Definition sd_basic_ops.c:71
@ SD_BASICMENU_CMD_INIT_DELTA_ANGLE
Definition sd_basic_ops.c:81
static nai_status_t SDBasicMenu_SetMode(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:503
static nai_status_t SDBasicMenu_WriteReg(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1528
static nai_status_t SDBasicMenu_SetRefLossThreshold(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:727
static nai_status_t SDBasicMenu_SetRefFaultHiThreshold(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:863
static nai_status_t SDBasicMenu_SetChanStatusEnable(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:536
static nai_status_t SDBasicMenu_SetOpenThreshold(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:931
static nai_status_t SDBasicMenu_ReadReg(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1462

◆ SD_TestMenuCmds

naiapp_cmdtbl_params_t SD_TestMenuCmds[]
Initial value:
= {
{"Status", "Clear BIT Latched Status", SD_TESTMENU_CMD_CLEAR_BIT_STATUS, SDTestMenu_ClearBITStatus},
{"Angle", "Set SD Test Angle", SD_TESTMENU_CMD_SET_TEST_ANGLE, SDTestMenu_SetTestAngle},
{"Enable", "Enable or Disable D0 Test", SD_TESTMENU_CMD_ENABLE_D0_TEST, SDTestMenu_SetD0TestEnable},
{"Power On", "Check Power-On BIT", SD_TESTMENU_CMD_CHECK_PBIT, SDTestMenu_CheckPowerOnBIT},
{"Converted", "Display Values with Conversion", SD_TESTMENU_CMD_DISPLAY_CONVERTED, NULL},
{"Hex", "Display Values as Hex", SD_TESTMENU_CMD_DISPLAY_HEX, NULL}
}
static nai_status_t SDTestMenu_ClearBITStatus(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1565
static nai_status_t SDTestMenu_SetTestAngle(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1657
static nai_status_t SDTestMenu_SetD0TestEnable(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1724
static nai_status_t SDTestMenu_SetBITErrorLimit(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1589
static nai_status_t SDTestMenu_CheckPowerOnBIT(int32_t paramCount, int32_t *p_params)
Definition sd_basic_ops.c:1758
@ SD_TESTMENU_CMD_SET_BIT_ERROR_LIMIT
Definition sd_basic_ops.c:94
@ SD_TESTMENU_CMD_DISPLAY_CONVERTED
Definition sd_basic_ops.c:98
@ SD_TESTMENU_CMD_SET_TEST_ANGLE
Definition sd_basic_ops.c:95
@ SD_TESTMENU_CMD_CLEAR_BIT_STATUS
Definition sd_basic_ops.c:93
@ SD_TESTMENU_CMD_ENABLE_D0_TEST
Definition sd_basic_ops.c:96
@ SD_TESTMENU_CMD_CHECK_PBIT
Definition sd_basic_ops.c:97
@ SD_TESTMENU_CMD_DISPLAY_HEX
Definition sd_basic_ops.c:99