/*!
* @file     Adc_Hw.h
*
* @version  1.0.0
*
* @brief    AUTOSAR Adc Driver header file
*
* @attention
*
* Project Name      : AUTOSAR MCAL
*
* Platform          : Arm
*
* Autosar Standard  : Classic Platform 4.4.0
*
* Compiled Version  : G32A10xx_MCAL_1_0_0_01-Otc-25
*
* 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 usefull 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 ADC_HW_H
#define ADC_HW_H


#ifdef __cplusplus
extern "C"{
#endif

#include "Adc.h"

/** @addtogroup G32A10xx_StdPeriphDriver
  @{
*/

/** @addtogroup ADC_Driver
  @{
*/

/** @defgroup ADC_Macros
  @{
*/
/*******************************************************************************
                    VENDOR ID & AUTOSAR VERSION INFO
*******************************************************************************/
/** Vendor ID (vendorId) of the dedicated implementation of this module according to the AUTOSAR vendor list. */
#define ADC_HW_H_VENDOR_ID                                0x00C1U
/* Module ID of this module, as defined in the BSW Module List. */
#define ADC_HW_H_MODULE_ID                                0x0065U
/** Major version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ADC_HW_H_AR_RELEASE_MAJOR_VERSION                 0x04U
/** Minor version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ADC_HW_H_AR_RELEASE_MINOR_VERSION                 0x04U
/** Revision version number of AUTOSAR release on which the appropriate implementation is based on. */
#define ADC_HW_H_AR_RELEASE_REVISION_VERSION              0x00U
/** Major version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ADC_HW_H_SW_MAJOR_VERSION                         0x01U
/** Minor version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ADC_HW_H_SW_MINOR_VERSION                         0x00U
/** Patch level version number of the vendor specific implementation of the module. The numbering is vendor specific. */
#define ADC_HW_H_SW_PATCH_VERSION                         0x00U
  
/**@} end of group ADC_Macros */
/*******************************************************************************
                            FUNCTION DECLARATIONS
*******************************************************************************/
#define ADC_START_SEC_CODE
#include "Adc_MemMap.h"

/** @defgroup ADC_Fuctions
  @{
*/
void Adc_Hw_StartGroupConversion(Adc_GroupType Group);
void Adc_Hw_StopGroupConversion(Adc_GroupType Group);
void Adc_Hw_ClockModeConfig(uint8 adc,Adc_ClkModeType adcClock);
void Adc_Hw_CataResolutionConfig(uint8 adc,Adc_ResolutionType resolution);
void Adc_Hw_TriggerSelect(uint8 adc,Adc_TriggerSourceType trigger,Adc_HwTriggerSignalType hwSignal);
void Adc_Hw_TriggerEvent(uint8 adc,Adc_TriggerEventType event);
void Adc_Hw_EnableBackDirection(uint8 adc,uint8 status);
void Adc_Hw_SelectMode(uint8 adc,Adc_GroupConvModeType mode);
void Adc_Hw_EnableDelayConversion(uint8 adc,uint8 status);
void Adc_Hw_SelectDataAlignment(uint8 adc,Adc_ResultAlignmentType alignment);
void Adc_Hw_SelectSamplingTime(uint8 adc,Adc_SamplingTimeType adcTime);
void Adc_Hw_SelectChannel(uint8 adc,Adc_ChannelType channel,uint8 status);
void Adc_Hw_clearCtrlReg(uint8 adc);
void Adc_Hw_EnableADC(uint8 adc,uint8 status);
void Adc_Hw_DisableADC(uint8 adc,uint8 status);
uint32_t Adc_Hw_ReadCalibrationFactor(uint8 adc);
#if (STD_ON == ADC_ENABLE_INTERRUPT)
void Adc_Hw_OperationInterrupt(uint8 adc,Adc_IntType interrupt, uint8 status);
#endif
uint8_t Adc_Hw_GetInterruptFlag(uint8 adc,Adc_IntFlgType flag);
void Adc_Hw_WriteInterruptFlag(uint8 adc,Adc_IntFlgType flag);
void Adc_Hw_EnableConversion(uint8 adc,uint32 status);
uint8_t Adc_Hw_GetChannelNum(uint8 adc);
void Adc_Hw_OperationDma(uint8 adc, uint8 status);
void Adc_Hw_EnableDmaLoopMode(uint8 adc, uint8 status);

#if (ADC_HARDWARE_TRIG_API == STD_ON)
void Adc_Hw_SelectTRGOSignal(Adc_TimerHwIdType hwUnitId,Adc_TRGOSignalType TrgoSel);
#endif

#if (STD_ON == ADC_LIMIT_VALUE_DETECTION_ENABLE)
void ADC_Hw_OperationAnalogWatchdog(uint8 adc, uint8 status);
void ADC_Hw_AnalogWatchdogLowThreshold(uint8 adc, uint16 lowThreshold);
void ADC_Hw_AnalogWatchdogHighThreshold(uint8 adc, uint16 highThreshold);
void ADC_Hw_OperationAnalogWatchdogSingleChannel(uint8 adc, uint8 status);
void ADC_Hw_AnalogWatchdogSingleChannel(uint8 adc, uint32 channel);
#endif

#if (ADC_DMA_TRANSFER_MODE == STD_ON)
FUNC(void, USART_CODE) Adc_Hw_DmaConfig(Adc_GroupType Group);
void Adc_Hw_TopDmaPAddrRefresh(uint8 adc);
#endif

FUNC(void, USART_CODE) ADC_IRQHandler(void);
/**@} end of group ADC_Fuctions */

#define ADC_STOP_SEC_CODE
#include "Adc_MemMap.h"

#ifdef __cplusplus
}
#endif

#endif

/**@} end of group ADC_Driver */
/**@} end of group APM32F4xx_StdPeriphDriver */
