PEController BSP v4
Board Support Package for PEController from Taraz Technologies
 
Loading...
Searching...
No Matches
Functions

Functions

DutyCycleUpdateFnc BSP_PWM_ConfigInvertedPair (uint16_t pwmNo, pwm_config_t *config)
 Configures an PWM pair as inverted pair.
 
DutyCycleUpdateFnc BSP_PWM_ConfigChannel (uint16_t pwmNo, pwm_config_t *config)
 Configures a PWM channel.
 
float BSP_PWM_UpdatePairDuty (uint32_t pwmNo, float duty, pwm_config_t *config)
 Update the Duty Cycle of an Inverted Pair.
 
float BSP_PWM_UpdateChannelDuty (uint32_t pwmNo, float duty, pwm_config_t *config)
 Update the Duty Cycle of a channel.
 
void BSP_PWM_Config_Interrupt (uint32_t pwmNo, bool enable, PWMResetCallback callback, int priority)
 Enable / Disable interrupt for a PWM channel as per requirement.
 
void BSP_PWM_Start (uint32_t pwmMask, bool masterHRTIM)
 Starts the PWM on required PWM pins. To enable outputs for required channels call BSP_PWMOut_Enable().
 
void BSP_PWM_Stop (uint32_t pwmMask, bool masterHRTIM)
 Stops the PWM on required PWM pins.
 
void BSP_PWM_GetDafaultModuleConfig (pwm_module_config_t *moduleConfig)
 Populates the provided pwm_module_config_t parameter with the default configuration.
 
void BSP_PWM_GetDefaultConfig (pwm_config_t *pwmConfig, pwm_module_config_t *moduleConfig)
 Populates the provided pwm_config_t parameter with the default configuration.
 
void BSP_PWMOut_Enable (uint32_t pwmMask, bool en)
 Enable / disable the output for required PWM channels.
 
static bool IsDeadtimeEnabled (deadtime_t *dt)
 Checks if the dead time is enabled for the PWM.
 

Detailed Description

Function Documentation

◆ BSP_PWM_Config_Interrupt()

void BSP_PWM_Config_Interrupt ( uint32_t  pwmNo,
bool  enable,
PWMResetCallback  callback,
int  priority 
)
extern
Parameters
pwmNoChannel no of the PWM Channel (Range 1-16)
enableIf enable interrupt set this parameter to true
callbackSpecifies the function to be called when the PWM is reset
priorityInterrupt priority. Range (0-15). Here 0 is the highest priority

◆ BSP_PWM_ConfigChannel()

DutyCycleUpdateFnc BSP_PWM_ConfigChannel ( uint16_t  pwmNo,
pwm_config_t config 
)
extern
Parameters
pwmNoPWM channel to be configured (Valid Values 1-16)
*configPointer to a pwm_config_t structure that contains the configuration parameters for the PWM pair
Returns
DutyCycleUpdateFnc Returns the function pointer of the type DutyCycleUpdateFnc which needs to be called whenever the duty cycles of the pair need to be updated

◆ BSP_PWM_ConfigInvertedPair()

DutyCycleUpdateFnc BSP_PWM_ConfigInvertedPair ( uint16_t  pwmNo,
pwm_config_t config 
)
extern
Parameters
pwmNoChannel no of reference channel is the PWM pair (Valid Values 1-16).
Pairs are classified as :
  1. CH1 = Reference channel available at pin pwmNo
  2. CH2 = Inverted Channel from reference available at pin pwmNo + 1 if pwmNo is odd else pwmNo - 1
configPointer to a pwm_config_t structure that contains the configuration parameters for the PWM pair
Returns
DutyCycleUpdateFnc Returns the function pointer of the type DutyCycleUpdateFnc which needs to be called whenever the duty cycles of the pair need to be updated

◆ BSP_PWM_GetDafaultModuleConfig()

void BSP_PWM_GetDafaultModuleConfig ( pwm_module_config_t moduleConfig)
extern

Default Configuration:

  1. alignment = CENTER_ALIGNED
  2. deadtime.on = false
  3. deadtime.nanoSec = 1000
  4. f = 25000Hz
Parameters
moduleConfigmodule configuration to be updated

◆ BSP_PWM_GetDefaultConfig()

void BSP_PWM_GetDefaultConfig ( pwm_config_t pwmConfig,
pwm_module_config_t moduleConfig 
)
extern

