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

Enumerations

enum  dt_basic_interrupt_commands {
  DT_SUMMARY_INTERRUPT_CMD_CONFIGURE , DT_SUMMARY_INTERRUPT_CMD_STATUS_READ , DT_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR , DT_SUMMARY_INTERRUPT_CMD_FORCE_ERROR ,
  DT_SUMMARY_INTERRUPT_CMD_COUNT
}
 

Functions

static int32_t Run_DT_Summary (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_DT_Summary prompts the user for the card, module and channel to use for the application and calls Cfg_DT_Channel if the card, module, channel is valid for as a discrete module.
 
static void Cfg_DT_Channel (int32_t cardIndex, int32_t module, int32_t MaxChannel)
 Cfg_DT_Channel handles calling the Display_DT_ChannelCfg routine to display the discrete channel configuration and calling the routines associated with the user's menu commands.
 
static void Verify_DT_ParamCnt (int32_t paramCnt)
 Verify_DT_ParamCnt verifies parameter count and displays error message if invalid.
 
static nai_status_t Display_DT_Status (int32_t paramCnt, int32_t *p_params)
 Display_DT_Status illustrate the methods to call in the naibrd library to retrieve the status states.
 
static nai_status_t Clear_DT_Status (int32_t paramCnt, int32_t *p_params)
 
static nai_status_t Force_BIT_Error (int32_t paramCnt, int32_t *p_params)
 
static nai_status_t Configure_DT_Interrupt (int32_t paramCnt, int32_t *p_params)
 
static void SampleCallBack (uint32_t vector)
 
int32_t dt_summary (void)
 The purpose of the dt_summary example is to illustrate the methods to call in the naibrd library to perform basic operations with the discrete modules for interrupt configuration, reading fault statuses including the summary status register, clearing status bits and forcing a BIT error to observe status bits getting set in both the BIT status and summary registers. 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 in either BIT or over-current status. A latched summary bit can be cleared by writing a '1' to the bit. A BIT error condition can be forced in a DT channel by configuring the IO format for Push-Pull and setting the output state HIGH while an external VCC is unconnected. To demonstrate the aforementioned concepts, the user should run this sample application and enter the following sequence of menu commands (though in reality the user is free to follow any sequence):
 

Variables

static const int8_t * DEF_CONFIG_FILE = (const int8_t *)"default_DT_Summary.txt"
 
static const int32_t DEF_DT_CARD_INDEX = 0
 
static const int32_t DEF_DT_MODULE = 1
 
static const int32_t DEF_DT_CHANNEL = 1
 
static naiapp_cmdtbl_params_t DT_SummaryMenuCmds []
 

Enumeration Type Documentation

◆ dt_basic_interrupt_commands

Enumerator
DT_SUMMARY_INTERRUPT_CMD_CONFIGURE 
DT_SUMMARY_INTERRUPT_CMD_STATUS_READ 
DT_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR 
DT_SUMMARY_INTERRUPT_CMD_FORCE_ERROR 
DT_SUMMARY_INTERRUPT_CMD_COUNT 

Function Documentation

◆ Cfg_DT_Channel()

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

Cfg_DT_Channel handles calling the Display_DT_ChannelCfg routine to display the discrete channel configuration and calling the routines associated with the user's menu commands.

◆ Clear_DT_Status()

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

◆ Configure_DT_Interrupt()

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

◆ Display_DT_Status()

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

Display_DT_Status illustrate the methods to call in the naibrd library to retrieve the status states.

◆ dt_summary()

int32_t dt_summary ( void )

The purpose of the dt_summary example is to illustrate the methods to call in the naibrd library to perform basic operations with the discrete modules for interrupt configuration, reading fault statuses including the summary status register, clearing status bits and forcing a BIT error to observe status bits getting set in both the BIT status and summary registers. 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 in either BIT or over-current status. A latched summary bit can be cleared by writing a '1' to the bit. A BIT error condition can be forced in a DT channel by configuring the IO format for Push-Pull and setting the output state HIGH while an external VCC is unconnected. To demonstrate the aforementioned concepts, the user should run this sample application and enter the following sequence of menu commands (though in reality the user is free to follow any sequence):

clear - to clear all latched status registers (BIT, Overcurrent and Summary statuses) stat - to display all latched statuses int - to configure the interrupt subsystem on the user-selected channel fault - to generate a BIT error on the user-selected channel stat - to display all latched statuses clear - to clear all latched status registers

◆ Force_BIT_Error()

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

◆ Run_DT_Summary()

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

Run_DT_Summary prompts the user for the card, module and channel to use for the application and calls Cfg_DT_Channel if the card, module, channel is valid for as a discrete module.

◆ SampleCallBack()

static void SampleCallBack ( uint32_t vector)
static

◆ Verify_DT_ParamCnt()

static void Verify_DT_ParamCnt ( int32_t paramCnt)
static

Verify_DT_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_DT_Summary.txt"
static

◆ DEF_DT_CARD_INDEX

const int32_t DEF_DT_CARD_INDEX = 0
static

◆ DEF_DT_CHANNEL

const int32_t DEF_DT_CHANNEL = 1
static

◆ DEF_DT_MODULE

const int32_t DEF_DT_MODULE = 1
static

◆ DT_SummaryMenuCmds

naiapp_cmdtbl_params_t DT_SummaryMenuCmds[]
static
Initial value:
= {
{"INT", "DT Configure Interrupt", DT_SUMMARY_INTERRUPT_CMD_CONFIGURE, Configure_DT_Interrupt},
{"FAULT", "DT Force BIT Error", DT_SUMMARY_INTERRUPT_CMD_FORCE_ERROR, Force_BIT_Error},
}
static nai_status_t Force_BIT_Error(int32_t paramCnt, int32_t *p_params)
Definition dt_summary.c:322
static nai_status_t Clear_DT_Status(int32_t paramCnt, int32_t *p_params)
Definition dt_summary.c:296
static nai_status_t Configure_DT_Interrupt(int32_t paramCnt, int32_t *p_params)
Definition dt_summary.c:368
static nai_status_t Display_DT_Status(int32_t paramCnt, int32_t *p_params)
Display_DT_Status illustrate the methods to call in the naibrd library to retrieve the status states.
Definition dt_summary.c:248
@ DT_SUMMARY_INTERRUPT_CMD_CONFIGURE
Definition dt_summary.c:43
@ DT_SUMMARY_INTERRUPT_CMD_FORCE_ERROR
Definition dt_summary.c:46
@ DT_SUMMARY_INTERRUPT_CMD_STATUS_READ
Definition dt_summary.c:44
@ DT_SUMMARY_INTERRUPT_CMD_STATUS_CLEAR
Definition dt_summary.c:45