STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups
Interrupts DMA and flags management functions

Interrupts, DMA and flags management functions. More...

Functions

void TIM_ITConfig (TIM_TypeDef *TIMx, uint16_t TIM_IT, FunctionalState NewState)
 Enables or disables the specified TIM interrupts. More...
 
void TIM_GenerateEvent (TIM_TypeDef *TIMx, uint16_t TIM_EventSource)
 Configures the TIMx event to be generate by software. More...
 
FlagStatus TIM_GetFlagStatus (TIM_TypeDef *TIMx, uint16_t TIM_FLAG)
 Checks whether the specified TIM flag is set or not. More...
 
void TIM_ClearFlag (TIM_TypeDef *TIMx, uint16_t TIM_FLAG)
 Clears the TIMx's pending flags. More...
 
ITStatus TIM_GetITStatus (TIM_TypeDef *TIMx, uint16_t TIM_IT)
 Checks whether the TIM interrupt has occurred or not. More...
 
void TIM_ClearITPendingBit (TIM_TypeDef *TIMx, uint16_t TIM_IT)
 Clears the TIMx's interrupt pending bits. More...
 
void TIM_DMAConfig (TIM_TypeDef *TIMx, uint16_t TIM_DMABase, uint16_t TIM_DMABurstLength)
 Configures the TIMx's DMA interface. More...
 
void TIM_DMACmd (TIM_TypeDef *TIMx, uint16_t TIM_DMASource, FunctionalState NewState)
 Enables or disables the TIMx's DMA Requests. More...
 
void TIM_SelectCCDMA (TIM_TypeDef *TIMx, FunctionalState NewState)
 Selects the TIMx peripheral Capture Compare DMA source. More...
 

Detailed Description

Interrupts, DMA and flags management functions.

 ===============================================================================
          ##### Interrupts, DMA and flags management functions #####
 ===============================================================================

Function Documentation

void TIM_ClearFlag ( TIM_TypeDef *  TIMx,
uint16_t  TIM_FLAG 
)

Clears the TIMx's pending flags.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, or 19 to select the TIM peripheral.
TIM_FLAG,:specifies the flag bit to clear. This parameter can be any combination of the following values:
  • TIM_FLAG_Update: TIM update Flag
  • TIM_FLAG_CC1: TIM Capture Compare 1 Flag
  • TIM_FLAG_CC2: TIM Capture Compare 2 Flag
  • TIM_FLAG_CC3: TIM Capture Compare 3 Flag
  • TIM_FLAG_CC4: TIM Capture Compare 4 Flag
  • TIM_FLAG_COM: TIM Commutation Flag
  • TIM_FLAG_Trigger: TIM Trigger Flag
  • TIM_FLAG_Break: TIM Break Flag
  • TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag
  • TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag
  • TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag
  • TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag
Note
TIM6can have only one update flag.
TIM15can have only TIM_FLAG_Update, TIM_FLAG_CC1,TIM_FLAG_CC2 or TIM_FLAG_Trigger.
TIM14, TIM16 and TIM17 can have TIM_FLAG_Update or TIM_FLAG_CC1.
TIM_FLAG_Break is used only with TIM15.
TIM_FLAG_COM is used only with TIM15, TIM16 and TIM17.
Return values
None
void TIM_ClearITPendingBit ( TIM_TypeDef *  TIMx,
uint16_t  TIM_IT 
)

Clears the TIMx's interrupt pending bits.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, or 19 to select the TIM peripheral.
TIM_IT,:specifies the pending bit to clear. This parameter can be any combination of the following values:
  • TIM_IT_Update: TIM1 update Interrupt source
  • TIM_IT_CC1: TIM Capture Compare 1 Interrupt source
  • TIM_IT_CC2: TIM Capture Compare 2 Interrupt source
  • TIM_IT_CC3: TIM Capture Compare 3 Interrupt source
  • TIM_IT_CC4: TIM Capture Compare 4 Interrupt source
  • TIM_IT_COM: TIM Commutation Interrupt source
  • TIM_IT_Trigger: TIM Trigger Interrupt source
  • TIM_IT_Break: TIM Break Interrupt source
