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

Enumerations

enum  dt_pwm_commands {
  DT_PWM_CMD_MODE , DT_PWM_CMD_PERIOD , DT_PWM_CMD_PULSEWIDTH , DT_PWM_CMD_BURSTCOUNT ,
  DT_PWM_CMD_POLARITY , DT_PWM_CMD_PWM_CFG , DT_PWM_CMD_PWM_START , DT_PWM_CMD_PWM_STOP ,
  DT_PWM_CMD_PWM_DEMO , DT_PWM_CMD_PWM_INITIAL , DT_PWM_CMD_STATUS , DT_PWM_CMD_PWM_BURST ,
  DT_PWM_CMD_PWM_CONT , DT_PWM_CMD_COUNT
}
 

Functions

static void Run_DT_PWM (int32_t cardIndex, int32_t module, uint32_t modid)
 Run_DT_PWM prompts the user for the card, module and channel to use for the application and calls Cfg_DT_PWM_Channel if the card, module, channel is valid for as a discrete module.
 
static void Cfg_DT_PWM_Channel (int32_t cardIndex, int32_t module, uint32_t ModuleID, int32_t MaxChannel)
 Cfg_DT_PWM_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 nai_status_t Display_DT_PWM_Configuration (int32_t paramCnt, int32_t *p_params)
 Display_DT_PWM_Configuration illustrate the methods to call in the naibrd library to retrieve the PWM configuration settings.
 
static nai_status_t Display_DT_Status (int32_t paramCnt, int32_t *p_params)
 Display_DT_Status illustrate the methods to call in the naibrd library to retrieve the status settings.
 
