Macros | Functions | Variables
stm32f30x_hrtim.c File Reference

HRTIMx module driver. More...

#include "stm32f30x_hrtim.h"
Include dependency graph for stm32f30x_hrtim.c:

Go to the source code of this file.

Macros

#define HRTIM_FLTR_FLTxEN
 
#define HRTIM_TIM_OFFSET   (uint32_t)0x00000080
 
#define HRTIM_TIMCR_TIMUPDATETRIGGER
 

Functions

void HRTIM_ADCTriggerConfig (HRTIM_TypeDef *HRTIMx, uint32_t ADCTrigger, HRTIM_ADCTriggerCfgTypeDef *pADCTriggerCfg)
 Configures both the ADC trigger register update source and the ADC trigger source. More...
 
void HRTIM_BurstDMAConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t RegistersToUpdate)
 Configures the burst DMA controller for a timer. More...
 
void HRTIM_BurstModeConfig (HRTIM_TypeDef *HRTIMx, HRTIM_BurstModeCfgTypeDef *pBurstModeCfg)
 Configures the burst mode feature of the HRTIMx. More...
 
void HRTIM_BurstModeCtl (HRTIM_TypeDef *HRTIMx, uint32_t Enable)
 Enables or disables the HRTIMx burst mode controller. More...
 
static void HRTIM_CaptureUnitConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit, uint32_t Event)
 Configures a capture unit. More...
 
void HRTIM_ChopperModeConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_ChopperModeCfgTypeDef *pChopperModeCfg)
 Configures the chopper mode feature for a timer. More...
 
void HRTIM_ClearCommonFlag (HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonFLAG)
 Clears the common interrupt flags. More...
 
void HRTIM_ClearCommonITPendingBit (HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonIT)
 Clears the common interrupt pending bits. More...
 
void HRTIM_ClearFlag (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_FLAG)
 Clears the Master and slaves interrupt flags. More...
 
void HRTIM_ClearITPendingBit (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT)
 Clears the Master and slaves interrupt request pending bits. More...
 
static void HRTIM_CompareUnitConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CompareUnit, HRTIM_CompareCfgTypeDef *pCompareCfg)
 Configures a compare unit. More...
 
void HRTIM_DeadTimeConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_DeadTimeCfgTypeDef *pDeadTimeCfg)
 Configures the dead time insertion feature for a timer. More...
 
void HRTIM_DeInit (HRTIM_TypeDef *HRTIMx)
 De-initializes a timer operating in all mode. More...
 
void HRTIM_DLLCalibrationStart (HRTIM_TypeDef *HRTIMx, uint32_t CalibrationRate)
 Starts the DLL calibration. More...
 
void HRTIM_DMACmd (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_DMA, FunctionalState NewState)
 Enables or disables the HRTIMx's DMA Requests. More...
 
void HRTIM_EventConfig (HRTIM_TypeDef *HRTIMx, uint32_t Event, HRTIM_EventCfgTypeDef *pEventCfg)
 Configures the conditioning of an external event. More...
 
void HRTIM_EventPrescalerConfig (HRTIM_TypeDef *HRTIMx, uint32_t Prescaler)
 Configures the external event conditioning block prescaler. More...
 
static void HRTIM_ExternalEventConfig (HRTIM_TypeDef *HRTIMx, uint32_t Event, HRTIM_EventCfgTypeDef *pEventCfg)
 Configures an external event channel. More...
 
void HRTIM_FaultConfig (HRTIM_TypeDef *HRTIMx, HRTIM_FaultCfgTypeDef *pFaultCfg, uint32_t Fault)
 Configures the conditioning of fault input. More...
 
void HRTIM_FaultModeCtl (HRTIM_TypeDef *HRTIMx, uint32_t Fault, uint32_t Enable)
 Enables or disables the HRTIMx Fault mode. More...
 
void HRTIM_FaultPrescalerConfig (HRTIM_TypeDef *HRTIMx, uint32_t Prescaler)
 Configures the fault conditioning block prescaler. More...
 
uint32_t HRTIM_GetBurstStatus (HRTIM_TypeDef *HRTIMx)
 Returns the actual status (active or inactive) of the burst mode controller. More...
 
uint32_t HRTIM_GetCapturedValue (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit)
 Returns actual value of the capture register of the designated capture unit. More...
 
FlagStatus HRTIM_GetCommonFlagStatus (HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonFLAG)
 Checks whether the specified HRTIM common flag is set or not. More...
 
