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

Enumerations

enum  dt_basic_interrupt_commands {
  DT_BASIC_INTERRUPT_CMD_CONFIGURE , DT_BASIC_INTERRUPT_CMD_DISCONNECT , DT_BASIC_INTERRUPT_CMD_STATUS_READ , DT_BASIC_INTERRUPT_CMD_STATUS_CLEAR ,
  DT_BASIC_INTERRUPT_CMD_FORCE_BIT , DT_BASIC_INTERRUPT_CMD_UNFORCE_BIT , DT_BASIC_INTERRUPT_CMD_COUNT
}
 

Functions

static int32_t Run_DT_BasicInterrupt (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_DT_BasicInterrupt 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 Configure_DT_Interrupt (int32_t paramCnt, int32_t *p_params)
 
static nai_status_t Disconnect_DT_Interrupt (int32_t paramCnt, int32_t *p_params)
 
static void SampleCallBack (uint32_t vector)
 
static nai_status_t ForceBIT (int32_t paramCnt, int32_t *p_params)
 
static nai_status_t UnForceBIT (int32_t paramCnt, int32_t *p_params)
 
int32_t DT_BasicInterrupt (void)
 The purpose of the DT_BasicInterrupt is to illustrate the methods to call in the naibrd library to perform basic operations with the discrete modules for configuration setup, controlling the drive outputs, and reading the channels.
 

Variables

static const int8_t * DEF_CONFIG_FILE = (const int8_t *)"default_DT_BasicInterrupt.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_BasicInterruptMenuCmds []
 

Enumeration Type Documentation

◆ dt_basic_interrupt_commands

Enumerator
DT_BASIC_INTERRUPT_CMD_CONFIGURE 
DT_BASIC_INTERRUPT_CMD_DISCONNECT 
DT_BASIC_INTERRUPT_CMD_STATUS_READ 
DT_BASIC_INTERRUPT_CMD_STATUS_CLEAR 
DT_BASIC_INTERRUPT_CMD_FORCE_BIT 
DT_BASIC_INTERRUPT_CMD_UNFORCE_BIT 
DT_BASIC_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

◆ Disconnect_DT_Interrupt()

static nai_status_t Disconnect_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_BasicInterrupt()

int32_t DT_BasicInterrupt ( void )

The purpose of the DT_BasicInterrupt is to illustrate the methods to call in the naibrd library to perform basic operations with the discrete modules for configuration setup, controlling the drive outputs, 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 DT routines.

  • ClearDeviceCfg
  • QuerySystemCfg
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • SaveDeviceCfg

◆ ForceBIT()

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

◆ Run_DT_BasicInterrupt()

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

Run_DT_BasicInterrupt 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

◆ UnForceBIT()

static nai_status_t UnForceBIT ( int32_t paramCnt,
int32_t * p_params )
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_BasicInterrupt.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_BasicInterruptMenuCmds

naiapp_cmdtbl_params_t DT_BasicInterruptMenuCmds[]
static
Initial value:
= {
{"INT", "DT Configure Interrupt", DT_BASIC_INTERRUPT_CMD_CONFIGURE, Configure_DT_Interrupt},
{"STAT", "DT Display Status", DT_BASIC_INTERRUPT_CMD_STATUS_READ, Display_DT_Status},
{"F", "Force BIT Error", DT_BASIC_INTERRUPT_CMD_FORCE_BIT, ForceBIT},
{"UF", "Un-force BIT Error", DT_BASIC_INTERRUPT_CMD_UNFORCE_BIT, UnForceBIT},
{"CLEAR", "DT Clear Status", DT_BASIC_INTERRUPT_CMD_STATUS_CLEAR, Clear_DT_Status},
}
static nai_status_t UnForceBIT(int32_t paramCnt, int32_t *p_params)
Definition dt_basic_interrupt.c:311
static nai_status_t Disconnect_DT_Interrupt(int32_t paramCnt, int32_t *p_params)
Definition dt_basic_interrupt.c:429
static nai_status_t ForceBIT(int32_t paramCnt, int32_t *p_params)
Definition dt_basic_interrupt.c:298
static nai_status_t Clear_DT_Status(int32_t paramCnt, int32_t *p_params)
Definition dt_basic_interrupt.c:324
static nai_status_t Configure_DT_Interrupt(int32_t paramCnt, int32_t *p_params)
Definition dt_basic_interrupt.c:393
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_basic_interrupt.c:249
@ DT_BASIC_INTERRUPT_CMD_STATUS_READ
Definition dt_basic_interrupt.c:47
@ DT_BASIC_INTERRUPT_CMD_UNFORCE_BIT
Definition dt_basic_interrupt.c:50
@ DT_BASIC_INTERRUPT_CMD_DISCONNECT
Definition dt_basic_interrupt.c:46
@ DT_BASIC_INTERRUPT_CMD_CONFIGURE
Definition dt_basic_interrupt.c:45
@ DT_BASIC_INTERRUPT_CMD_STATUS_CLEAR
Definition dt_basic_interrupt.c:48
@ DT_BASIC_INTERRUPT_CMD_FORCE_BIT
Definition dt_basic_interrupt.c:49