static nai_status_t Configure_DT_PWM_Mode (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_PWM_Polarity (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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.
 
static nai_status_t Configure_DT_PWM_Period (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_PWM_Pulsewidth (int32_t paramCnt, int32_t *p_params)
 Configure_DT_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_DT_PWM_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 void Verify_DT_ParamCnt (int32_t paramCnt)
 Verify_DT_ParamCnt verifies parameter count and displays error message if invalid.
 
int32_t DT_PWM (void)
 The purpose of the DT_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 * DEF_CONFIG_FILE = (const int8_t *)"default_DT_PWM.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_PWM_MenuCmds []
 

Enumeration Type Documentation

◆ dt_pwm_commands

Enumerator
DT_PWM_CMD_MODE 
DT_PWM_CMD_PERIOD 
DT_PWM_CMD_PULSEWIDTH 
DT_PWM_CMD_BURSTCOUNT 
DT_PWM_CMD_POLARITY 
DT_PWM_CMD_PWM_CFG 
DT_PWM_CMD_PWM_START 
DT_PWM_CMD_PWM_STOP 
DT_PWM_CMD_PWM_DEMO 
DT_PWM_CMD_PWM_INITIAL 
DT_PWM_CMD_STATUS 
DT_PWM_CMD_PWM_BURST 
DT_PWM_CMD_PWM_CONT 
DT_PWM_CMD_COUNT 

Function Documentation

◆ Cfg_DT_PWM_Channel()

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

Cfg_DT_PWM_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_PWM_Burstcount()

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

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

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

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

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

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

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

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

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

◆ Display_DT_PWM_Configuration()

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

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

◆ Display_DT_Status()

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

Display_DT_Status illustrate the methods to call in the naibrd library to retrieve the status settings.

◆ DT_PWM()

int32_t DT_PWM ( void )

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

  • ClearDeviceCfg
  • QuerySystemCfg
  • DisplayDeviceCfg
  • GetBoardSNModCfg
  • SaveDeviceCfg

◆ Run_DT_PWM()

static void Run_DT_PWM ( int32_t cardIndex,
int32_t module,
uint32_t modid )
static

Run_DT_PWM prompts the user for the card, module and channel to use for the application and calls Cfg_DT_PWM_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_PWM.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_PWM_MenuCmds

naiapp_cmdtbl_params_t DT_PWM_MenuCmds[]
static
Initial value:
= {
{"Mode", " DT Select PWM Mode", DT_PWM_CMD_MODE, Configure_DT_PWM_Mode},
{"Period", " DT Set PWM Period", DT_PWM_CMD_PERIOD, Configure_DT_PWM_Period},
{"Width", " DT Set PWM Pulsewidth", DT_PWM_CMD_PULSEWIDTH, Configure_DT_PWM_Pulsewidth},
{"Count", " DT Set PWM Burst count", DT_PWM_CMD_BURSTCOUNT, Configure_DT_PWM_Burstcount},
{"POlarity", " DT Set PWM Polarity", DT_PWM_CMD_POLARITY, Configure_DT_PWM_Polarity},
{"PM", " DT Display PWM configuration settings", DT_PWM_CMD_PWM_CFG, Display_DT_PWM_Configuration},
{"Trigger", " DT Start PWM output", DT_PWM_CMD_PWM_START, NULL},
{"Halt", " DT Stop PWM output", DT_PWM_CMD_PWM_STOP, NULL},
{"Demo", " DT Demo PWM Settings", DT_PWM_CMD_PWM_DEMO, NULL},
{"Reset", " DT Reset All Channels to Initial Settings",DT_PWM_CMD_PWM_INITIAL, NULL},
{"Stat", " DT Display Status", DT_PWM_CMD_STATUS, Display_DT_Status},
{"SETBurst", " DT Set all channels to PWM Burst", DT_PWM_CMD_PWM_BURST, NULL},
{"SETCont", " DT Set all channels to PWM Continuous", DT_PWM_CMD_PWM_CONT, NULL},
}
@ DT_PWM_CMD_PWM_CONT
Definition dt_pwm.c:54
@ DT_PWM_CMD_BURSTCOUNT
Definition dt_pwm.c:45
@ DT_PWM_CMD_PWM_START
Definition dt_pwm.c:48
@ DT_PWM_CMD_MODE
Definition dt_pwm.c:42
@ DT_PWM_CMD_PERIOD
Definition dt_pwm.c:43
@ DT_PWM_CMD_PWM_CFG
Definition dt_pwm.c:47
@ DT_PWM_CMD_STATUS
Definition dt_pwm.c:52
@ DT_PWM_CMD_PWM_INITIAL
Definition dt_pwm.c:51
@ DT_PWM_CMD_POLARITY
Definition dt_pwm.c:46
@ DT_PWM_CMD_PWM_STOP
Definition dt_pwm.c:49
@ DT_PWM_CMD_PWM_BURST
Definition dt_pwm.c:53
@ DT_PWM_CMD_PULSEWIDTH
Definition dt_pwm.c:44
@ DT_PWM_CMD_PWM_DEMO
Definition dt_pwm.c:50
static nai_status_t Configure_DT_PWM_Polarity(int32_t paramCnt, int32_t *p_params)
Configure_DT_PWM_Polarity handles the user request to select the PWM output polarity for the selected...
Definition dt_pwm.c:632
static nai_status_t Configure_DT_PWM_Pulsewidth(int32_t paramCnt, int32_t *p_params)
Configure_DT_PWM_Pulsewidth handles the user request to configure the time values for pulsewidth on t...
Definition dt_pwm.c:727
static nai_status_t Configure_DT_PWM_Period(int32_t paramCnt, int32_t *p_params)
Configure_DT_PWM_Period handles the user request to configure the time values for period on the selec...
Definition dt_pwm.c:666
static nai_status_t Configure_DT_PWM_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_pwm.c:788
static nai_status_t Configure_DT_PWM_Mode(int32_t paramCnt, int32_t *p_params)
Configure_DT_PWM_Mode handles the user request to select the PWM mode for the selected channel and ca...
Definition dt_pwm.c:589
static nai_status_t Display_DT_PWM_Configuration(int32_t paramCnt, int32_t *p_params)
Display_DT_PWM_Configuration illustrate the methods to call in the naibrd library to retrieve the PWM...
Definition dt_pwm.c:393
static nai_status_t Display_DT_Status(int32_t paramCnt, int32_t *p_params)
Display_DT_Status illustrate the methods to call in the naibrd library to retrieve the status setting...
Definition dt_pwm.c:440