Note
TIM6 can generate only an update interrupt.
TIM15 can have only TIM_IT_Update, TIM_IT_CC1, TIM_IT_CC2 or TIM_IT_Trigger.
TIM14, TIM16 and TIM17 can have TIM_IT_Update or TIM_IT_CC1.
TIM_IT_Break is used only with TIM15.
TIM_IT_COM is used only with TIM15, TIM16 and TIM17.
Return values
None
void TIM_DMACmd ( TIM_TypeDef *  TIMx,
uint16_t  TIM_DMASource,
FunctionalState  NewState 
)

Enables or disables the TIMx's DMA Requests.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 6, 7, 15, 16, 17, 18 and 19 to select the TIM peripheral.
TIM_DMASource,:specifies the DMA Request sources. This parameter can be any combination of the following values:
  • TIM_DMA_Update: TIM update Interrupt source
  • TIM_DMA_CC1: TIM Capture Compare 1 DMA source
  • TIM_DMA_CC2: TIM Capture Compare 2 DMA source
  • TIM_DMA_CC3: TIM Capture Compare 3 DMA source
  • TIM_DMA_CC4: TIM Capture Compare 4 DMA source
  • TIM_DMA_COM: TIM Commutation DMA source
  • TIM_DMA_Trigger: TIM Trigger DMA source
NewState,:new state of the DMA Request sources. This parameter can be: ENABLE or DISABLE.
Return values
None
void TIM_DMAConfig ( TIM_TypeDef *  TIMx,
uint16_t  TIM_DMABase,
uint16_t  TIM_DMABurstLength 
)

Configures the TIMx's DMA interface.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 15, 16, 17 and 19 to select the TIM peripheral.
TIM_DMABase,:DMA Base address. This parameter can be one of the following values:
  • TIM_DMABase_CR1
  • TIM_DMABase_CR2
  • TIM_DMABase_SMCR
  • TIM_DMABase_DIER
  • TIM_DMABase_SR
  • TIM_DMABase_EGR
  • TIM_DMABase_CCMR1
  • TIM_DMABase_CCMR2
  • TIM_DMABase_CCER
  • TIM_DMABase_CNT
  • TIM_DMABase_PSC
  • TIM_DMABase_ARR
  • TIM_DMABase_CCR1
  • TIM_DMABase_CCR2
  • TIM_DMABase_CCR3
  • TIM_DMABase_CCR4
  • TIM_DMABase_DCR
  • TIM_DMABase_OR
TIM_DMABurstLength,:DMA Burst length. This parameter can be one value between: TIM_DMABurstLength_1Transfer and TIM_DMABurstLength_18Transfers.
Return values
None
void TIM_GenerateEvent ( TIM_TypeDef *  TIMx,
uint16_t  TIM_EventSource 
)

Configures the TIMx event to be generate by software.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, or 19 to select the TIM peripheral.
TIM_EventSource,:specifies the event source. This parameter can be one or more of the following values:
  • TIM_EventSource_Update: Timer update Event source
  • TIM_EventSource_CC1: Timer Capture Compare 1 Event source
  • TIM_EventSource_CC2: Timer Capture Compare 2 Event source
  • TIM_EventSource_CC3: Timer Capture Compare 3 Event source
  • TIM_EventSource_CC4: Timer Capture Compare 4 Event source
  • TIM_EventSource_COM: Timer COM event source
  • TIM_EventSource_Trigger: Timer Trigger Event source
  • TIM_EventSource_Break: Timer Break event source
Note
TIM6 can only generate an update event.
TIM9 can only generate an update event, Capture Compare 1 event, Capture Compare 2 event and TIM_EventSource_Trigger.
TIM_EventSource_COM and TIM_EventSource_Break are used only with TIM15,TIM16 and TIM17.
Return values
None
FlagStatus TIM_GetFlagStatus ( TIM_TypeDef *  TIMx,
uint16_t  TIM_FLAG 
)

