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

Enumerations

enum  dt_fifo_commands {
  DT_FIFO_CMD_MODE , DT_FIFO_CMD_GET_DATA , DT_FIFO_CMD_FIFO_FREQ , DT_FIFO_CMD_STATUS ,
  DT_FIFO_CMD_FIFO_START , DT_FIFO_CMD_FIFO_STOP , DT_FIFO_CMD_COUNT , DT_FIFO_CMD_FIFO_CLEAR ,
  DT_CMD_DEBOUNCE , DT_FIFO_CMD_LAST
}
 

Functions

static void Verify_DT_ParamCnt (int32_t paramCnt)
 Verify_DT_ParamCnt verifies parameter count and displays error message if invalid.
 
static int32_t Run_DT_FIFO (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_DT_FIFO 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.
 
void Cfg_DT_FIFO_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_DT_FIFO_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 Display_DT_ChannelCfg (int32_t cardIndex, int32_t module, int32_t chan)
 Display_DT_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for measurement operation.
 
static nai_status_t Configure_DT_Counter_Interval (int32_t paramCnt, int32_t *p_params)
 Configure_DT_Counter_Interval will configure DT module gating interval for measurement of counts within the user defined interval.
 
static nai_status_t Configure_DT_FIFO_Mode (int32_t paramCnt, int32_t *p_params)
 Configure_DT_FIFO_Mode handles the user request to select the FIFO mode for the selected channel and calls the method in the naibrd library to set the mode.
 
static nai_status_t Get_DT_FIFO_Data (int32_t paramCnt, int32_t *p_params)
 Get_DT_FIFO_Data reads back the data on the FIFO.
 
static nai_status_t Get_DT_FIFO_Status (int32_t paramCnt, int32_t *p_params)
 Get_DT_FIFO_Status will read back the value of the counter if the FIFO is configured for opmode 6,7, or 8.
 
static nai_status_t Configure_DT_Debounce (int32_t paramCnt, int32_t *p_params)
 Configure_DT_Debounce handles the user request to configure the values for debounce time on the selected channel and calls the method in the naibrd library to set the debounce.
 
int32_t DT_Measure (void)
 The purpose of the DT_Measure 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_Measure.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 const int32_t DEF_DT_KA_CHANNEL = 13
 
static naiapp_cmdtbl_params_t DT_FIFO_MenuCmds []
 

Enumeration Type Documentation

◆ dt_fifo_commands

Enumerator
DT_FIFO_CMD_MODE 
DT_FIFO_CMD_GET_DATA 
DT_FIFO_CMD_FIFO_FREQ 
DT_FIFO_CMD_STATUS 
DT_FIFO_CMD_FIFO_START 
DT_FIFO_CMD_FIFO_STOP 
DT_FIFO_CMD_COUNT 
DT_FIFO_CMD_FIFO_CLEAR 
DT_CMD_DEBOUNCE 
DT_FIFO_CMD_LAST 

Function Documentation

◆ Cfg_DT_FIFO_Channel()

void Cfg_DT_FIFO_Channel ( int32_t cardIndex,
int32_t module,
uint32_t ModuleID,
int32_t MaxChannel )

Cfg_DT_FIFO_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.

◆ Configure_DT_Counter_Interval()

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

Configure_DT_Counter_Interval will configure DT module gating interval for measurement of counts within the user defined interval.

◆ Configure_DT_Debounce()

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

Configure_DT_Debounce handles the user request to configure the values for debounce time on the selected channel and calls the method in the naibrd library to set the debounce.

◆ Configure_DT_FIFO_Mode()

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

Configure_DT_FIFO_Mode handles the user request to select the FIFO mode for the selected channel and calls the method in the naibrd library to set the mode.

◆ Display_DT_ChannelCfg()

static void Display_DT_ChannelCfg ( int32_t cardIndex,
int32_t module,
int32_t chan )
static

Display_DT_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for measurement operation.

◆ DT_Measure()

int32_t DT_Measure ( void )

The purpose of the DT_Measure 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

◆ Get_DT_FIFO_Data()

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

Get_DT_FIFO_Data reads back the data on the FIFO.

◆ Get_DT_FIFO_Status()

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

Get_DT_FIFO_Status will read back the value of the counter if the FIFO is configured for opmode 6,7, or 8.

◆ Run_DT_FIFO()

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

Run_DT_FIFO 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.

◆ 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_Measure.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_KA_CHANNEL

const int32_t DEF_DT_KA_CHANNEL = 13
static

◆ DEF_DT_MODULE

const int32_t DEF_DT_MODULE = 1
static

◆ DT_FIFO_MenuCmds

naiapp_cmdtbl_params_t DT_FIFO_MenuCmds[]
static
Initial value:
= {
{"Mode", "DT Select FIFO Mode", DT_FIFO_CMD_MODE, Configure_DT_FIFO_Mode},
{"Disp", "DT Display FIFO Data", DT_FIFO_CMD_GET_DATA, Get_DT_FIFO_Data},
{"Intv", "DT Set Counter Interval", DT_FIFO_CMD_FIFO_FREQ, Configure_DT_Counter_Interval},
{"Stat", "DT Display FIFO Status", DT_FIFO_CMD_STATUS, Get_DT_FIFO_Status},
{"Go", "DT Start FIFO/Clear count", DT_FIFO_CMD_FIFO_START, NULL},
{"STOP", "DT Stop Measurement", DT_FIFO_CMD_FIFO_STOP, NULL},
{"Count", "DT Display FIFO Count", DT_FIFO_CMD_COUNT, NULL},
{"R", "DT Clear FIFO", DT_FIFO_CMD_FIFO_CLEAR, NULL},
{"Debounce", "DT Set debounce time", DT_CMD_DEBOUNCE, Configure_DT_Debounce}
}
@ DT_FIFO_CMD_FIFO_CLEAR
Definition dt_measure.c:47
@ DT_FIFO_CMD_STATUS
Definition dt_measure.c:43
@ DT_FIFO_CMD_GET_DATA
Definition dt_measure.c:41
@ DT_FIFO_CMD_COUNT
Definition dt_measure.c:46
@ DT_FIFO_CMD_FIFO_START
Definition dt_measure.c:44
@ DT_FIFO_CMD_MODE
Definition dt_measure.c:40
@ DT_FIFO_CMD_FIFO_STOP
Definition dt_measure.c:45
@ DT_FIFO_CMD_FIFO_FREQ
Definition dt_measure.c:42
@ DT_CMD_DEBOUNCE
Definition dt_measure.c:48
static nai_status_t Configure_DT_Counter_Interval(int32_t paramCnt, int32_t *p_params)
Configure_DT_Counter_Interval will configure DT module gating interval for measurement of counts with...
Definition dt_measure.c:526
static nai_status_t Configure_DT_Debounce(int32_t paramCnt, int32_t *p_params)
Configure_DT_Debounce handles the user request to configure the values for debounce time on the selec...
Definition dt_measure.c:678
static nai_status_t Get_DT_FIFO_Data(int32_t paramCnt, int32_t *p_params)
Get_DT_FIFO_Data reads back the data on the FIFO.
Definition dt_measure.c:580
static nai_status_t Get_DT_FIFO_Status(int32_t paramCnt, int32_t *p_params)
Get_DT_FIFO_Status will read back the value of the counter if the FIFO is configured for opmode 6,...
Definition dt_measure.c:635
static nai_status_t Configure_DT_FIFO_Mode(int32_t paramCnt, int32_t *p_params)
Configure_DT_FIFO_Mode handles the user request to select the FIFO mode for the selected channel and ...
Definition dt_measure.c:394