STM8L15x Standard Peripherals Drivers: Interrupts and flags management functions

STM8L15x/16x Standard Peripherals Drivers

STM8L15x Standard Peripherals Drivers

Interrupts and flags management functions

Interrupts and flags management functions. More...

Functions

void DMA_ClearFlag (DMA_FLAG_TypeDef DMA_FLAG)
 Clears the DMA Channels selected flags.
void DMA_ClearITPendingBit (DMA_IT_TypeDef DMA_IT)
 Clears the DMA Channelx�s interrupt pending bits.
FlagStatus DMA_GetFlagStatus (DMA_FLAG_TypeDef DMA_FLAG)
 Checks whether the specified DMA Channelx flag is set or not.
ITStatus DMA_GetITStatus (DMA_IT_TypeDef DMA_IT)
 Checks whether the specified DMA Channelx interrupt has occurred or not.
void DMA_ITConfig (DMA_Channel_TypeDef *DMA_Channelx, DMA_ITx_TypeDef DMA_ITx, FunctionalState NewState)
 Enables or disables the specified DMA Channelx interrupts.

Detailed Description

Interrupts and flags management functions.

 ===============================================================================
                  Interrupts and flags management functions
 ===============================================================================  

  This subsection provides functions allowing to configure the DMA Interrupts 
  sources and check or clear the flags or pending bits status.
  The user should identify which mode will be used in his application to manage 
  the DMA controller events: Polling mode or Interrupt mode. 
    
  Polling Mode
  =============
    Each DMA channel can be managed through 2 event Flags:
    (x: DMA channel number )
       1. DMA1_FLAG_TCx: to indicate that a Transfer Complete event occurred
       2. DMA1_FLAG_HTx: to indicate that a Half-Transfer Complete event 
                          occurred

   In this Mode it is advised to use DMA_GetFlagStatus() and  DMA_ClearFlag() 
   functions. 
      

  Interrupt Mode
  ===============
    Each DMA channel can be managed through 2 Interrupts:

    Interrupt Source
    ----------------
       1. DMA_IT_TC: specifies the interrupt source for the Transfer Complete 
                     event.  
       2. DMA_IT_HT: specifies the interrupt source for the Half-transfer 
                      Complete event.
     
  In this Mode it is advised to use DMA_ITConfig(), DMA_GetITStatus() and
  DMA_ClearITPendingBit() functions.


Function Documentation

void DMA_ClearFlag ( DMA_FLAG_TypeDef  DMA_FLAG)

Clears the DMA Channels selected flags.

Parameters:
DMA_FLAG,:specifies the flag to clear. This parameter can be one or a combination (for the same channel)of the following values:
  • DMA1_FLAG_TC0: Transaction Complete Interrupt Flag Channel 0
  • DMA1_FLAG_TC1: Transaction Complete Interrupt Flag Channel 1
  • DMA1_FLAG_TC2: Transaction Complete Interrupt Flag Channel 2
  • DMA1_FLAG_TC2: Transaction Complete Interrupt Flag Channel 3
  • DMA1_FLAG_HT0: Half Transaction Interrupt Flag Channel 0
  • DMA1_FLAG_HT1: Half Transaction Interrupt Flag Channel 1
  • DMA1_FLAG_HT2: Half Transaction Interrupt Flag Channel 2
  • DMA1_FLAG_HT3: Half Transaction Interrupt Flag Channel 3
Return values:
None

Definition at line 591 of file stm8l15x_dma.c.

References DMA_Channel_struct::CSPR, DMA1_Channel0, DMA1_Channel1, DMA1_Channel2, DMA1_Channel3, IS_DMA_CLEAR_FLAG, and RESET.

void DMA_ClearITPendingBit ( DMA_IT_TypeDef  DMA_IT)

Clears the DMA Channelx�s interrupt pending bits.

Parameters:
DMA_IT,:specifies the DMA interrupt pending bit to clear. This parameter can be one or a combination(for the same channel)of the following values:
  • DMA1_IT_TC0: Transaction Complete Interrupt Channel 0
  • DMA1_IT_TC1: Transaction Complete Interrupt Channel 1
  • DMA1_IT_TC2: Transaction Complete Interrupt Channel 2
  • DMA1_IT_TC3: Transaction Complete Interrupt Channel 3
  • DMA1_IT_HT0: Half Transaction Interrupt Channel 0
  • DMA1_IT_HT1: Half Transaction Interrupt Channel 1
  • DMA1_IT_HT2: Half Transaction Interrupt Channel 2
  • DMA1_IT_HT3: Half Transaction Interrupt Channel 3
Return values:
None

Definition at line 698 of file stm8l15x_dma.c.

References DMA_Channel_struct::CSPR, DMA1_Channel0, DMA1_Channel1, DMA1_Channel2, DMA1_Channel3, IS_DMA_CLEAR_IT, and RESET.

