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

Functions

uint32_t BSP_HRTIM_GetTimerFreq (uint32_t TimerIdx)
 Gets the clock frequency of the specific timer in MHz.
 
HRTIM_TimerCfgTypeDef BSP_HRTIM_GetDefaultTimerConfig (timer_frequency_t f, uint32_t TimerIdx)
 Gets the default timer configuration for the HRTIM.
 
HRTIM_CompareCfgTypeDef BSP_HRTIM_GetDefaultCompareConfig (void)
 Gets the default compare configuration for the HRTIM.
 
HRTIM_DeadTimeCfgTypeDef BSP_HRTIM_GetDefaultDeadtimeConfig (void)
 Gets the default dead time configuration for the HRTIM.
 
HRTIM_OutputCfgTypeDef BSP_HRTIM_GetDefaultOutputConfig (void)
 Gets the default output configuration for the HRTIM.
 
IRQn_Type BSP_HRTIM_GetIRQn (uint32_t TimerIdx)
 Gets the IRQ for a timer submodule for HRTIM.
 
void BSP_HRTIM_Init (void)
 Initialize the HRTIM.
 
void BSP_MasterHRTIM_SetShiftValue (hrtim_comp_t comp, uint32_t value)
 Configures the compare value for the HRTIM compare unit. This value can be used to reset the HRTIM submodules at required instances.
 
void BSP_MasterHRTIM_SetShiftPercent (hrtim_opts_t *opts, hrtim_comp_t comp, float percent)
 Configures the compare value for the HRTIM compare. Instead of a value user provides a percentage between 0-1; thus specifying the shift in percentage instead of value for easier computation on user end. This value can be used to reset the HRTIM submodules at required instances.
 
void BSP_TIM2_ConfigFiberRx (tim_trg_in_type_t slaveType, tim_slave_edge_t slaveEdge, tim_out_trigger_config_t *outTrigger, float _fs)
 Configures the Fiber/Sync Rx pin to receive the synchronization event via TIM2 module.
 
void BSP_TIM3_ConfigFiberTx (tim_in_trigger_config_t *inTrigger, tim_out_trigger_config_t *outTrigger, float _fs)
 Configures the Fiber/Sync Tx pin to generate a PWM of required frequency.
 
void BSP_MasterHRTIM_Config (hrtim_opts_t *opts)
 Configures the master timer for HRTIM1 module.
 
void BSP_TIM3_FiberTxStart (bool startHrtimMaster)
 Start the generation of PWM for the TIM3 modules (Fiber/Sync Tx)
 
void BSP_MasterHRTIM_Start (void)
 Use this function to start the Master HRTIM.
 
void BSP_HRTIM_Config_Interrupt (bool enable, PWMResetCallback callback, int priority)
 Enable / Disable interrupt for Master HRTIM unit.
 
void BSP_Timer_SetInputTrigger (TIM_HandleTypeDef *_htim, tim_in_trigger_config_t *_config)
 Set the input trigger of a timer to make it a slave of any of the timer_trigger_src_t.
 
void BSP_Timer_SetOutputTrigger (TIM_HandleTypeDef *_htim, tim_out_trigger_config_t *_config)
 Set the output trigger of a timer to make it a slave of any other timer.
 

Detailed Description

Function Documentation

◆ BSP_HRTIM_Config_Interrupt()

void BSP_HRTIM_Config_Interrupt ( bool  enable,
PWMResetCallback  callback,
int  priority 
)
extern
Parameters
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_HRTIM_GetDefaultCompareConfig()

HRTIM_CompareCfgTypeDef BSP_HRTIM_GetDefaultCompareConfig ( void  )
extern

Default Configuration:

  1. CompareValue = 3
  2. AutoDelayedMode = HRTIM_AUTODELAYEDMODE_REGULAR
Returns
The compare configuration.

◆ BSP_HRTIM_GetDefaultDeadtimeConfig()

HRTIM_DeadTimeCfgTypeDef BSP_HRTIM_GetDefaultDeadtimeConfig ( void  )
extern

Default Configuration:

  1. Prescaler = HRTIM_TIMDEADTIME_PRESCALERRATIO_DIV16
  2. RisingSign = HRTIM_TIMDEADTIME_RISINGSIGN_POSITIVE
  3. FallingSign = HRTIM_TIMDEADTIME_FALLINGSIGN_POSITIVE
Returns
The dead time configuration.

◆ BSP_HRTIM_GetDefaultOutputConfig()

HRTIM_OutputCfgTypeDef BSP_HRTIM_GetDefaultOutputConfig ( void  )
extern

Default Configuration:

  1. Polarity = HRTIM_OUTPUTPOLARITY_HIGH
  2. IdleLevel = HRTIM_OUTPUTIDLELEVEL_INACTIVE
  3. SetSource = HRTIM_OUTPUTSET_TIMCMP1
  4. ResetSource = HRTIM_OUTPUTRESET_TIMCMP2
Returns
The output configuration.

◆ BSP_HRTIM_GetDefaultTimerConfig()

