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

Enumerations

enum  ttl_patterngen_commands {
  TTL_PATTERNGEN_CMD_MODE , TTL_PATTERNGEN_CMD_STARTADDR , TTL_PATTERNGEN_CMD_ENDADDR , TTL_PATTERNGEN_CMD_PERIOD ,
  TTL_PATTERNGEN_CMD_BURSTCOUNT , TTL_PATTERNGEN_CMD_LOAD_DATA , TTL_PATTERNGEN_CMD_ENABLE , TTL_PATTERNGEN_CMD_PAUSE_DATA ,
  TTL_PATTERNGEN_CMD_RESETMODE , TTL_PATTERNGEN_CMD_RESETALL , TTL_PATTERNGEN_CMD_SETALL , TTL_PATTERNGEN_CMD_DISP ,
  TTL_PATTERNGEN_CMD_COUNT
}
 

Functions

static int32_t Run_TTL_PatternGenerator (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_TTL_PatternGen prompts the user for the card, module and channel to use for the application and calls Cfg_TTL_PatternGen_Channel if the card, module, channel is valid for as a ttl module.
 
static void Cfg_TTL_PatternGen_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_TTL_PatternGen_Channel handles calling the Display_TTL_PWM_ChannelCfg routine to display the ttl channel configuration and calling the routines associated with the user's menu commands.
 
static void Display_TTL_PatternGen_ChannelCfg (int32_t cardIndex, int32_t module, int32_t chan)
 Display_TTL_PWM_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for PWM operation.
 
static void Verify_TTL_ParamCnt (int32_t paramCnt)
 Verify_TTL_ParamCnt verifies parameter count and displays error message if invalid.
 
static nai_status_t Configure_TTL_PatternGen_StartAddr (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_PatternGen_StartAddr handles the user request to configure the time values for period on the selected channel and calls the method in the naibrd library to set the period.
 
static nai_status_t Configure_TTL_PatternGen_EndAddr (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_PatternGen_EndAddr handles the user request to configure the time values for period on the selected channel and calls the method in the naibrd library to set the period.
 
static nai_status_t Configure_TTL_PatternGen_Period (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_PatternGen_Period handles the user request to configure the time values for period on the selected channel and calls the method in the naibrd library to set the period.
 
static nai_status_t Configure_TTL_PatternGen_Burstcount (int32_t paramCnt, int32_t *p_params)
 Handles the user request to set the burst count value for the number of pulses to be issued upon trigger in PWM burst mode operation on the selected channel, calling the method in the naibrd library to set the burst number.
 
static nai_status_t Configure_TTL_PatternGen_Mode (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_PatternGen_Mode handles the user request to select the PWM mode for the selected channel and calls the method in the naibrd library to set the mode.
 
static nai_status_t Load_TTL_PatternGenArray (int32_t paramCnt, int32_t *p_params)
 Load_TTL_PatternGenArray loads the pattern from a file and illustrate the methods to call in the naibrd library to set the pattern data. Channel independent, array covers all channels.
 
static nai_status_t Configure_TTL_ControlEnable (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_ControlEnable handles the user request to change the switch state for the selected channel and calls the method in the naibrd library to set the state.
 
static nai_status_t Configure_TTL_ControlPause (int32_t paramCnt, int32_t *p_params)
 Configure_TTL_ControlPause handles the user request to change the switch state for the selected channel and calls the method in the naibrd library to set the state.
 
static nai_status_t Display_TTL_PatternGen_Configuration (int32_t paramCnt, int32_t *p_params)
 Display_TTL_PatternGen_Configuration illustrate the methods to call in the naibrd library to retrieve the PWM configuration settings.
 
int32_t TTL_PatternGenerator (void)
 The purpose of the TTL_PatternGen is to illustrate the methods to call in the naibrd library to perform configuration setup for output in PWM operation mode. Pulse period, pulse width, pulse polarity settings are configurable.
 

Variables

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

Enumeration Type Documentation

◆ ttl_patterngen_commands

Enumerator
TTL_PATTERNGEN_CMD_MODE 
TTL_PATTERNGEN_CMD_STARTADDR 
TTL_PATTERNGEN_CMD_ENDADDR 
TTL_PATTERNGEN_CMD_PERIOD 
TTL_PATTERNGEN_CMD_BURSTCOUNT 
TTL_PATTERNGEN_CMD_LOAD_DATA 
TTL_PATTERNGEN_CMD_ENABLE 
TTL_PATTERNGEN_CMD_PAUSE_DATA 
TTL_PATTERNGEN_CMD_RESETMODE 
TTL_PATTERNGEN_CMD_RESETALL 
TTL_PATTERNGEN_CMD_SETALL 
TTL_PATTERNGEN_CMD_DISP 
TTL_PATTERNGEN_CMD_COUNT 

Function Documentation

◆ Cfg_TTL_PatternGen_Channel()

static void Cfg_TTL_PatternGen_Channel ( int32_t cardIndex,
int32_t module,
uint32_t ModuleID,
int32_t MaxChannel )
static

Cfg_TTL_PatternGen_Channel handles calling the Display_TTL_PWM_ChannelCfg routine to display the ttl channel configuration and calling the routines associated with the user's menu commands.

◆ Configure_TTL_ControlEnable()

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

Configure_TTL_ControlEnable handles the user request to change the switch state for the selected channel and calls the method in the naibrd library to set the state.

◆ Configure_TTL_ControlPause()

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

Configure_TTL_ControlPause handles the user request to change the switch state for the selected channel and calls the method in the naibrd library to set the state.

◆ Configure_TTL_PatternGen_Burstcount()

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

Handles the user request to set the burst count value for the number of pulses to be issued upon trigger in PWM burst mode operation on the selected channel, calling the method in the naibrd library to set the burst number.

◆ Configure_TTL_PatternGen_EndAddr()

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

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

◆ Configure_TTL_PatternGen_Mode()

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

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

◆ Configure_TTL_PatternGen_Period()

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

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

◆ Configure_TTL_PatternGen_StartAddr()

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

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

◆ Display_TTL_PatternGen_ChannelCfg()

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

Display_TTL_PWM_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for PWM operation.

◆ Display_TTL_PatternGen_Configuration()

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

Display_TTL_PatternGen_Configuration illustrate the methods to call in the naibrd library to retrieve the PWM configuration settings.

◆ Load_TTL_PatternGenArray()

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

Load_TTL_PatternGenArray loads the pattern from a file and illustrate the methods to call in the naibrd library to set the pattern data. Channel independent, array covers all channels.

◆ Run_TTL_PatternGenerator()

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

Run_TTL_PatternGen prompts the user for the card, module and channel to use for the application and calls Cfg_TTL_PatternGen_Channel if the card, module, channel is valid for as a ttl module.

◆ TTL_PatternGenerator()

int32_t TTL_PatternGenerator ( void )

The purpose of the TTL_PatternGen is to illustrate the methods to call in the naibrd library to perform configuration setup for output in PWM operation mode. Pulse period, pulse width, pulse polarity settings are configurable.

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 TTL 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_PatternGenerator.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_PatternGen_MenuCmds

naiapp_cmdtbl_params_t TTL_PatternGen_MenuCmds[]
static
Initial value:
= {
{"StartAddr", "TTL Set Start Address", TTL_PATTERNGEN_CMD_STARTADDR, Configure_TTL_PatternGen_StartAddr},
{"EndAddr", "TTL Set End Address", TTL_PATTERNGEN_CMD_ENDADDR, Configure_TTL_PatternGen_EndAddr},
{"Period", "TTL Pattern Generator Period", TTL_PATTERNGEN_CMD_PERIOD, Configure_TTL_PatternGen_Period},
{"Count", "TTL Pattern Generator Burst count", TTL_PATTERNGEN_CMD_BURSTCOUNT, Configure_TTL_PatternGen_Burstcount},
{"Load", "TTL Load Pattern Generator Data", TTL_PATTERNGEN_CMD_LOAD_DATA, Load_TTL_PatternGenArray},
{"CONtrol", "TTL Enable or Disable Pattern Generator Output", TTL_PATTERNGEN_CMD_ENABLE, Configure_TTL_ControlEnable},
{"Pause/Play", "TTL Pause or Resume Pattern Gen Output", TTL_PATTERNGEN_CMD_PAUSE_DATA, Configure_TTL_ControlPause},
{"Reset", "TTL Reset Chan Mode, Input", TTL_PATTERNGEN_CMD_RESETMODE, NULL},
{"RAll", "TTL Reset All Channels, Input", TTL_PATTERNGEN_CMD_RESETALL, NULL},
{"SEtall", "TTL Set All Channels to Pattern Gen", TTL_PATTERNGEN_CMD_SETALL, NULL},
{"Display", "TTL Display channel Pattern Generator Info", TTL_PATTERNGEN_CMD_DISP, Display_TTL_PatternGen_Configuration},
}
static nai_status_t Load_TTL_PatternGenArray(int32_t paramCnt, int32_t *p_params)
Load_TTL_PatternGenArray loads the pattern from a file and illustrate the methods to call in the naib...
Definition ttl_pattern_gen.c:662
static nai_status_t Configure_TTL_ControlPause(int32_t paramCnt, int32_t *p_params)
Configure_TTL_ControlPause handles the user request to change the switch state for the selected chann...
Definition ttl_pattern_gen.c:785
static nai_status_t Configure_TTL_PatternGen_EndAddr(int32_t paramCnt, int32_t *p_params)
Configure_TTL_PatternGen_EndAddr handles the user request to configure the time values for period on ...
Definition ttl_pattern_gen.c:501
static nai_status_t Configure_TTL_PatternGen_Period(int32_t paramCnt, int32_t *p_params)
Configure_TTL_PatternGen_Period handles the user request to configure the time values for period on t...
Definition ttl_pattern_gen.c:534
@ TTL_PATTERNGEN_CMD_RESETMODE
Definition ttl_pattern_gen.c:54
@ TTL_PATTERNGEN_CMD_STARTADDR
Definition ttl_pattern_gen.c:47
@ TTL_PATTERNGEN_CMD_SETALL
Definition ttl_pattern_gen.c:56
@ TTL_PATTERNGEN_CMD_RESETALL
Definition ttl_pattern_gen.c:55
@ TTL_PATTERNGEN_CMD_ENABLE
Definition ttl_pattern_gen.c:52
@ TTL_PATTERNGEN_CMD_PERIOD
Definition ttl_pattern_gen.c:49
@ TTL_PATTERNGEN_CMD_MODE
Definition ttl_pattern_gen.c:46
@ TTL_PATTERNGEN_CMD_BURSTCOUNT
Definition ttl_pattern_gen.c:50
@ TTL_PATTERNGEN_CMD_LOAD_DATA
Definition ttl_pattern_gen.c:51
@ TTL_PATTERNGEN_CMD_PAUSE_DATA
Definition ttl_pattern_gen.c:53
@ TTL_PATTERNGEN_CMD_ENDADDR
Definition ttl_pattern_gen.c:48
@ TTL_PATTERNGEN_CMD_DISP
Definition ttl_pattern_gen.c:57
static nai_status_t Display_TTL_PatternGen_Configuration(int32_t paramCnt, int32_t *p_params)
Display_TTL_PatternGen_Configuration illustrate the methods to call in the naibrd library to retrieve...
Definition ttl_pattern_gen.c:839
static nai_status_t Configure_TTL_ControlEnable(int32_t paramCnt, int32_t *p_params)
Configure_TTL_ControlEnable handles the user request to change the switch state for the selected chan...
Definition ttl_pattern_gen.c:731
static nai_status_t Configure_TTL_PatternGen_StartAddr(int32_t paramCnt, int32_t *p_params)
Configure_TTL_PatternGen_StartAddr handles the user request to configure the time values for period o...
Definition ttl_pattern_gen.c:468
static nai_status_t Configure_TTL_PatternGen_Mode(int32_t paramCnt, int32_t *p_params)
Configure_TTL_PatternGen_Mode handles the user request to select the PWM mode for the selected channe...
Definition ttl_pattern_gen.c:620
static nai_status_t Configure_TTL_PatternGen_Burstcount(int32_t paramCnt, int32_t *p_params)
Handles the user request to set the burst count value for the number of pulses to be issued upon trig...
Definition ttl_pattern_gen.c:582