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

Enumerations

enum  dt_patterngen_commands {
  DT_PATTERNGEN_CMD_MODE , DT_PATTERNGEN_CMD_STARTADDR , DT_PATTERNGEN_CMD_ENDADDR , DT_PATTERNGEN_CMD_PERIOD ,
  DT_PATTERNGEN_CMD_BURSTCOUNT , DT_PATTERNGEN_CMD_LOAD_DATA , DT_PATTERNGEN_CMD_ENABLE , DT_PATTERNGEN_CMD_PAUSE_DATA ,
  DT_PATTERNGEN_CMD_RESETMODE , DT_PATTERNGEN_CMD_RESETALL , DT_PATTERNGEN_CMD_SETALL , DT_PATTERNGEN_CMD_DISP ,
  DT_PATTERNGEN_CMD_COUNT
}
 

Functions

static int32_t Run_DT_PatternGenerator (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_DT_PatternGen prompts the user for the card, module and channel to use for the application and calls Cfg_DT_PatternGen_Channel if the card, module, channel is valid for as a discrete module.
 
static void Cfg_DT_PatternGen_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_DT_PatternGen_Channel handles calling the Display_DT_PWM_ChannelCfg routine to display the discrete channel configuration and calling the routines associated with the user's menu commands.
 
static void Display_DT_PatternGen_ChannelCfg (int32_t cardIndex, int32_t module, int32_t chan)
 Display_DT_PWM_ChannelCfg illustrate the methods to call in the naibrd library to retrieve the configuration states for PWM operation.
 
static void Verify_DT_ParamCnt (int32_t paramCnt)
 Verify_DT_ParamCnt verifies parameter count and displays error message if invalid.
 
static nai_status_t Configure_DT_PatternGen_StartAddr (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_PatternGen_EndAddr (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_PatternGen_Period (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_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_DT_PatternGen_Mode (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_PatternGenArray (int32_t paramCnt, int32_t *p_params)
 Load_DT_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_DT_ControlEnable (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_ControlPause (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_PatternGen_Configuration (int32_t paramCnt, int32_t *p_params)
 Display_DT_PatternGen_Configuration illustrate the methods to call in the naibrd library to retrieve the PWM configuration settings.
 
int32_t DT_PatternGenerator (void)
 The purpose of the DT_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_DT_PatternGenerator.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_PatternGen_MenuCmds []
 

Enumeration Type Documentation

◆ dt_patterngen_commands

Enumerator
DT_PATTERNGEN_CMD_MODE 
DT_PATTERNGEN_CMD_STARTADDR 
DT_PATTERNGEN_CMD_ENDADDR 
DT_PATTERNGEN_CMD_PERIOD 
DT_PATTERNGEN_CMD_BURSTCOUNT 
DT_PATTERNGEN_CMD_LOAD_DATA 
DT_PATTERNGEN_CMD_ENABLE 
DT_PATTERNGEN_CMD_PAUSE_DATA 
DT_PATTERNGEN_CMD_RESETMODE 
DT_PATTERNGEN_CMD_RESETALL 
DT_PATTERNGEN_CMD_SETALL 
DT_PATTERNGEN_CMD_DISP 
DT_PATTERNGEN_CMD_COUNT 

Function Documentation

◆ Cfg_DT_PatternGen_Channel()

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

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

◆ Configure_DT_ControlEnable()

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

Configure_DT_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_DT_ControlPause()

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

Configure_DT_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_DT_PatternGen_Burstcount()

static nai_status_t Configure_DT_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_DT_PatternGen_EndAddr()

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

Configure_DT_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_DT_PatternGen_Mode()

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

Configure_DT_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_DT_PatternGen_Period()

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

Configure_DT_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_DT_PatternGen_StartAddr()

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

Configure_DT_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_DT_PatternGen_ChannelCfg()

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

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

◆ Display_DT_PatternGen_Configuration()

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

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

◆ DT_PatternGenerator()

int32_t DT_PatternGenerator ( void )

The purpose of the DT_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 DT routines.

  • ClearDeviceCfg
  • QuerySystemCfg
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • SaveDeviceCfg

◆ Load_DT_PatternGenArray()

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

Load_DT_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_DT_PatternGenerator()

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

Run_DT_PatternGen prompts the user for the card, module and channel to use for the application and calls Cfg_DT_PatternGen_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_PatternGenerator.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_PatternGen_MenuCmds

naiapp_cmdtbl_params_t DT_PatternGen_MenuCmds[]
static
Initial value:
= {
{"StartAddr", "DT Set Start Address", DT_PATTERNGEN_CMD_STARTADDR, Configure_DT_PatternGen_StartAddr},
{"EndAddr", "DT Set End Address", DT_PATTERNGEN_CMD_ENDADDR, Configure_DT_PatternGen_EndAddr},
{"Period", "DT Pattern Generator Period", DT_PATTERNGEN_CMD_PERIOD, Configure_DT_PatternGen_Period},
{"Count", "DT Pattern Generator Burst count", DT_PATTERNGEN_CMD_BURSTCOUNT, Configure_DT_PatternGen_Burstcount},
{"Load", "DT Load Pattern Generator Data", DT_PATTERNGEN_CMD_LOAD_DATA, Load_DT_PatternGenArray},
{"CONtrol", "DT Enable or Disable Pattern Generator Output", DT_PATTERNGEN_CMD_ENABLE, Configure_DT_ControlEnable},
{"Pause/Play", "DT Pause or Resume Pattern Gen Output", DT_PATTERNGEN_CMD_PAUSE_DATA, Configure_DT_ControlPause},
{"Reset", "DT Reset Chan Mode, Input", DT_PATTERNGEN_CMD_RESETMODE, NULL},
{"RAll", "DT Reset All Channels, Input", DT_PATTERNGEN_CMD_RESETALL, NULL},
{"SEtall", "DT Set All Channels to Pattern Gen", DT_PATTERNGEN_CMD_SETALL, NULL},
{"Display", "DT Display channel Pattern Generator Info", DT_PATTERNGEN_CMD_DISP, Display_DT_PatternGen_Configuration},
}
@ DT_PATTERNGEN_CMD_PERIOD
Definition dt_pattern_gen.c:50
@ DT_PATTERNGEN_CMD_DISP
Definition dt_pattern_gen.c:58
@ DT_PATTERNGEN_CMD_LOAD_DATA
Definition dt_pattern_gen.c:52
@ DT_PATTERNGEN_CMD_STARTADDR
Definition dt_pattern_gen.c:48
@ DT_PATTERNGEN_CMD_RESETALL
Definition dt_pattern_gen.c:56
@ DT_PATTERNGEN_CMD_ENABLE
Definition dt_pattern_gen.c:53
@ DT_PATTERNGEN_CMD_PAUSE_DATA
Definition dt_pattern_gen.c:54
@ DT_PATTERNGEN_CMD_SETALL
Definition dt_pattern_gen.c:57
@ DT_PATTERNGEN_CMD_ENDADDR
Definition dt_pattern_gen.c:49
@ DT_PATTERNGEN_CMD_MODE
Definition dt_pattern_gen.c:47
@ DT_PATTERNGEN_CMD_BURSTCOUNT
Definition dt_pattern_gen.c:51
@ DT_PATTERNGEN_CMD_RESETMODE
Definition dt_pattern_gen.c:55
static nai_status_t Configure_DT_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 dt_pattern_gen.c:601
static nai_status_t Configure_DT_PatternGen_EndAddr(int32_t paramCnt, int32_t *p_params)
Configure_DT_PatternGen_EndAddr handles the user request to configure the time values for period on t...
Definition dt_pattern_gen.c:520
static nai_status_t Display_DT_PatternGen_Configuration(int32_t paramCnt, int32_t *p_params)
Display_DT_PatternGen_Configuration illustrate the methods to call in the naibrd library to retrieve ...
Definition dt_pattern_gen.c:858
static nai_status_t Configure_DT_PatternGen_Mode(int32_t paramCnt, int32_t *p_params)
Configure_DT_PatternGen_Mode handles the user request to select the PWM mode for the selected channel...
Definition dt_pattern_gen.c:639
static nai_status_t Configure_DT_PatternGen_Period(int32_t paramCnt, int32_t *p_params)
Configure_DT_PatternGen_Period handles the user request to configure the time values for period on th...
Definition dt_pattern_gen.c:553
static nai_status_t Configure_DT_ControlEnable(int32_t paramCnt, int32_t *p_params)
Configure_DT_ControlEnable handles the user request to change the switch state for the selected chann...
Definition dt_pattern_gen.c:750
static nai_status_t Configure_DT_PatternGen_StartAddr(int32_t paramCnt, int32_t *p_params)
Configure_DT_PatternGen_StartAddr handles the user request to configure the time values for period on...
Definition dt_pattern_gen.c:487
static nai_status_t Configure_DT_ControlPause(int32_t paramCnt, int32_t *p_params)
Configure_DT_ControlPause handles the user request to change the switch state for the selected channe...
Definition dt_pattern_gen.c:804
static nai_status_t Load_DT_PatternGenArray(int32_t paramCnt, int32_t *p_params)
Load_DT_PatternGenArray loads the pattern from a file and illustrate the methods to call in the naibr...
Definition dt_pattern_gen.c:681