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

Enumerations

enum  ttl_fifo_commands {
  TTL_FIFO_CMD_MODE , TTL_FIFO_CMD_GET_DATA , TTL_FIFO_CMD_FIFO_FREQ , TTL_FIFO_CMD_STATUS ,
  TTL_FIFO_CMD_FIFO_START , TTL_FIFO_CMD_FIFO_STOP , TTL_FIFO_CMD_COUNT , TTL_FIFO_CMD_FIFO_CLEAR ,
  TTL_CMD_DEBOUNCE , TTL_FIFO_CMD_LAST
}
 

Functions

static void Verify_TTL_ParamCnt (int32_t paramCnt)
 Verify_TTL_ParamCnt verifies parameter count and displays error message if invalid.
 
static int32_t Run_TTL_FIFO (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_TTL_FIFO prompts the user for the card, module and channel to use for the application and calls Cfg_TTL_Channel if the card, module, channel is valid for as a discrete module.
 
void Cfg_TTL_FIFO_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_TTL_FIFO_Channel handles calling the Display_TTL_ChannelCfg routine to display the discrete channel configuration and calling the routines associated with the user's menu commands.
 
static void Display_TTL_ChannelCfg (int32_t cardIndex, int32_t module, int32_t chan)
 Display_TTL_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for measurement operation.
 
static nai_status_t Configure_TTL_Counter_Interval (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_Counter_Interval will configure DT module gating interval for measurement of counts within the user defined interval.
 
static nai_status_t Configure_TTL_FIFO_Mode (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_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_TTL_FIFO_Data (int32_t paramCnt, int32_t *p_params)
 Get_TTL_FIFO_Data reads back the data on the FIFO.
 
static nai_status_t Get_TTL_FIFO_Status (int32_t paramCnt, int32_t *p_params)
 Get_TTL_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_TTL_Debounce (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_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 TTL_Measure (void)
 The purpose of the TTL_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_TTL_Measure.txt"
 
static const int32_t DEF_TTL_CARD_INDEX = 0
 
static const int32_t DEF_TTL_MODULE = 1
 
static const int32_t DEF_TTL_CHANNEL = 1
 
static naiapp_cmdtbl_params_t TTL_FIFO_MenuCmds []
 

Enumeration Type Documentation

◆ ttl_fifo_commands

Enumerator
TTL_FIFO_CMD_MODE 
TTL_FIFO_CMD_GET_DATA 
TTL_FIFO_CMD_FIFO_FREQ 
TTL_FIFO_CMD_STATUS 
TTL_FIFO_CMD_FIFO_START 
TTL_FIFO_CMD_FIFO_STOP 
TTL_FIFO_CMD_COUNT 
TTL_FIFO_CMD_FIFO_CLEAR 
TTL_CMD_DEBOUNCE 
TTL_FIFO_CMD_LAST 

Function Documentation

◆ Cfg_TTL_FIFO_Channel()

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

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

◆ Configure_TTL_Counter_Interval()

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

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

◆ Configure_TTL_Debounce()

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

Configure_TTL_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_TTL_FIFO_Mode()

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

Configure_TTL_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_TTL_ChannelCfg()

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

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

◆ Get_TTL_FIFO_Data()

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

Get_TTL_FIFO_Data reads back the data on the FIFO.

◆ Get_TTL_FIFO_Status()

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

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

◆ Run_TTL_FIFO()

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

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

◆ TTL_Measure()

int32_t TTL_Measure ( void )

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

◆ Verify_TTL_ParamCnt()

static void Verify_TTL_ParamCnt ( int32_t paramCnt)
static

Verify_TTL_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_TTL_Measure.txt"
static

◆ DEF_TTL_CARD_INDEX

const int32_t DEF_TTL_CARD_INDEX = 0
static

◆ DEF_TTL_CHANNEL

const int32_t DEF_TTL_CHANNEL = 1
static

◆ DEF_TTL_MODULE

const int32_t DEF_TTL_MODULE = 1
static

◆ TTL_FIFO_MenuCmds

naiapp_cmdtbl_params_t TTL_FIFO_MenuCmds[]
static
Initial value:
= {
{"Mode", "TTL Select FIFO Mode", TTL_FIFO_CMD_MODE, Configure_TTL_FIFO_Mode},
{"Disp", "TTL Display FIFO Data", TTL_FIFO_CMD_GET_DATA, Get_TTL_FIFO_Data},
{"Intv", "TTL Set Counter Interval", TTL_FIFO_CMD_FIFO_FREQ, Configure_TTL_Counter_Interval},
{"Stat", "TTL Display FIFO Status", TTL_FIFO_CMD_STATUS, Get_TTL_FIFO_Status},
{"Go", "TTL Start FIFO/Clear count", TTL_FIFO_CMD_FIFO_START, NULL},
{"STOP", "TTL Stop Measurement", TTL_FIFO_CMD_FIFO_STOP, NULL},
{"Count", "TTL Display FIFO Count", TTL_FIFO_CMD_COUNT, NULL},
{"R", "TTL Clear FIFO", TTL_FIFO_CMD_FIFO_CLEAR, NULL},
{"Debounce", "TTL Set debounce time", TTL_CMD_DEBOUNCE, Configure_TTL_Debounce}
}
static nai_status_t Get_TTL_FIFO_Data(int32_t paramCnt, int32_t *p_params)
Get_TTL_FIFO_Data reads back the data on the FIFO.
Definition ttl_measure.c:564
static nai_status_t Configure_TTL_Counter_Interval(int32_t paramCnt, int32_t *p_params)
Configure_TTL_Counter_Interval will configure DT module gating interval for measurement of counts wit...
Definition ttl_measure.c:516
@ TTL_FIFO_CMD_FIFO_FREQ
Definition ttl_measure.c:41
@ TTL_CMD_DEBOUNCE
Definition ttl_measure.c:47
@ TTL_FIFO_CMD_GET_DATA
Definition ttl_measure.c:40
@ TTL_FIFO_CMD_FIFO_START
Definition ttl_measure.c:43
@ TTL_FIFO_CMD_STATUS
Definition ttl_measure.c:42
@ TTL_FIFO_CMD_MODE
Definition ttl_measure.c:39
@ TTL_FIFO_CMD_FIFO_STOP
Definition ttl_measure.c:44
@ TTL_FIFO_CMD_COUNT
Definition ttl_measure.c:45
@ TTL_FIFO_CMD_FIFO_CLEAR
Definition ttl_measure.c:46
static nai_status_t Configure_TTL_Debounce(int32_t paramCnt, int32_t *p_params)
Configure_TTL_Debounce handles the user request to configure the values for debounce time on the sele...
Definition ttl_measure.c:662
static nai_status_t Get_TTL_FIFO_Status(int32_t paramCnt, int32_t *p_params)
Get_TTL_FIFO_Status will read back the value of the counter if the FIFO is configured for opmode 6,...
Definition ttl_measure.c:619
static nai_status_t Configure_TTL_FIFO_Mode(int32_t paramCnt, int32_t *p_params)
Configure_TTL_FIFO_Mode handles the user request to select the FIFO mode for the selected channel and...
Definition ttl_measure.c:384