FlagStatus DMA_GetFlagStatus ( DMA_FLAG_TypeDef  DMA_FLAG)

Checks whether the specified DMA Channelx flag is set or not.

Parameters:
DMA_FLAG,:specifies the flag to check. This parameter can be one of the following values:
  • DMA1_FLAG_GB: Global Busy Flag
  • DMA1_FLAG_IFC0: Global Interrupt Flag Channel 0
  • DMA1_FLAG_IFC1: Global Interrupt Flag Channel 1
  • DMA1_FLAG_IFC2: Global Interrupt Flag Channel 2
  • DMA1_FLAG_IFC3: Global Interrupt Flag Channel 3
  • DMA1_FLAG_TC0: Transaction Complete Interrupt Flag Channel 0
  • DMA1_FLAG_TC1: Transaction Complete Interrupt Flag Channel 1
  • DMA1_FLAG_TC2: Transaction Complete Interrupt Flag Channel 2
  • DMA1_FLAG_TC2: Transaction Complete Interrupt Flag Channel 3
  • DMA1_FLAG_HT0: Half Transaction Interrupt Flag Channel 0
  • DMA1_FLAG_HT1: Half Transaction Interrupt Flag Channel 1
  • DMA1_FLAG_HT2: Half Transaction Interrupt Flag Channel 2
  • DMA1_FLAG_HT3: Half Transaction Interrupt Flag Channel 3
  • DMA1_FLAG_PEND0: DMA Request pending on Channel 0
  • DMA1_FLAG_PEND1: DMA Request pending on Channel 1
  • DMA1_FLAG_PEND2: DMA Request pending on Channel 2
  • DMA1_FLAG_PEND3: DMA Request pending on Channel 3
  • DMA1_FLAG_BUSY0: No DMA transfer on going in Channel 0
  • DMA1_FLAG_BUSY1: No DMA transfer on going in Channel 1
  • DMA1_FLAG_BUSY2: No DMA transfer on going in Channel 2
  • DMA1_FLAG_BUSY3: No DMA transfer on going in Channel 3
Return values:
Thestatus of DMA_FLAG (SET or RESET).

Definition at line 524 of file stm8l15x_dma.c.

References DMA_Channel_struct::CSPR, DMA1, DMA1_Channel0, DMA1_Channel1, DMA1_Channel2, DMA1_Channel3, DMA_GCSR_GB, IS_DMA_GET_FLAG, and RESET.

ITStatus DMA_GetITStatus ( DMA_IT_TypeDef  DMA_IT)

Checks whether the specified DMA Channelx interrupt has occurred or not.

Parameters:
DMA_IT,:specifies the DMA interrupt source to check. This parameter can be one or a combination of the following values:
  • DMA1_IT_TC0: Transaction Complete Interrupt Channel 0
  • DMA1_IT_TC1: Transaction Complete Interrupt Channel 1
  • DMA1_IT_TC2: Transaction Complete Interrupt Channel 2
  • DMA1_IT_TC3: Transaction Complete Interrupt Channel 3
  • DMA1_IT_HT0: Half Transaction Interrupt Channel 0
  • DMA1_IT_HT1: Half Transaction Interrupt Channel 1
  • DMA1_IT_HT2: Half Transaction Interrupt Channel 2
  • DMA1_IT_HT3: Half Transaction Interrupt Channel 3
Return values:
ITStatus,:The status of DMA_IT (SET or RESET).

Definition at line 640 of file stm8l15x_dma.c.

References DMA_Channel_struct::CCR, DMA_Channel_struct::CSPR, DMA1_Channel0, DMA1_Channel1, DMA1_Channel2, DMA1_Channel3, DMA_CCR_HTIE, DMA_CCR_TCIE, IS_DMA_GET_IT, and RESET.

void DMA_ITConfig ( DMA_Channel_TypeDef DMA_Channelx,
DMA_ITx_TypeDef  DMA_ITx,
FunctionalState  NewState 
)

Enables or disables the specified DMA Channelx interrupts.

Parameters:
DMA_Channelx,:selects the DMA Channelx where x can be 0 to 3
DMA_ITx,:specifies the DMA interrupts sources to be enabled or disabled. This parameter can be one of the following values:
  • DMA_ITx_TC: Transaction Complete Interrupt
  • DMA_ITx_HT: Half Transaction Interrupt
NewState,:new state of the specified DMA interrupts. This parameter can be: ENABLE or DISABLE.
Return values:
None

Definition at line 476 of file stm8l15x_dma.c.

References DMA_Channel_struct::CCR, DISABLE, IS_DMA_CHANNEL, IS_DMA_CONFIG_ITX, and IS_FUNCTIONAL_STATE.

STM8S Firmware Library: Overview

 

 

 

For complete documentation on STM8L15x 8-bit microcontrollers platform visit www.st.com