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

Enumerations

enum  dif_pwm_commands {
  DIF_PWM_CMD_MODE , DIF_PWM_CMD_PERIOD , DIF_PWM_CMD_PULSEWIDTH , DIF_PWM_CMD_BURSTCOUNT ,
  DIF_PWM_CMD_POLARITY , DIF_PWM_CMD_PWM_CFG , DIF_PWM_CMD_PWM_START , DIF_PWM_CMD_PWM_STOP ,
  DIF_PWM_CMD_PWM_DEMO , DIF_PWM_CMD_PWM_INITIAL , DIF_PWM_CMD_STATUS , DIF_PWM_CMD_PWM_BURST ,
  DIF_PWM_CMD_PWM_CONT , DIF_PWM_CMD_COUNT
}
 

Functions

static void Run_DIF_PWM (int32_t cardIndex, int32_t module, int32_t ModuleID)
 Run_DIF_PWM prompts the user for the card, module and channel to use for the application and calls Cfg_DIF_PWM_Channel if the card, module, channel is valid for as a discrete module.
 
static void Cfg_DIF_PWM_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_DIF_PWM_Channel handles calling the Display_DIF_PWM_ChannelCfg routine to display the discrete channel configuration and calling the routines associated with the user's menu commands.
 
static void Display_DIF_PWM_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 Display_DIF_PWM_Configuration (int32_t paramCount, int32_t *p_params)
 Display_DIF_PWM_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.
 
static nai_status_t Configure_DIF_PWM_Mode (int32_t paramCount, int32_t *p_params)
 Configure_DIF_PWM_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 Configure_DIF_PWM_Period (int32_t paramCount, int32_t *p_params)
 Configure_DIF_PWM_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_PWM_Pulsewidth (int32_t paramCount, int32_t *p_params)
 Configure_DIF_PWM_Pulsewidth handles the user request to configure the time values for pulsewidth on the selected channel and calls the method in the naibrd library to set the width.
 
static nai_status_t Configure_DIF_PWM_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_PWM_Polarity (int32_t paramCount, int32_t *p_params)
 Configure_DIF_PWM_Polarity handles the user request to select the PWM output polarity for the selected channel and calls the method in the naibrd library for the setting.
 
int32_t DIF_PWM (void)
 The purpose of the DIF_PWM 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 * CONFIG_FILE = (int8_t *)"default_DIF_PWM.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_PWM_MenuCmds []
 

Enumeration Type Documentation

◆ dif_pwm_commands

Enumerator
DIF_PWM_CMD_MODE 
DIF_PWM_CMD_PERIOD 
DIF_PWM_CMD_PULSEWIDTH 
DIF_PWM_CMD_BURSTCOUNT 
DIF_PWM_CMD_POLARITY 
DIF_PWM_CMD_PWM_CFG 
DIF_PWM_CMD_PWM_START 
DIF_PWM_CMD_PWM_STOP 
DIF_PWM_CMD_PWM_DEMO 
DIF_PWM_CMD_PWM_INITIAL 
DIF_PWM_CMD_STATUS 
DIF_PWM_CMD_PWM_BURST 
DIF_PWM_CMD_PWM_CONT 
DIF_PWM_CMD_COUNT 

Function Documentation

◆ Cfg_DIF_PWM_Channel()

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

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

◆ Configure_DIF_PWM_Burstcount()

nai_status_t Configure_DIF_PWM_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_PWM_Mode()

nai_status_t Configure_DIF_PWM_Mode ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_PWM_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_PWM_Period()

nai_status_t Configure_DIF_PWM_Period ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_PWM_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_PWM_Polarity()

nai_status_t Configure_DIF_PWM_Polarity ( int32_t paramCount,
int32_t * p_params )
static

Configure_DIF_PWM_Polarity handles the user request to select the PWM output polarity for the selected channel and calls the method in the naibrd library for the setting.

◆ Configure_DIF_PWM_Pulsewidth()

nai_status_t Configure_DIF_PWM_Pulsewidth ( int32_t paramCount,
int32_t * p_params )
static

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

◆ DIF_PWM()

int32_t DIF_PWM ( void )

The purpose of the DIF_PWM 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 DIF routines.

  • ClearDeviceCfg
  • QuerySystemCfg
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • SaveDeviceCfg

◆ Display_DIF_PWM_ChannelCfg()

void Display_DIF_PWM_ChannelCfg ( int32_t cardIndex,
int32_t module,
int32_t chan,
uint32_t ModuleID )
static

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

◆ Display_DIF_PWM_Configuration()

nai_status_t Display_DIF_PWM_Configuration ( int32_t paramCount,
int32_t * p_params )
static

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