Checks whether the specified TIM flag is set or not.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, or 19 to select the TIM peripheral.
TIM_FLAG,:specifies the flag to check. This parameter can be one of the following values:
  • TIM_FLAG_Update: TIM update Flag
  • TIM_FLAG_CC1: TIM Capture Compare 1 Flag
  • TIM_FLAG_CC2: TIM Capture Compare 2 Flag
  • TIM_FLAG_CC3: TIM Capture Compare 3 Flag
  • TIM_FLAG_CC4: TIM Capture Compare 4 Flag
  • TIM_FLAG_COM: TIM Commutation Flag
  • TIM_FLAG_Trigger: TIM Trigger Flag
  • TIM_FLAG_Break: TIM Break Flag
  • TIM_FLAG_CC1OF: TIM Capture Compare 1 overcapture Flag
  • TIM_FLAG_CC2OF: TIM Capture Compare 2 overcapture Flag
  • TIM_FLAG_CC3OF: TIM Capture Compare 3 overcapture Flag
  • TIM_FLAG_CC4OF: TIM Capture Compare 4 overcapture Flag
Note
TIM6 can have only one update flag.
TIM15 can have only TIM_FLAG_Update, TIM_FLAG_CC1, TIM_FLAG_CC2 or TIM_FLAG_Trigger.
TIM14, TIM16 and TIM17 can have TIM_FLAG_Update or TIM_FLAG_CC1.
TIM_FLAG_Break is used only with TIM15.
TIM_FLAG_COM is used only with TIM15, TIM16 and TIM17.
Return values
Thenew state of TIM_FLAG (SET or RESET).
ITStatus TIM_GetITStatus ( TIM_TypeDef *  TIMx,
uint16_t  TIM_IT 
)

Checks whether the TIM interrupt has occurred or not.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, or 19 to select the TIM peripheral.
TIM_IT,:specifies the TIM interrupt source to check. This parameter can be one of the following values:
  • TIM_IT_Update: TIM update Interrupt source
  • TIM_IT_CC1: TIM Capture Compare 1 Interrupt source
  • TIM_IT_CC2: TIM Capture Compare 2 Interrupt source
  • TIM_IT_CC3: TIM Capture Compare 3 Interrupt source
  • TIM_IT_CC4: TIM Capture Compare 4 Interrupt source
  • TIM_IT_COM: TIM Commutation Interrupt source
  • TIM_IT_Trigger: TIM Trigger Interrupt source
  • TIM_IT_Break: TIM Break Interrupt source
Note
TIM6 can generate only an update interrupt.
TIM15 can have only TIM_IT_Update, TIM_IT_CC1, TIM_IT_CC2 or TIM_IT_Trigger.
TIM14, TIM16 and TIM17 can have TIM_IT_Update or TIM_IT_CC1.
TIM_IT_Break is used only with TIM15.
TIM_IT_COM is used only with TIM15, TIM16 and TIM17.
Return values
Thenew state of the TIM_IT(SET or RESET).
void TIM_ITConfig ( TIM_TypeDef *  TIMx,
uint16_t  TIM_IT,
FunctionalState  NewState 
)

Enables or disables the specified TIM interrupts.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 16, 17, 18, or 19 to select the TIMx peripheral.
TIM_IT,:specifies the TIM interrupts sources to be enabled or disabled. This parameter can be any combination of the following values:
  • TIM_IT_Update: TIM update Interrupt source
  • TIM_IT_CC1: TIM Capture Compare 1 Interrupt source
  • TIM_IT_CC2: TIM Capture Compare 2 Interrupt source
  • TIM_IT_CC3: TIM Capture Compare 3 Interrupt source
  • TIM_IT_CC4: TIM Capture Compare 4 Interrupt source
  • TIM_IT_COM: TIM Commutation Interrupt source
  • TIM_IT_Trigger: TIM Trigger Interrupt source
  • TIM_IT_Break: TIM Break Interrupt source
Note
TIM6 can only generate an update interrupt.
TIM15 can have only TIM_IT_Update, TIM_IT_CC1, TIM_IT_CC2 or TIM_IT_Trigger.
TIM14, TIM16 and TIM17 can have TIM_IT_Update or TIM_IT_CC1.
TIM_IT_Break is used only with TIM15.
TIM_IT_COM is used only with TIM15, TIM16 and TIM17.
Parameters
NewState,:new state of the TIM interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None
void TIM_SelectCCDMA ( TIM_TypeDef *  TIMx,
FunctionalState  NewState 
)

Selects the TIMx peripheral Capture Compare DMA source.

Parameters
TIMx,:where x can be 2, 3, 4, 5, 15, 16, 17 or 19 to select the TIM peripheral.
NewState,:new state of the Capture Compare DMA source This parameter can be: ENABLE or DISABLE.
Return values
None