/*!
 * @file        user_adc_config.h
 *
 * @brief       ADC 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_ADC_CONFIG_H
#define USER_ADC_CONFIG_H

#ifdef __cplusplus
extern "C" {
#endif

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

/** @addtogroup Examples
  @{
  */

/** @addtogroup ADC_Examples
  @{
  */

/** @addtogroup ADC_MultiChannelScan
  @{
  */

/** @defgroup ADC_MultiChannelScan_Macros Macros
  @{
  */
#define DMA_CHANNEL             DMA1_CHANNEL_1
  
#define ADC_INPUT_PORT0_4       GPIOA
#define ADC_INPUT_PORT5         GPIOB

#define ADC_PERIPH_CLK_PORT0_4  RCM_AHB_PERIPH_GPIOA
#define ADC_PERIPH_CLK_PORT5    RCM_AHB_PERIPH_GPIOB

#define ADC_INPUT_CHANNEL0       ADC_CHANNEL_0
#define ADC_INPUT_CHANNEL1       ADC_CHANNEL_1
#define ADC_INPUT_CHANNEL2       ADC_CHANNEL_2
#define ADC_INPUT_CHANNEL3       ADC_CHANNEL_3
#define ADC_INPUT_CHANNEL4       ADC_CHANNEL_4
#define ADC_INPUT_CHANNEL5       ADC_CHANNEL_9

#define ADC_SAMPLE_TIME          ADC_SAMPLE_TIME_239_5

#define ADC_CH_SIZE     6
#define ADC_DR_ADDR     ((uint32_t)ADC_BASE + 0x40u)

/**@} end of group ADC_MultiChannelScan_Macros */

/** @defgroup ADC_MultiChannelScan_Variables Variables
  @{
  */

/* ADC user configuration */

extern volatile uint16_t adcData[ADC_CH_SIZE];
extern Adc_ConfigType adcConfig;
extern Gpio_ConfigType gpioConfig0_4;
extern Gpio_ConfigType gpioConfig5;
extern Dma_ConfigType dmaConfig;
/**@} end of group ADC_MultiChannelScan_Variables */


/** @defgroup ADC_MultiChannelScan_Functions Functions
  @{
  */

extern void Adc_DmaIsr(void);

/**@} end of group ADC_MultiChannelScan_Functions */


#ifdef __cplusplus
}
#endif

#endif /* USER_ADC_CONFIG_H */

/**@} end of group ADC_MultiChannelScan */
/**@} end of group ADC_Examples */
/**@} end of group Examples */