ITStatus HRTIM_GetCommonITStatus (HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonIT)
 Checks whether the specified HRTIM common interrupt has occurred or not. More...
 
uint32_t HRTIM_GetCurrentPushPullStatus (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
 Indicates on which output the signal is currently active (when the push pull mode is enabled) More...
 
uint32_t HRTIM_GetDelayedProtectionStatus (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output)
 Returns the level (active or inactive) of the designated output when the delayed protection was triggered. More...
 
FlagStatus HRTIM_GetFlagStatus (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_FLAG)
 Checks whether the specified HRTIM flag is set or not. More...
 
uint32_t HRTIM_GetIdlePushPullStatus (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
 Indicates on which output the signal was applied, in push-pull mode balanced fault mode or delayed idle mode, when the protection was triggered. More...
 
ITStatus HRTIM_GetITStatus (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT)
 Checks whether the specified HRTIM interrupt has occurred or not. More...
 
void HRTIM_ITCommonConfig (HRTIM_TypeDef *HRTIMx, uint32_t HRTIM_CommonIT, FunctionalState NewState)
 Enables or disables the common interrupt request. More...
 
void HRTIM_ITConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t HRTIM_IT, FunctionalState NewState)
 Enables or disables the Master and slaves interrupt request. More...
 
static void HRTIM_MasterBase_Config (HRTIM_TypeDef *HRTIMx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
 Configures the master timer time base. More...
 
void HRTIM_MasterSetCompare (HRTIM_TypeDef *HRTIMx, uint32_t CompareUnit, uint32_t Compare)
 Sets the HRTIMx Master Comparex Register value. More...
 
static void HRTIM_MasterWaveform_Config (HRTIM_TypeDef *HRTIMx, HRTIM_TimerInitTypeDef *pTimerInit)
 Configures the master timer in waveform mode. More...
 
static void HRTIM_OutputConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output, HRTIM_OutputCfgTypeDef *pOutputCfg)
 Configures the output of a timing unit. More...
 
void HRTIM_SimpleBase_Init (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
 Initializes the HRTIMx timer in basic time base mode. More...
 
void HRTIM_SimpleBaseStart (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
 Starts the counter of a timer operating in basic time base mode. More...
 
void HRTIM_SimpleBaseStop (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx)
 Stops the counter of a timer operating in basic time base mode. More...
 
void HRTIM_SimpleCapture_Init (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
 Initializes a timer operating in basic capture mode. More...
 
void HRTIM_SimpleCaptureChannelConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureChannel, HRTIM_BasicCaptureChannelCfgTypeDef *pBasicCaptureChannelCfg)
 Configures a basic capture. More...
 
void HRTIM_SimpleCaptureStart (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureChannel)
 Enables a basic capture on the designed capture unit. More...
 
void HRTIM_SimpleCaptureStop (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureChannel)
 Disables a basic capture on the designed capture unit. More...
 
void HRTIM_SimpleOC_Init (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
 Initializes the HRTIMx timer in basic output compare mode. More...
 
void HRTIM_SimpleOCChannelConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel, HRTIM_BasicOCChannelCfgTypeDef *pBasicOCChannelCfg)
 Configures an output in basic output compare mode. More...
 
void HRTIM_SimpleOCStart (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel)
 Starts the output compare signal generation on the designed timer output. More...
 
void HRTIM_SimpleOCStop (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OCChannel)
 Stops the output compare signal generation on the designed timer output. More...
 
void HRTIM_SimpleOnePulse_Init (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
 Initializes the HRTIMx timer in basic one pulse mode. More...
 
void HRTIM_SimpleOnePulseChannelConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OnePulseChannel, HRTIM_BasicOnePulseChannelCfgTypeDef *pBasicOnePulseChannelCfg)
 Configures an output basic one pulse mode. More...
 
void HRTIM_SimpleOnePulseStart (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OnePulseChannel)
 Enables the basic one pulse signal generation on the designed output. More...
 
void HRTIM_SimpleOnePulseStop (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t OnePulseChannel)
 Disables the basic one pulse signal generation on the designed output. More...
 
void HRTIM_SimplePWM_Init (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
 Initializes the HRTIMx timer in basic PWM mode. More...
 
void HRTIM_SimplePWMChannelConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t PWMChannel, HRTIM_BasicPWMChannelCfgTypeDef *pBasicPWMChannelCfg)
 Configures an output in basic PWM mode. More...
 
void HRTIM_SimplePWMStart (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t PWMChannel)
 Starts the PWM output signal generation on the designed timer output. More...
 
void HRTIM_SimplePWMStop (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t PWMChannel)
 Stops the PWM output signal generation on the designed timer output. More...
 
void HRTIM_SlaveSetCompare (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CompareUnit, uint32_t Compare)
 Sets the HRTIMx Slave Comparex Register value. More...
 
void HRTIM_SoftwareCapture (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit)
 Triggers a software capture on the designed capture unit. More...
 
void HRTIM_SoftwareReset (HRTIM_TypeDef *HRTIMx, uint32_t TimersToReset)
 Triggers the reset of one or several timers. More...
 
void HRTIM_SoftwareUpdate (HRTIM_TypeDef *HRTIMx, uint32_t TimersToUpdate)
 Triggers the update of the registers of one or several timers. More...
 
void HRTIM_SynchronizationConfig (HRTIM_TypeDef *HRTIMx, HRTIM_SynchroCfgTypeDef *pSynchroCfg)
 Configures the external input/output synchronization of the HRTIMx. More...
 
static void HRTIM_TIM_ResetConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Event)
 Configures the timer counter reset. More...
 
void HRTIM_TimerEventFilteringConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Event, HRTIM_TimerEventFilteringCfgTypeDef *pTimerEventFilteringCfg)
 Configures the event filtering capabilities of a timer (blanking, windowing) More...
 
static void HRTIM_TimingUnitBase_Config (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct)
 Configures timing unit (timer A to timer E) time base. More...
 
static void HRTIM_TimingUnitWaveform_Config (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_TimerInitTypeDef *pTimerInit)
 Configures timing unit (timer A to timer E) in waveform mode. More...
 
void HRTIM_Waveform_Init (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_BaseInitTypeDef *HRTIM_BaseInitStruct, HRTIM_TimerInitTypeDef *HRTIM_TimerInitStruct)
 Initializes a timer operating in waveform mode. More...
 
void HRTIM_WaveformCaptureConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CaptureUnit, HRTIM_CaptureCfgTypeDef *pCaptureCfg)
 Configures the capture unit of a timer operating in waveform mode. More...
 
