/*!
 * @file        user_dma_config.h
 *
 * @brief       DMA configurations
 *
 * @version     V1.0.0
 *
 * @date        2026-03-25
 *
 * @attention
 *
 *  Copyright (C) 2026 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (Geehy Semiconductor Software License Agreement).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the Geehy Semiconductor Software License Agreement for the governing permissions
 *  and limitations under the License.
 */

#ifndef USER_DMA_CONFIG_H
#define USER_DMA_CONFIG_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes */
#include "g32a10xx_adc.h"
#include "g32a10xx_gpio.h"
#include "g32a10xx_dma.h"

/** @addtogroup Examples
  @{
  */

/** @addtogroup DMA_Examples
  @{
  */

/** @addtogroup DMA_ADC
  @{
  */

/** @defgroup DMA_ADC_Macros Macros
  @{
  */
#define DMA_CHANNEL             DMA1_CHANNEL_1
  
#define ADC_INPUT_PORT          GPIOB
#define ADC_PERIPH_CLK_PORT     RCM_AHB_PERIPH_GPIOB
#define ADC_INPUT_CHANNEL       ADC_CHANNEL_9
#define ADC_SAMPLE_TIME          ADC_SAMPLE_TIME_239_5

#define ADC_CH_SIZE     1
#define ADC_DR_ADDR     ((uint32_t)&ADC->DATA_R.DATA)

/**@} end of group DMA_ADC_Macros */

/** @defgroup DMA_ADC_Variables Variables
  @{
  */

/* DMA user configuration */

extern Adc_ConfigType adcConfig;
extern Gpio_ConfigType gpioConfig;
extern Dma_ConfigType dmaConfig;

extern volatile uint32_t DMA_ConvertedValue;
/**@} end of group DMA_ADC_Variables */

#ifdef __cplusplus
}
#endif

#endif /* USER_DMA_CONFIG_H */

/**@} end of group DMA_ADC */
/**@} end of group DMA_Examples */
/**@} end of group Examples */