◆ Run_DIF_PWM()

void Run_DIF_PWM ( int32_t cardIndex,
int32_t module,
int32_t ModuleID )
static

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

Variable Documentation

◆ CONFIG_FILE

const int8_t* CONFIG_FILE = (int8_t *)"default_DIF_PWM.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_PWM_MenuCmds

naiapp_cmdtbl_params_t DIF_PWM_MenuCmds[]
Initial value:
= {
{"Mode", " DIF Select PWM Mode", DIF_PWM_CMD_MODE, Configure_DIF_PWM_Mode},
{"Period", " DIF Set PWM Period", DIF_PWM_CMD_PERIOD, Configure_DIF_PWM_Period},
{"Width", " DIF Set PWM Pulsewidth", DIF_PWM_CMD_PULSEWIDTH, Configure_DIF_PWM_Pulsewidth},
{"Count", " DIF Set PWM burst count", DIF_PWM_CMD_BURSTCOUNT, Configure_DIF_PWM_Burstcount},
{"POlarity", " DIF Set PWM Polarity", DIF_PWM_CMD_POLARITY, Configure_DIF_PWM_Polarity},
{"PM", " DIF Display PWM configuration settings", DIF_PWM_CMD_PWM_CFG, Display_DIF_PWM_Configuration},
{"Trigger", " DIF Start PWM output", DIF_PWM_CMD_PWM_START, NULL},
{"Halt", " DIF Stop PWM output", DIF_PWM_CMD_PWM_STOP, NULL},
{"Demo", " DIF Demo PWM Settings", DIF_PWM_CMD_PWM_DEMO, NULL},
{"Reset", " DIF Reset All Channels to Initial Settings", DIF_PWM_CMD_PWM_INITIAL, NULL},
{"Stat", " DIF Display Status", DIF_PWM_CMD_STATUS, Display_DIF_Status},
{"SETBurst", " DIF Set all channels to PWM Burst", DIF_PWM_CMD_PWM_BURST, NULL},
{"SETCont", " DIF Set all channels to PWM Continuous", DIF_PWM_CMD_PWM_CONT, NULL},
}
static nai_status_t Configure_DIF_PWM_Period(int32_t paramCount, int32_t *p_params)
Configure_DIF_PWM_Period handles the user request to configure the time values for period on the sele...
Definition dif_pwm.c:528
static nai_status_t Configure_DIF_PWM_Polarity(int32_t paramCount, int32_t *p_params)
Configure_DIF_PWM_Polarity handles the user request to select the PWM output polarity for the selecte...
Definition dif_pwm.c:685
static nai_status_t Configure_DIF_PWM_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_pwm.c:635
static nai_status_t Display_DIF_PWM_Configuration(int32_t paramCount, int32_t *p_params)
Display_DIF_PWM_Configuration illustrate the methods to call in the naibrd library to retrieve the PW...
Definition dif_pwm.c:721
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_pwm.c:773
@ DIF_PWM_CMD_MODE
Definition dif_pwm.c:40
@ DIF_PWM_CMD_PWM_BURST
Definition dif_pwm.c:51
@ DIF_PWM_CMD_PWM_START
Definition dif_pwm.c:46
@ DIF_PWM_CMD_PWM_STOP
Definition dif_pwm.c:47
@ DIF_PWM_CMD_PWM_CFG
Definition dif_pwm.c:45
@ DIF_PWM_CMD_PWM_DEMO
Definition dif_pwm.c:48
@ DIF_PWM_CMD_POLARITY
Definition dif_pwm.c:44
@ DIF_PWM_CMD_PERIOD
Definition dif_pwm.c:41
@ DIF_PWM_CMD_PULSEWIDTH
Definition dif_pwm.c:42
@ DIF_PWM_CMD_PWM_INITIAL
Definition dif_pwm.c:49
@ DIF_PWM_CMD_STATUS
Definition dif_pwm.c:50
@ DIF_PWM_CMD_PWM_CONT
Definition dif_pwm.c:52
@ DIF_PWM_CMD_BURSTCOUNT
Definition dif_pwm.c:43
static nai_status_t Configure_DIF_PWM_Mode(int32_t paramCount, int32_t *p_params)
Configure_DIF_PWM_Mode handles the user request to select the PWM mode for the selected channel and c...
Definition dif_pwm.c:480
static nai_status_t Configure_DIF_PWM_Pulsewidth(int32_t paramCount, int32_t *p_params)
Configure_DIF_PWM_Pulsewidth handles the user request to configure the time values for pulsewidth on ...
Definition dif_pwm.c:581