void HRTIM_WaveformCompareConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t CompareUnit, HRTIM_CompareCfgTypeDef *pCompareCfg)
 Configures the compare unit of a timer operating in waveform mode. More...
 
void HRTIM_WaveformCounterStart (HRTIM_TypeDef *HRTIMx, uint32_t TimersToStart)
 Starts the counter of the designated timer(s) operating in waveform mode Timers can be combined (ORed) to allow for simultaneous counter start. More...
 
void HRTIM_WaveformCounterStop (HRTIM_TypeDef *HRTIMx, uint32_t TimersToStop)
 Stops the counter of the designated timer(s) operating in waveform mode Timers can be combined (ORed) to allow for simultaneous counter stop. More...
 
uint32_t HRTIM_WaveformGetOutputLevel (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output)
 Returns actual level (active or inactive) of the designated output. More...
 
uint32_t HRTIM_WaveformGetOutputState (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output)
 Returns actual state (RUN, IDLE, FAULT) of the designated output. More...
 
void HRTIM_WaveformOutputConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output, HRTIM_OutputCfgTypeDef *pOutputCfg)
 Configures the output of a timer operating in waveform mode. More...
 
void HRTIM_WaveformOutputStart (HRTIM_TypeDef *HRTIMx, uint32_t OutputsToStart)
 Enables the generation of the waveform signal on the designated output(s) Outputs can be combined (ORed) to allow for simultaneous output enabling. More...
 
void HRTIM_WaveformOutputStop (HRTIM_TypeDef *HRTIMx, uint32_t OutputsToStop)
 Disables the generation of the waveform signal on the designated output(s) Outputs can be combined (ORed) to allow for simultaneous output disabling. More...
 
void HRTIM_WaveformSetOutputLevel (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, uint32_t Output, uint32_t OutputLevel)
 Forces the timer output to its active or inactive state. More...
 
void HRTIM_WaveformTimerConfig (HRTIM_TypeDef *HRTIMx, uint32_t TimerIdx, HRTIM_TimerCfgTypeDef *pTimerCfg)
 Configures the general behavior of a timer operating in waveform mode. More...
 

Variables

static uint32_t TimerIdxToTimerId []
 

