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

Enumerations

enum  dif_patterngen_commands {
  DIF_PATTERNGEN_CMD_MODE , DIF_PATTERNGEN_CMD_STARTADDR , DIF_PATTERNGEN_CMD_ENDADDR , DIF_PATTERNGEN_CMD_PERIOD ,
  DIF_PATTERNGEN_CMD_BURSTCOUNT , DIF_PATTERNGEN_CMD_LOAD_DATA , DIF_PATTERNGEN_CMD_ENABLE , DIF_PATTERNGEN_CMD_PAUSE_DATA ,
  DIF_PATTERNGEN_CMD_RESETMODE , DIF_PATTERNGEN_CMD_RESETALL , DIF_PATTERNGEN_CMD_SETALL , DIF_PATTERNGEN_CMD_DISP ,
  DIF_PATTERNGEN_CMD_STATUS , DIF_PATTERNGEN_CMD_LAST
}
 

Functions

void Run_DIF_PatternGenerator (int32_t cardIndex, int32_t module, int32_t ModuleID)
 Run_DIF_PatternGenerator prompts the user for the card, module and channel to use for the application and calls Cfg_DIF_PatternGen_Channel if the card, module, channel is valid for as a TLL module.
 
void Cfg_DIF_PatternGen_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_DIF_PatternGen_Channel handles calling the Display_DIF_PatternGen_ChannelCfg routine to display the DIF channel configuration and calling the routines associated with the user's menu commands.
 
void Display_DIF_PatternGen_ChannelCfg (int32_t cardIndex, int32_t module, int32_t chan, uint32_t ModuleID)
 Display_DIF_PatternGen_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for basic operation.
 
