STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
stm32f7xx_hal_dma2d.c File Reference

DMA2D HAL module driver. This file provides firmware functions to manage the following functionalities of the DMA2D peripheral: More...

#include "stm32f7xx_hal.h"

Go to the source code of this file.

Detailed Description

DMA2D HAL module driver. This file provides firmware functions to manage the following functionalities of the DMA2D peripheral:

Author
MCD Application Team
Version
V1.1.0
Date
22-April-2016
  • Initialization and de-initialization functions
  • IO operation functions
  • Peripheral Control functions
  • Peripheral State and Errors functions
==============================================================================
                      ##### How to use this driver #####
==============================================================================
  [..]
    (#) Program the required configuration through the following parameters:   
        the transfer mode, the output color mode and the output offset using 
        HAL_DMA2D_Init() function.

    (#) Program the required configuration through the following parameters:   
        the input color mode, the input color, the input alpha value, the alpha mode,
        the red/blue swap mode, the inverted alpha mode and the input offset using 
        HAL_DMA2D_ConfigLayer() function for foreground or/and background layer.
        
   *** Polling mode IO operation ***
   =================================   
  [..]        
     (#) Configure pdata parameter (explained hereafter), destination and data length 
         and enable the transfer using HAL_DMA2D_Start(). 
     (#) Wait for end of transfer using HAL_DMA2D_PollForTransfer(), at this stage
         user can specify the value of timeout according to his end application.
             
   *** Interrupt mode IO operation ***    
   ===================================
   [..] 
     (#) Configure pdata parameter, destination and data length and enable 
         the transfer using HAL_DMA2D_Start_IT(). 
     (#) Use HAL_DMA2D_IRQHandler() called under DMA2D_IRQHandler() interrupt subroutine.
     (#) At the end of data transfer HAL_DMA2D_IRQHandler() function is executed and user can 
         add his own function by customization of function pointer XferCpltCallback (member 
         of DMA2D handle structure). 
     (#) In case of error, the HAL_DMA2D_IRQHandler() function will call the callback 
         XferErrorCallback.            

       -@-   In Register-to-Memory transfer mode, pdata parameter is the register
             color, in Memory-to-memory or Memory-to-Memory with pixel format
             conversion pdata is the source address.

       -@-   Configure the foreground source address, the background source address, 
             the destination and data length then Enable the transfer using 
             HAL_DMA2D_BlendingStart() in polling mode and HAL_DMA2D_BlendingStart_IT()
             in interrupt mode.
             
       -@-   HAL_DMA2D_BlendingStart() and HAL_DMA2D_BlendingStart_IT() functions
             are used if the memory to memory with blending transfer mode is selected.
                 
    (#) Optionally, configure and enable the CLUT using HAL_DMA2D_CLUTLoad() in polling
        mode or HAL_DMA2D_CLUTLoad_IT() in interrupt mode.

    (#) Optionally, configure the line watermark in using the API HAL_DMA2D_ProgramLineEvent()
        
    (#) Optionally, configure the dead time value in the AHB clock cycle inserted between two 
        consecutive accesses on the AHB master port in using the API HAL_DMA2D_ConfigDeadTime()
        and enable/disable the functionality  with the APIs HAL_DMA2D_EnableDeadTime() or
        HAL_DMA2D_DisableDeadTime().          
 
    (#) The transfer can be suspended, resumed and aborted using the following
        functions: HAL_DMA2D_Suspend(), HAL_DMA2D_Resume(), HAL_DMA2D_Abort().
        
    (#) The CLUT loading can be suspended, resumed and aborted using the following
        functions: HAL_DMA2D_CLUTLoading_Suspend(), HAL_DMA2D_CLUTLoading_Resume(), 
        HAL_DMA2D_CLUTLoading_Abort().                
                   
    (#) To control the DMA2D state, use the following function: HAL_DMA2D_GetState().   
    
    (#) To read the DMA2D error code, use the following function: HAL_DMA2D_GetError().                         

   *** DMA2D HAL driver macros list ***
   ============================================= 
   [..]
     Below the list of most used macros in DMA2D HAL driver :
     
    (+) __HAL_DMA2D_ENABLE: Enable the DMA2D peripheral.
    (+) __HAL_DMA2D_GET_FLAG: Get the DMA2D pending flags.
    (+) __HAL_DMA2D_CLEAR_FLAG: Clear the DMA2D pending flags.
    (+) __HAL_DMA2D_ENABLE_IT: Enable the specified DMA2D interrupts.
    (+) __HAL_DMA2D_DISABLE_IT: Disable the specified DMA2D interrupts.
    (+) __HAL_DMA2D_GET_IT_SOURCE: Check whether the specified DMA2D interrupt is enabled or not.     
   
   [..] 
    (@) You can refer to the DMA2D HAL driver header file for more useful macros
Attention

© COPYRIGHT(c) 2016 STMicroelectronics

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file stm32f7xx_hal_dma2d.c.