Detailed Description

HRTIMx module driver.

Author
MCD Application Team
Version
V1.1.1
Date
04-April-2014 This file provides firmware functions to manage the following functionalities of the HRTIMx peripheral:
  • Initialization/de-initialization methods
  • I/O operation methods
  • Peripheral Control methods
================================================================================
                    ##### <HRTIM specific features> #####
================================================================================
           
  [..] < HRTIM introduction: 
       (#) The high-resolution timer can generate up to 10 digital signals with
           highly accurate timings.
           It is primarily intended to drive power conversion systems such as 
           switch mode power supplies or lighting systems, 
           but can be of general purpose usage, whenever a very fine timing 
           resolution is expected.

       (#) Its modular architecture allows to generate either independent or 
           coupled waveforms. 
           The wave-shape is defined by self-contained timings 
           (using counters and compare units) and a broad range of external events,
           such as analog or digital feedbacks and synchronisation signals. 
           This allows to produce a large variety of control signal (PWM, phase-shifted,
           constant Ton,...) and address most of conversion topologies.

       (#) For control and monitoring purposes, the timer has also timing measure 
           capabilities and links to built-in ADC and DAC converters. 
           Last, it features light-load management mode and is able to handle 
           various fault schemes for safe shut-down purposes.
                 
   
            ##### How to use this driver #####
================================================================================
        [..] This driver provides functions to configure and program the HRTIM 
        of all stm32f33x devices.
        These functions are split in 9 groups: 
     
        (#) HRTIM Simple TimeBase management: this group includes all needed functions 
            to configure the HRTIM Timebase unit:
                 (++) Initializes the HRTIMx timer in simple time base mode 
                 (++) Start/Stop the time base generation
                 (++) Deinitialize the HRTIM peripheral  
    
                   
       (#) HRTIM simple Output Compare management: this group includes all needed 
           functions to configure the Compare unit used in Output compare mode: 
                 (++) Initializes the HRTIMx timer time base unit 
                 (++) Configure the compare unit in in simple Output Compare mode
                 (++) Start/Stop the Output compare generation    
                    
       (#) HRTIM simple PWM management: this group includes all needed 
           functions to configure the Compare unit used in PWM mode: 
                 (++) Initializes the HRTIMx timer time base unit 
                 (++) Configure the compare unit in in simple PWM mode
                 (++) Start/Stop the PWM generation      
                     
       (#) HRTIM simple Capture management: this group includes all needed 
           functions to configure the Capture unit used in Capture mode: 
                 (++) Initializes the HRTIMx timer time base unit 
                 (++) Configure the compare unit in in simple Capture mode
                 (++) Start/Stop the Capture mode

       (#) HRTIM simple One Pulse management: this group includes all needed 
           functions to configure the Capture unit and Compare unit used in One Pulse mode: 
                 (++) Initializes the HRTIMx timer time base unit 
                 (++) Configure the compare unit and the capture unit in in simple One Pulse mode
                 (++) Start/Stop the One Pulse mode generation 
                   
       (#) HRTIM Waveform management: this group includes all needed 
           functions to configure the HRTIM possible waveform mode: 
                 (++) Initializes the HRTIMx timer Master time base unit 
                 (++) Initializes the HRTIMx timer Slaves time base unit
                 (++) Configures the HRTIMx timer Compare unit  
                 (++) Configures the HRTIMx Slave timer Capture unit 
                 (++) Configures the HRTIMx timer Output unit 
                 (++) Configures the HRTIMx timer DeadTime / Chopper / Burst features 
                 (++) Configures the HRTIMx timer Fault / External event features 
                 (++) Configures the HRTIMx timer Synchronization features: Internal/External connection, DACs,... 
                 (++) Configures the HRTIMx timer Synchronization features: ADCs Triggers  
                 (++) HRTIMx timer Outputs Start/Stop  
                 (++) Start/Stop the HRTIMx Timer counters            
                               
        (#) HRTIM interrupts, DMA and flags management
                 (++) Enable/Disable interrupt sources
                 (++) Get flags status
                 (++) Clear flags/ Pending bits
                 (++) Enable/Disable DMA requests 
                 (++) Configure DMA burst mode
       
        (#) TIM specific interface management, this group includes all 
            needed functions to use the specific TIM interface:
                 (++) HRTIMx timer DLL calibration      
Attention

© COPYRIGHT 2014 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

   http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm32f30x_hrtim.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:21