static nai_status_t Configure_DIF_PatternGen_StartAddr (int32_t paramCount, int32_t *p_params)
 Configure_DIF_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_DIF_PatternGen_EndAddr (int32_t paramCount, int32_t *p_params)
 Configure_DIF_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_DIF_PatternGen_Period (int32_t paramCount, int32_t *p_params)
 Configure_DIF_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_DIF_PatternGen_Burstcount (int32_t paramCount, 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_DIF_PatternGen_Mode (int32_t paramCount, int32_t *p_params)
 Configure_DIF_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_DIF_PatternGenArray (int32_t paramCount, int32_t *p_params)
 Load_DIF_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_DIF_ControlEnable (int32_t paramCount, int32_t *p_params)
 Configure_DIF_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_DIF_ControlPause (int32_t paramCount, int32_t *p_params)
 Configure_DIF_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_DIF_PatternGen_Configuration (int32_t paramCount, int32_t *p_params)
 Display_DIF_PatternGen_Configuration illustrate the methods to call in the naibrd library to retrieve the PWM configuration settings.
 
static nai_status_t Display_DIF_Status (int32_t paramCount, int32_t *p_params)
 Display_DSW_Status illustrate the methods to call in the naibrd library to retrieve the status states.
 
int32_t DIF_PatternGenerator (void)
 The purpose of the DIF_PatternGenerator is to illustrate the methods to call in the naibrd library to perform configuration setup for output in Pattern Generator operation mode. Pattern generator period setting is configurable.
 

Variables

static const int8_t * CONFIG_FILE = (int8_t *)"default_DIF_PatternGenerator.txt"
 
static const int32_t DEF_DIF_CARD_INDEX = 0
 
static const int32_t DEF_DIF_MODULE = 1
 
static const int32_t DEF_DIF_CHANNEL = 1
 
naiapp_cmdtbl_params_t DIF_PatternGen_MenuCmds []
 

Enumeration Type Documentation

◆ dif_patterngen_commands

Enumerator
DIF_PATTERNGEN_CMD_MODE 
DIF_PATTERNGEN_CMD_STARTADDR 
DIF_PATTERNGEN_CMD_ENDADDR 
DIF_PATTERNGEN_CMD_PERIOD 
DIF_PATTERNGEN_CMD_BURSTCOUNT 
DIF_PATTERNGEN_CMD_LOAD_DATA 
DIF_PATTERNGEN_CMD_ENABLE 
DIF_PATTERNGEN_CMD_PAUSE_DATA 
DIF_PATTERNGEN_CMD_RESETMODE 
DIF_PATTERNGEN_CMD_RESETALL 
DIF_PATTERNGEN_CMD_SETALL 
DIF_PATTERNGEN_CMD_DISP 
DIF_PATTERNGEN_CMD_STATUS 
DIF_PATTERNGEN_CMD_LAST 

Function Documentation

◆ Cfg_DIF_PatternGen_Channel()

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

Cfg_DIF_PatternGen_Channel handles calling the Display_DIF_PatternGen_ChannelCfg routine to display the DIF channel configuration and calling the routines associated with the user's menu commands.

◆ Configure_DIF_ControlEnable()

static nai_status_t Configure_DIF_ControlEnable ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_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_DIF_ControlPause()

static nai_status_t Configure_DIF_ControlPause ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_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_DIF_PatternGen_Burstcount()

static nai_status_t Configure_DIF_PatternGen_Burstcount ( int32_t paramCount,
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_DIF_PatternGen_EndAddr()

static nai_status_t Configure_DIF_PatternGen_EndAddr ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_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_DIF_PatternGen_Mode()

static nai_status_t Configure_DIF_PatternGen_Mode ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_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_DIF_PatternGen_Period()

nai_status_t Configure_DIF_PatternGen_Period ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_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_DIF_PatternGen_StartAddr()

static nai_status_t Configure_DIF_PatternGen_StartAddr ( int32_t paramCount,
int32_t * p_params )
static

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

◆ DIF_PatternGenerator()

int32_t DIF_PatternGenerator ( void )

The purpose of the DIF_PatternGenerator is to illustrate the methods to call in the naibrd library to perform configuration setup for output in Pattern Generator operation mode. Pattern generator period setting is 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 DIF routines.

  • ClearDeviceCfg
  • QuerySystemCfg
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • SaveDeviceCfg

◆ Display_DIF_PatternGen_ChannelCfg()

void Display_DIF_PatternGen_ChannelCfg ( int32_t cardIndex,
int32_t module,
int32_t chan,
uint32_t ModuleID )

Display_DIF_PatternGen_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for basic operation.

◆ Display_DIF_PatternGen_Configuration()

static nai_status_t Display_DIF_PatternGen_Configuration ( int32_t paramCount,
int32_t * p_params )
static

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

◆ Display_DIF_Status()

static nai_status_t Display_DIF_Status ( int32_t paramCount,
int32_t * p_params )
static

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

◆ Load_DIF_PatternGenArray()

nai_status_t Load_DIF_PatternGenArray ( int32_t paramCount,
int32_t * p_params )
static

Load_DIF_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_DIF_PatternGenerator()

void Run_DIF_PatternGenerator ( int32_t cardIndex,
int32_t module,
int32_t ModuleID )

Run_DIF_PatternGenerator prompts the user for the card, module and channel to use for the application and calls Cfg_DIF_PatternGen_Channel if the card, module, channel is valid for as a TLL module.

Variable Documentation

◆ CONFIG_FILE

const int8_t* CONFIG_FILE = (int8_t *)"default_DIF_PatternGenerator.txt"
static

◆ DEF_DIF_CARD_INDEX

const int32_t DEF_DIF_CARD_INDEX = 0
static

◆ DEF_DIF_CHANNEL

const int32_t DEF_DIF_CHANNEL = 1
static

◆ DEF_DIF_MODULE

const int32_t DEF_DIF_MODULE = 1
static

◆ DIF_PatternGen_MenuCmds

naiapp_cmdtbl_params_t DIF_PatternGen_MenuCmds[]
Initial value:
= {
{"Mode", "DIF Select Pattern Mode", DIF_PATTERNGEN_CMD_MODE, Configure_DIF_PatternGen_Mode},
{"StartAddr", "DIF Set Start Address", DIF_PATTERNGEN_CMD_STARTADDR, Configure_DIF_PatternGen_StartAddr},
{"EndAddr", "DIF Set End Address", DIF_PATTERNGEN_CMD_ENDADDR, Configure_DIF_PatternGen_EndAddr},
{"Period", "DIF Pattern Generator Period", DIF_PATTERNGEN_CMD_PERIOD, Configure_DIF_PatternGen_Period},
{"Count", "DIF Pattern Generator Burst count", DIF_PATTERNGEN_CMD_BURSTCOUNT, Configure_DIF_PatternGen_Burstcount},
{"Load", "DIF Load Pattern Generator Data", DIF_PATTERNGEN_CMD_LOAD_DATA, Load_DIF_PatternGenArray},
{"CONtrol", "DIF Enable or Disable Pattern Generator Output", DIF_PATTERNGEN_CMD_ENABLE, Configure_DIF_ControlEnable},
{"Pause/Play", "DIF Pause or Resume Pattern Gen Output", DIF_PATTERNGEN_CMD_PAUSE_DATA, Configure_DIF_ControlPause},
{"Reset", "DIF Reset Chan Mode, Input", DIF_PATTERNGEN_CMD_RESETMODE, NULL},
{"RAll", "DIF Reset All Channels, Input", DIF_PATTERNGEN_CMD_RESETALL, NULL},
{"SEtall", "DIF Set All Channels to Pattern Gen", DIF_PATTERNGEN_CMD_SETALL, NULL},
{"Display", "DIF Display channel Pattern Generator Info", DIF_PATTERNGEN_CMD_DISP, Display_DIF_PatternGen_Configuration},
{"Stat", "DIF Display Status", DIF_PATTERNGEN_CMD_STATUS, Display_DIF_Status},
}
static nai_status_t Configure_DIF_PatternGen_Period(int32_t paramCount, int32_t *p_params)
Configure_DIF_PatternGen_Period handles the user request to configure the time values for period on t...
Definition dif_pattern_generator.c:574
static nai_status_t Display_DIF_PatternGen_Configuration(int32_t paramCount, int32_t *p_params)
Display_DIF_PatternGen_Configuration illustrate the methods to call in the naibrd library to retrieve...
Definition dif_pattern_generator.c:897
static nai_status_t Configure_DIF_PatternGen_EndAddr(int32_t paramCount, int32_t *p_params)
Configure_DIF_PatternGen_EndAddr handles the user request to configure the time values for period on ...
Definition dif_pattern_generator.c:523
@ DIF_PATTERNGEN_CMD_ENDADDR
Definition dif_pattern_generator.c:47
@ DIF_PATTERNGEN_CMD_MODE
Definition dif_pattern_generator.c:45
@ DIF_PATTERNGEN_CMD_RESETMODE
Definition dif_pattern_generator.c:53
@ DIF_PATTERNGEN_CMD_RESETALL
Definition dif_pattern_generator.c:54
@ DIF_PATTERNGEN_CMD_DISP
Definition dif_pattern_generator.c:56
@ DIF_PATTERNGEN_CMD_STARTADDR
Definition dif_pattern_generator.c:46
@ DIF_PATTERNGEN_CMD_BURSTCOUNT
Definition dif_pattern_generator.c:49
@ DIF_PATTERNGEN_CMD_STATUS
Definition dif_pattern_generator.c:57
@ DIF_PATTERNGEN_CMD_SETALL
Definition dif_pattern_generator.c:55
@ DIF_PATTERNGEN_CMD_PAUSE_DATA
Definition dif_pattern_generator.c:52
@ DIF_PATTERNGEN_CMD_ENABLE
Definition dif_pattern_generator.c:51
@ DIF_PATTERNGEN_CMD_PERIOD
Definition dif_pattern_generator.c:48
@ DIF_PATTERNGEN_CMD_LOAD_DATA
Definition dif_pattern_generator.c:50
static nai_status_t Configure_DIF_ControlEnable(int32_t paramCount, int32_t *p_params)
Configure_DIF_ControlEnable handles the user request to change the switch state for the selected chan...
Definition dif_pattern_generator.c:789
static nai_status_t Load_DIF_PatternGenArray(int32_t paramCount, int32_t *p_params)
Load_DIF_PatternGenArray loads the pattern from a file and illustrate the methods to call in the naib...
Definition dif_pattern_generator.c:716
static nai_status_t Configure_DIF_PatternGen_StartAddr(int32_t paramCount, int32_t *p_params)
Configure_DIF_PatternGen_StartAddr handles the user request to configure the time values for period o...
Definition dif_pattern_generator.c:472
static nai_status_t Configure_DIF_ControlPause(int32_t paramCount, int32_t *p_params)
Configure_DIF_ControlPause handles the user request to change the switch state for the selected chann...
Definition dif_pattern_generator.c:843
static nai_status_t Display_DIF_Status(int32_t paramCount, int32_t *p_params)
Display_DSW_Status illustrate the methods to call in the naibrd library to retrieve the status states...
Definition dif_pattern_generator.c:937
static nai_status_t Configure_DIF_PatternGen_Mode(int32_t paramCount, int32_t *p_params)
Configure_DIF_PatternGen_Mode handles the user request to select the PWM mode for the selected channe...
Definition dif_pattern_generator.c:673
static nai_status_t Configure_DIF_PatternGen_Burstcount(int32_t paramCount, 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 dif_pattern_generator.c:626