text: /**
    ******************************************************************************
    * @file    dma2d.c
    * @brief   This file provides code for the configuration
    *          of the DMA2D instances.
    ******************************************************************************
    * @attention
    *
    * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
    * All rights reserved.</center></h2>
    *
    * This software component is licensed by ST under BSD 3-Clause license,
    * the "License"; You may not use this file except in compliance with the
    * License. You may obtain a copy of the License at:
    *                        opensource.org/licenses/BSD-3-Clause
    *
    ******************************************************************************
    */
  
  /* Includes ------------------------------------------------------------------*/
  #include "dma2d.h"
  
  /* USER CODE BEGIN 0 */
  
  /* USER CODE END 0 */
  
  DMA2D_HandleTypeDef hdma2d;
  
  /* DMA2D init function */
  void MX_DMA2D_Init(void)
  {
  
    hdma2d.Instance = DMA2D;
    hdma2d.Init.Mode = DMA2D_M2M;
    hdma2d.Init.ColorMode = DMA2D_OUTPUT_ARGB8888;
    hdma2d.Init.OutputOffset = 0;
    hdma2d.Init.BytesSwap = DMA2D_BYTES_REGULAR;
    hdma2d.Init.LineOffsetMode = DMA2D_LOM_PIXELS;
    hdma2d.LayerCfg[1].InputOffset = 0;
    hdma2d.LayerCfg[1].InputColorMode = DMA2D_INPUT_ARGB8888;
    hdma2d.LayerCfg[1].AlphaMode = DMA2D_NO_MODIF_ALPHA;
    hdma2d.LayerCfg[1].InputAlpha = 0;
    hdma2d.LayerCfg[1].AlphaInverted = DMA2D_REGULAR_ALPHA;
    hdma2d.LayerCfg[1].RedBlueSwap = DMA2D_RB_REGULAR;
    hdma2d.LayerCfg[1].ChromaSubSampling = DMA2D_NO_CSS;
    if (HAL_DMA2D_Init(&hdma2d) != HAL_OK)
    {
      Error_Handler();
    }
    if (HAL_DMA2D_ConfigLayer(&hdma2d, 1) != HAL_OK)
    {
      Error_Handler();
    }
  
  }
  
  void HAL_DMA2D_MspInit(DMA2D_HandleTypeDef* dma2dHandle)
  {
  
    if(dma2dHandle->Instance==DMA2D)
    {
    /* USER CODE BEGIN DMA2D_MspInit 0 */
  
    /* USER CODE END DMA2D_MspInit 0 */
      /* DMA2D clock enable */
      __HAL_RCC_DMA2D_CLK_ENABLE();
    /* USER CODE BEGIN DMA2D_MspInit 1 */
  
    /* USER CODE END DMA2D_MspInit 1 */
    }
  }
  
  void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef* dma2dHandle)
  {
  
    if(dma2dHandle->Instance==DMA2D)
    {
    /* USER CODE BEGIN DMA2D_MspDeInit 0 */
  
    /* USER CODE END DMA2D_MspDeInit 0 */
      /* Peripheral clock disable */
      __HAL_RCC_DMA2D_CLK_DISABLE();
    /* USER CODE BEGIN DMA2D_MspDeInit 1 */
  
    /* USER CODE END DMA2D_MspDeInit 1 */
    }
  }
  
  /* USER CODE BEGIN 1 */
  
  /* USER CODE END 1 */
  
  /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  