Default Configuration:

  1. dutyMode = OUTPUT_DUTY_AT_PWMH
  2. lim.min = 0
  3. lim.max = 1
  4. lim.minMaxDutyCycleBalancing = false
  5. slaveOpts = NULL
    Parameters
    pwmConfigPWM configuration structure to be updated
    moduleConfigmodule configuration used by this module. Make sure to call BSP_PWM_GetDafaultModuleConfig() before calling this function

◆ BSP_PWM_Start()

void BSP_PWM_Start ( uint32_t  pwmMask,
bool  masterHRTIM 
)
extern
// Start PWM for channel 1
BSP_PWM_Start(0x1, true);
// Start PWM for channel 1 and channel 2
BSP_PWM_Start(0x3, false);
// Start PWM for channel n and channel m, where n & m are between 1 & 16
BSP_PWM_Start((1U << (n - 1)) | (1U << (m - 1)), bool);
void BSP_PWM_Start(uint32_t pwmMask, bool masterHRTIM)
Starts the PWM on required PWM pins. To enable outputs for required channels call BSP_PWMOut_Enable()...
Definition pecontroller_pwm.c:196
Parameters
pwmMaskSet the PWM channels needed to be run.
Valid Range = (0x0001 - 0xffff)
masterHRTIMtrue if masterHRTIM to be enabled synchronously else false

◆ BSP_PWM_Stop()

void BSP_PWM_Stop ( uint32_t  pwmMask,
bool  masterHRTIM 
)
extern
// Stop PWM for channel 1
BSP_PWM_Stop(0x1, false);
// Stop PWM for channel 1 and channel 2
BSP_PWM_Stop(0x3, false);
// Stop PWM for channel n and channel m, where n & m are between 1 & 16
BSP_PWM_Stop((1U << (n - 1)) | (1U << (m - 1)), bool);
void BSP_PWM_Stop(uint32_t pwmMask, bool masterHRTIM)
Stops the PWM on required PWM pins.
Definition pecontroller_pwm.c:236
Parameters
pwmMaskSet the PWM channels needed to be stopped.
Valid Range = (0x0001 - 0xffff)
masterHRTIMtrue if masterHRTIM to be disabled synchronously else false

◆ BSP_PWM_UpdateChannelDuty()

float BSP_PWM_UpdateChannelDuty ( uint32_t  pwmNo,
float  duty,
pwm_config_t config 
)
extern
Parameters
pwmNoPWM channel to be configured (Valid Values 1-16)
dutyduty cycle to be applied to the channel (Range 0-1 or given in the config parameter)
*configPointer to a pwm_config_t structure that contains the configuration parameters for the PWM channel
Returns
float Duty cycle applied in this cycle. May differ from the duty variable if outside permitted limits

◆ BSP_PWM_UpdatePairDuty()

float BSP_PWM_UpdatePairDuty ( uint32_t  pwmNo,
float  duty,
pwm_config_t config 
)
extern
Parameters
pwmNoChannel no of reference channel is the PWM pair (Valid Values 1-16).
Pairs are classified as :
  1. CH1 = Reference channel available at pin pwmNo
  2. CH2 = Inverted Channel from reference available at pin pwmNo + 1 if pwmNo is odd else pwmNo - 1
dutyduty cycle to be applied to the pair (Range 0-1 or given in the config parameter)
*configPointer to a pwm_config_t structure that contains the configuration parameters for the PWM pair
Returns
float Duty cycle applied in this cycle. May differ from the duty variable if outside permitted limits

◆ BSP_PWMOut_Enable()

void BSP_PWMOut_Enable ( uint32_t  pwmMask,
bool  en 
)
extern
// Enable PWM output for channel 1
BSP_PWMOut_Enable(0x1, true);
// Enable PWM output for channel 1 and channel 2
BSP_PWMOut_Enable(0x3, true);
// Disable PWM output for channel n and channel m, where n & m are between 1 & 16
BSP_PWMOut_Enable((1U << (n - 1)) | (1U << (m - 1)), false);
void BSP_PWMOut_Enable(uint32_t pwmMask, bool en)
Enable / disable the output for required PWM channels.
Definition pecontroller_pwm.c:333
Parameters
pwmMaskSet the PWM channels needed to be run.
Valid Range = (0x0001 - 0xffff)
entrue if needs to be enabled else false

◆ IsDeadtimeEnabled()

static bool IsDeadtimeEnabled ( deadtime_t dt)
inlinestatic
Parameters
*dtPointer to the dead time structure
Returns
bool true if enabled for the specified PWM else false