STM32F4 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F4 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 1 to 14 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 over capture Flag
  • TIM_FLAG_CC2OF: TIM Capture Compare 2 over capture Flag
  • TIM_FLAG_CC3OF: TIM Capture Compare 3 over capture Flag
  • TIM_FLAG_CC4OF: TIM Capture Compare 4 over capture Flag
Note
TIM6 and TIM7 can have only one update flag.
TIM_FLAG_COM and TIM_FLAG_Break are used only with TIM1 and TIM8.
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 1 to 14 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 and TIM7 can generate only an update interrupt.
TIM_IT_COM and TIM_IT_Break are used only with TIM1 and TIM8.
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 1, 2, 3, 4, 5, 6, 7 or 8 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 1, 2, 3, 4, 5 or 8 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
  • TIM1_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_RCR
  • TIM_DMABase_CCR1
  • TIM_DMABase_CCR2
  • TIM_DMABase_CCR3
  • TIM_DMABase_CCR4
  • TIM_DMABase_BDTR
  • TIM_DMABase_DCR
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 1 to 14 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 and TIM7 can only generate an update event.
TIM_EventSource_COM and TIM_EventSource_Break are used only with TIM1 and TIM8.
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 1 to 14 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 over capture Flag
  • TIM_FLAG_CC2OF: TIM Capture Compare 2 over capture Flag
  • TIM_FLAG_CC3OF: TIM Capture Compare 3 over capture Flag
  • TIM_FLAG_CC4OF: TIM Capture Compare 4 over capture Flag
Note
TIM6 and TIM7 can have only one update flag.
TIM_FLAG_COM and TIM_FLAG_Break are used only with TIM1 and TIM8.
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 1 to 14 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 and TIM7 can generate only an update interrupt.
TIM_IT_COM and TIM_IT_Break are used only with TIM1 and TIM8.
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 1 to 14 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
For TIM6 and TIM7 only the parameter TIM_IT_Update can be used
For TIM9 and TIM12 only one of the following parameters can be used: TIM_IT_Update, TIM_IT_CC1, TIM_IT_CC2 or TIM_IT_Trigger.
For TIM10, TIM11, TIM13 and TIM14 only one of the following parameters can be used: TIM_IT_Update or TIM_IT_CC1
TIM_IT_COM and TIM_IT_Break can be used only with TIM1 and TIM8
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 1, 2, 3, 4, 5 or 8 to select the TIM peripheral.
NewState,:new state of the Capture Compare DMA source This parameter can be: ENABLE or DISABLE.
Return values
None