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 and flags management functions

Interrupts and flags management functions. More...

Functions

void CRYP_ITConfig (uint8_t CRYP_IT, FunctionalState NewState)
 Enables or disables the specified CRYP interrupts. More...
 
ITStatus CRYP_GetITStatus (uint8_t CRYP_IT)
 Checks whether the specified CRYP interrupt has occurred or not. More...
 
FlagStatus CRYP_GetFlagStatus (uint8_t CRYP_FLAG)
 Checks whether the specified CRYP flag is set or not. More...
 

Detailed Description

Interrupts and flags management functions.

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

  This section provides functions allowing to configure the CRYP Interrupts and 
  to get the status and Interrupts pending bits.

  The CRYP provides 2 Interrupts sources and 7 Flags:

  Flags :
  ------- 
                          
     1. CRYP_FLAG_IFEM :  Set when Input FIFO is empty.
                          This Flag is cleared only by hardware.
      
     2. CRYP_FLAG_IFNF :  Set when Input FIFO is not full.
                          This Flag is cleared only by hardware.


     3. CRYP_FLAG_INRIS  : Set when Input FIFO Raw interrupt is pending 
                           it gives the raw interrupt state prior to masking 
                           of the input FIFO service interrupt.
                           This Flag is cleared only by hardware.
     
     4. CRYP_FLAG_OFNE   : Set when Output FIFO not empty.
                           This Flag is cleared only by hardware.
        
     5. CRYP_FLAG_OFFU   : Set when Output FIFO is full.
                           This Flag is cleared only by hardware.
                           
     6. CRYP_FLAG_OUTRIS : Set when Output FIFO Raw interrupt is pending 
                           it gives the raw interrupt state prior to masking 
                           of the output FIFO service interrupt.
                           This Flag is cleared only by hardware.
                               
     7. CRYP_FLAG_BUSY   : Set when the CRYP core is currently processing a 
                           block of data or a key preparation (for AES 
                           decryption).
                           This Flag is cleared only by hardware.
                           To clear it, the CRYP core must be disabled and the 
                           last processing has completed. 

  Interrupts :
  ------------

   1. CRYP_IT_INI   : The input FIFO service interrupt is asserted when there 
                      are less than 4 words in the input FIFO.
                      This interrupt is associated to CRYP_FLAG_INRIS flag.

                @note This interrupt is cleared by performing write operations 
                      to the input FIFO until it holds 4 or more words. The 
                      input FIFO service interrupt INMIS is enabled with the 
                      CRYP enable bit. Consequently, when CRYP is disabled, the 
                      INMIS signal is low even if the input FIFO is empty.



   2. CRYP_IT_OUTI  : The output FIFO service interrupt is asserted when there 
                      is one or more (32-bit word) data items in the output FIFO.
                      This interrupt is associated to CRYP_FLAG_OUTRIS flag.

                @note This interrupt is cleared by reading data from the output 
                      FIFO until there is no valid (32-bit) word left (that is, 
                      the interrupt follows the state of the OFNE (output FIFO 
                      not empty) flag).


  Managing the CRYP controller events :
  ------------------------------------ 
  The user should identify which mode will be used in his application to manage 
  the CRYP controller events: Polling mode or Interrupt mode.

  1.  In the Polling Mode it is advised to use the following functions:
      - CRYP_GetFlagStatus() : to check if flags events occur. 

  @note  The CRYPT flags do not need to be cleared since they are cleared as 
         soon as the associated event are reset.   


  2.  In the Interrupt Mode it is advised to use the following functions:
      - CRYP_ITConfig()       : to enable or disable the interrupt source.
      - CRYP_GetITStatus()    : to check if Interrupt occurs.

  @note  The CRYPT interrupts have no pending bits, the interrupt is cleared as 
         soon as the associated event is reset. 

Function Documentation

FlagStatus CRYP_GetFlagStatus ( uint8_t  CRYP_FLAG)

Checks whether the specified CRYP flag is set or not.

Parameters
CRYP_FLAG,:specifies the CRYP flag to check. This parameter can be one of the following values:
  • CRYP_FLAG_IFEM: Input FIFO Empty flag.
  • CRYP_FLAG_IFNF: Input FIFO Not Full flag.
  • CRYP_FLAG_OFNE: Output FIFO Not Empty flag.
  • CRYP_FLAG_OFFU: Output FIFO Full flag.
  • CRYP_FLAG_BUSY: Busy flag.
  • CRYP_FLAG_OUTRIS: Output FIFO raw interrupt flag.
  • CRYP_FLAG_INRIS: Input FIFO raw interrupt flag.
Return values
Thenew state of CRYP_FLAG (SET or RESET).
ITStatus CRYP_GetITStatus ( uint8_t  CRYP_IT)

Checks whether the specified CRYP interrupt has occurred or not.

Note
This function checks the status of the masked interrupt (i.e the interrupt should be previously enabled).
Parameters
CRYP_IT,:specifies the CRYP (masked) interrupt source to check. This parameter can be one of the following values:
  • CRYP_IT_INI: Input FIFO interrupt
  • CRYP_IT_OUTI: Output FIFO interrupt
Return values
Thenew state of CRYP_IT (SET or RESET).
void CRYP_ITConfig ( uint8_t  CRYP_IT,
FunctionalState  NewState 
)

Enables or disables the specified CRYP interrupts.

Parameters
CRYP_IT,:specifies the CRYP interrupt source to be enabled or disabled. This parameter can be any combination of the following values:
  • CRYP_IT_INI: Input FIFO interrupt
  • CRYP_IT_OUTI: Output FIFO interrupt
NewState,:new state of the specified CRYP interrupt. This parameter can be: ENABLE or DISABLE.
Return values
None