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

Enumerations

enum  sg_basic_interrupt_commands { SG_SUMMARY_INTERRUPT_CMD_CONFIGURE , SG_SUMMARY_INTERRUPT_CMD_STATUS_READ , SG_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR , SG_SUMMARY_INTERRUPT_CMD_COUNT }
 

Functions

static int32_t Run_SG_Summary (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_SG_Summary prompts the user for the card, module and channel to use for the application and calls Cfg_SG_Channel if the card, module, and channel specified are all valid for the SG module.
 
static void Cfg_SG_Channel (int32_t cardIndex, int32_t module, int32_t MaxChannel)
 Cfg_SG_Channel handles calling the Display_SG_ChannelCfg routine to display the strain gauge channel configuration and calling the routines associated with the user's menu commands.
 
static void Verify_SG_ParamCnt (int32_t paramCnt)
 Verify_SG_ParamCnt verifies parameter count and displays error message if invalid.
 
static nai_status_t Display_SG_Status (int32_t paramCnt, int32_t *p_params)
 Display_SG_Status illustrates the methods to call in the naibrd library to retrieve the status states.
 
static nai_status_t Clear_SG_Status (int32_t paramCnt, int32_t *p_params)
 
static nai_status_t Configure_SG_Interrupt (int32_t paramCnt, int32_t *p_params)
 
static void SampleCallBack (uint32_t vector)
 
int32_t sg_summary (void)
 The purpose of the sg_summary example is to illustrate the methods to call in the naibrd library to perform basic operations with strain gauge modules for interrupt configuration, reading fault statuses including the summary status register, and clearing status bits. The summary register is bit-mapped by channel (bit index zero is channel 1) and reports a '1' if the corresponding channel has detected a fault (including BIT). A latched summary bit can be cleared by writing a '1' to the bit.
 

Variables

static const int8_t * DEF_CONFIG_FILE = (const int8_t *)"default_SG_Summary.txt"
 
static const int32_t DEF_SG_CARD_INDEX = 0
 
static const int32_t DEF_SG_MODULE = 1
 
static const int32_t DEF_SG_CHANNEL = 1
 
static naiapp_cmdtbl_params_t SG_SummaryMenuCmds []
 

Enumeration Type Documentation

◆ sg_basic_interrupt_commands

Enumerator
SG_SUMMARY_INTERRUPT_CMD_CONFIGURE 
SG_SUMMARY_INTERRUPT_CMD_STATUS_READ 
SG_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR 
SG_SUMMARY_INTERRUPT_CMD_COUNT 

Function Documentation

◆ Cfg_SG_Channel()

static void Cfg_SG_Channel ( int32_t cardIndex,
int32_t module,
int32_t MaxChannel )
static

Cfg_SG_Channel handles calling the Display_SG_ChannelCfg routine to display the strain gauge channel configuration and calling the routines associated with the user's menu commands.

◆ Clear_SG_Status()

static nai_status_t Clear_SG_Status ( int32_t paramCnt,
int32_t * p_params )
static

◆ Configure_SG_Interrupt()

static nai_status_t Configure_SG_Interrupt ( int32_t paramCnt,
int32_t * p_params )
static

◆ Display_SG_Status()

static nai_status_t Display_SG_Status ( int32_t paramCnt,
int32_t * p_params )
static

Display_SG_Status illustrates the methods to call in the naibrd library to retrieve the status states.

◆ Run_SG_Summary()

static int32_t Run_SG_Summary ( int32_t cardIndex,
int32_t module,
uint32_t modid )
static

Run_SG_Summary prompts the user for the card, module and channel to use for the application and calls Cfg_SG_Channel if the card, module, and channel specified are all valid for the SG module.

◆ SampleCallBack()

static void SampleCallBack ( uint32_t vector)
static

◆ sg_summary()

int32_t sg_summary ( void )

The purpose of the sg_summary example is to illustrate the methods to call in the naibrd library to perform basic operations with strain gauge modules for interrupt configuration, reading fault statuses including the summary status register, and clearing status bits. The summary register is bit-mapped by channel (bit index zero is channel 1) and reports a '1' if the corresponding channel has detected a fault (including BIT). A latched summary bit can be cleared by writing a '1' to the bit.

◆ Verify_SG_ParamCnt()

static void Verify_SG_ParamCnt ( int32_t paramCnt)
static

Verify_SG_ParamCnt verifies parameter count and displays error message if invalid.

Variable Documentation

◆ DEF_CONFIG_FILE

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

◆ DEF_SG_CARD_INDEX

const int32_t DEF_SG_CARD_INDEX = 0
static

◆ DEF_SG_CHANNEL

const int32_t DEF_SG_CHANNEL = 1
static

◆ DEF_SG_MODULE

const int32_t DEF_SG_MODULE = 1
static

◆ SG_SummaryMenuCmds

naiapp_cmdtbl_params_t SG_SummaryMenuCmds[]
static
Initial value:
= {
{"INT", "SG Configure Interrupt", SG_SUMMARY_INTERRUPT_CMD_CONFIGURE, Configure_SG_Interrupt},
}
static nai_status_t Configure_SG_Interrupt(int32_t paramCnt, int32_t *p_params)
Definition sg_summary.c:297
static nai_status_t Display_SG_Status(int32_t paramCnt, int32_t *p_params)
Display_SG_Status illustrates the methods to call in the naibrd library to retrieve the status states...
Definition sg_summary.c:233
static nai_status_t Clear_SG_Status(int32_t paramCnt, int32_t *p_params)
Definition sg_summary.c:275
@ SG_SUMMARY_INTERRUPT_CMD_CONFIGURE
Definition sg_summary.c:42
@ SG_SUMMARY_INTERRUPT_CMD_STATUS_READ
Definition sg_summary.c:43
@ SG_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR
Definition sg_summary.c:44