HRTIM_TimerCfgTypeDef BSP_HRTIM_GetDefaultTimerConfig ( timer_frequency_t  f,
uint32_t  TimerIdx 
)
extern

Default Configuration:

  1. StartOnSync = false
  2. ResetOnSync = false
  3. RepetitionUpdate = false
  4. PreloadEnable = true
  5. ResetTrigger = false
  6. ResetUpdate = true
Parameters
fDefines the freuency in Hz.
TimerIdxIndex of the timer submodule.
Returns
Timer configuration.

◆ BSP_HRTIM_GetIRQn()

IRQn_Type BSP_HRTIM_GetIRQn ( uint32_t  TimerIdx)
extern
Parameters
TimerIdxIndex of the timer submodule.
Returns
The IRQn number for the specified submodule.

◆ BSP_HRTIM_GetTimerFreq()

uint32_t BSP_HRTIM_GetTimerFreq ( uint32_t  TimerIdx)
extern
Parameters
TimerIdxIndex of the timer submodule.
Returns
Clock frequency in Hz.

◆ BSP_HRTIM_Init()

void BSP_HRTIM_Init ( void  )

Configures the HRTIM with CPU Clock. The following events are configured.

  1. TIM1_TRG0
  2. TIM2_TRG0
  3. TIM3_TRG0

--------— event

◆ BSP_MasterHRTIM_Config()

void BSP_MasterHRTIM_Config ( hrtim_opts_t opts)
extern

The master timer is used as a support timer, which may be used for synchronizing different HRTIM submodules. This timer can only operate as a master and can only be enabled or reset based upon the TIM1 module. Use the BSP_MasterHRTIM_SetShiftValue() and BSP_MasterHRTIM_SetShiftPercent() functions to configure the trigger delays for other timer modules.

Parameters
optsContains the configuration options for the Master HRTIM.

◆ BSP_MasterHRTIM_SetShiftPercent()

void BSP_MasterHRTIM_SetShiftPercent ( hrtim_opts_t opts,
hrtim_comp_t  comp,
float  percent 
)
extern
Parameters
optsContains the configuration options for the Master HRTIM.
compType of the compare unit.
percentPhase shift in percentage.

◆ BSP_MasterHRTIM_SetShiftValue()

void BSP_MasterHRTIM_SetShiftValue ( hrtim_comp_t  comp,
uint32_t  value 
)
extern
Parameters
compType of the compare unit.
valuePhase shift value to be fed in the compare unit.

◆ BSP_TIM2_ConfigFiberRx()

void BSP_TIM2_ConfigFiberRx ( tim_trg_in_type_t  slaveType,
tim_slave_edge_t  slaveEdge,
tim_out_trigger_config_t outTrigger,
float  _fs 
)
extern
Parameters
slaveTypeControl what to do when signal received on the RX pin
slaveEdgeSelect the rising or falling edge for the RX pin as trigger
outTriggerOutput trigger configuration for the timer. Used to synchronize another timer to the RX signal
_fsRequired frequency at Fiber/Sync RX Pin

◆ BSP_TIM3_ConfigFiberTx()

void BSP_TIM3_ConfigFiberTx ( tim_in_trigger_config_t inTrigger,
tim_out_trigger_config_t outTrigger,
float  _fs 
)
extern
Parameters
inTriggerInput trigger configuration for the timer. Used to synchronize the TX signal to another trigger/Source
outTriggerOutput trigger configuration for the timer. Used to synchronize another timer to the TX signal
_fsRequired frequency at Fiber/Sync TX Pin

◆ BSP_TIM3_FiberTxStart()

void BSP_TIM3_FiberTxStart ( bool  startHrtimMaster)
extern
Parameters
startHrtimMasterMaster HRTIM and TIM3 can also be enabled at the same time via software. To enable this feature pass true in this parameter.

◆ BSP_Timer_SetInputTrigger()

void BSP_Timer_SetInputTrigger ( TIM_HandleTypeDef *  _htim,
tim_in_trigger_config_t _config 
)
extern
Note
Each timer can only be trigger by only a subset of the available options. Invalid selection will throw an error. The following are the trigger options for all available timers.
  1. TIM1: TIM15, TIM2, TIM3, TIM4
  2. TIM2: TIM1, TIM8, TIM3, TIM4, External Pin
  3. TIM3: TIM1, TIM2, TIM15, TIM4
  4. TIM4: TIM1, TIM2, TIM3, TIM8
  5. TIM5: TIM1, TIM8, TIM3, TIM4
  6. TIM8: TIM1, TIM2, TIM4, TIM5
  7. TIM12: TIM4, TIM5
Parameters
_htimHandle of the timer to be configured. (Make sure to initialize this parameter before this function).
_configRequired configuration. If this value is set to NULL the timer will be configured as independent timer.

◆ BSP_Timer_SetOutputTrigger()

void BSP_Timer_SetOutputTrigger ( TIM_HandleTypeDef *  _htim,
tim_out_trigger_config_t _config 
)
extern
Parameters
_htimHandle of the timer to be configured. (Make sure to initialize this parameter before this function).
_configRequired configuration for the output trigger.