123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- #ifndef ADC_IPW_H
- #define ADC_IPW_H
- #ifdef __cplusplus
- extern "C"{
- #endif
- #include "Adc_Ipw_Types.h"
- #include "Adc_Ipw_Cfg.h"
- #include "Adc_Ip.h"
- #ifdef ADC_DMA_SUPPORTED
- #include "Dma_Ip.h"
- #endif
- #include "Pdb_Adc_Ip.h"
- #define ADC_VENDOR_ID_IPW_H 43
- #define ADC_AR_RELEASE_MAJOR_VERSION_IPW_H 4
- #define ADC_AR_RELEASE_MINOR_VERSION_IPW_H 4
- #define ADC_AR_RELEASE_REVISION_VERSION_IPW_H 0
- #define ADC_SW_MAJOR_VERSION_IPW_H 1
- #define ADC_SW_MINOR_VERSION_IPW_H 0
- #define ADC_SW_PATCH_VERSION_IPW_H 0
- #if (ADC_VENDOR_ID_IPW_H != ADC_VENDOR_ID_IPW_TYPES_H)
- #error "Adc_Ipw.h and Adc_Ipw_Types.h have different vendor ids"
- #endif
- #if ((ADC_AR_RELEASE_MAJOR_VERSION_IPW_H != ADC_AR_RELEASE_MAJOR_VERSION_IPW_TYPES_H) || \
- (ADC_AR_RELEASE_MINOR_VERSION_IPW_H != ADC_AR_RELEASE_MINOR_VERSION_IPW_TYPES_H) || \
- (ADC_AR_RELEASE_REVISION_VERSION_IPW_H != ADC_AR_RELEASE_REVISION_VERSION_IPW_TYPES_H) \
- )
- #error "AutoSar Version Numbers of Adc_Ipw.h and Adc_Ipw_Types.h are different"
- #endif
- #if ((ADC_SW_MAJOR_VERSION_IPW_H != ADC_SW_MAJOR_VERSION_IPW_TYPES_H) || \
- (ADC_SW_MINOR_VERSION_IPW_H != ADC_SW_MINOR_VERSION_IPW_TYPES_H) || \
- (ADC_SW_PATCH_VERSION_IPW_H != ADC_SW_PATCH_VERSION_IPW_TYPES_H) \
- )
- #error "Software Version Numbers of Adc_Ipw.h and Adc_Ipw_Types.h are different"
- #endif
- #if (ADC_VENDOR_ID_IPW_H != ADC_VENDOR_ID_IPW_CFG_H)
- #error "Adc_Ipw.h and Adc_Ipw_Cfg.h have different vendor ids"
- #endif
- #if ((ADC_AR_RELEASE_MAJOR_VERSION_IPW_H != ADC_AR_RELEASE_MAJOR_VERSION_IPW_CFG_H) || \
- (ADC_AR_RELEASE_MINOR_VERSION_IPW_H != ADC_AR_RELEASE_MINOR_VERSION_IPW_CFG_H) || \
- (ADC_AR_RELEASE_REVISION_VERSION_IPW_H != ADC_AR_RELEASE_REVISION_VERSION_IPW_CFG_H) \
- )
- #error "AutoSar Version Numbers of Adc_Ipw.h and Adc_Ipw_Cfg.h are different"
- #endif
- #if ((ADC_SW_MAJOR_VERSION_IPW_H != ADC_SW_MAJOR_VERSION_IPW_CFG_H) || \
- (ADC_SW_MINOR_VERSION_IPW_H != ADC_SW_MINOR_VERSION_IPW_CFG_H) || \
- (ADC_SW_PATCH_VERSION_IPW_H != ADC_SW_PATCH_VERSION_IPW_CFG_H) \
- )
- #error "Software Version Numbers of Adc_Ipw.h and Adc_Ipw_Cfg.h are different"
- #endif
- #if (ADC_VENDOR_ID_IPW_H != ADC_IP_VENDOR_ID_H)
- #error "Adc_Ipw.h and Adc_Ip.h have different vendor ids"
- #endif
- #if ((ADC_AR_RELEASE_MAJOR_VERSION_IPW_H != ADC_IP_AR_RELEASE_MAJOR_VERSION_H) || \
- (ADC_AR_RELEASE_MINOR_VERSION_IPW_H != ADC_IP_AR_RELEASE_MINOR_VERSION_H) || \
- (ADC_AR_RELEASE_REVISION_VERSION_IPW_H != ADC_IP_AR_RELEASE_REVISION_VERSION_H) \
- )
- #error "AutoSar Version Numbers of Adc_Ipw.h and Adc_Ip.h are different"
- #endif
- #if ((ADC_SW_MAJOR_VERSION_IPW_H != ADC_IP_SW_MAJOR_VERSION_H) || \
- (ADC_SW_MINOR_VERSION_IPW_H != ADC_IP_SW_MINOR_VERSION_H) || \
- (ADC_SW_PATCH_VERSION_IPW_H != ADC_IP_SW_PATCH_VERSION_H) \
- )
- #error "Software Version Numbers of Adc_Ipw.h and Adc_Ip.h are different"
- #endif
- #if (ADC_VENDOR_ID_IPW_H != PDB_ADC_IP_VENDOR_ID_H)
- #error "Adc_Ipw.h and Pdb_Adc_Ip.h have different vendor ids"
- #endif
- #if ((ADC_AR_RELEASE_MAJOR_VERSION_IPW_H != PDB_ADC_IP_AR_RELEASE_MAJOR_VERSION_H) || \
- (ADC_AR_RELEASE_MINOR_VERSION_IPW_H != PDB_ADC_IP_AR_RELEASE_MINOR_VERSION_H) || \
- (ADC_AR_RELEASE_REVISION_VERSION_IPW_H != PDB_ADC_IP_AR_RELEASE_REVISION_VERSION_H) \
- )
- #error "AutoSar Version Numbers of Adc_Ipw.h and Pdb_Adc_Ip.h are different"
- #endif
- #if ((ADC_SW_MAJOR_VERSION_IPW_H != PDB_ADC_IP_SW_MAJOR_VERSION_H) || \
- (ADC_SW_MINOR_VERSION_IPW_H != PDB_ADC_IP_SW_MINOR_VERSION_H) || \
- (ADC_SW_PATCH_VERSION_IPW_H != PDB_ADC_IP_SW_PATCH_VERSION_H) \
- )
- #error "Software Version Numbers of Adc_Ipw.h and Pdb_Adc_Ip.h are different"
- #endif
- #ifndef DISABLE_MCAL_INTERMODULE_ASR_CHECK
- #ifdef ADC_DMA_SUPPORTED
- #if ((ADC_AR_RELEASE_MAJOR_VERSION_IPW_H != DMA_IP_AR_RELEASE_MAJOR_VERSION_H) || \
- (ADC_AR_RELEASE_MINOR_VERSION_IPW_H != DMA_IP_AR_RELEASE_MINOR_VERSION_H) \
- )
- #error "AutoSar Version Numbers of Adc_Ipw.h and Dma_Ip.h are different"
- #endif
- #endif
- #endif
- #define ADC_IPW_CALCULATE_CHAN_NUMBER(x) (((x) >= ADC_MAX_CHAN_COUNT) ? ADC_MAX_CHAN_COUNT : ((x)%ADC_MAX_CHAN_COUNT))
- #ifdef ADC_DMA_SUPPORTED
- #define ADC_IPW_INVALID_DATA_RESULT_DMA (0xFFFFU)
- #define ADC_IPW_GET_COMPLEMENT_OF_2(x) ((uint32)(~((uint32)(x)) + 1U))
- #endif
- #define ADC_START_SEC_CODE
- #include "Adc_MemMap.h"
- #if ((defined(ADC_UNIT_0_ISR_USED)) || (defined(ADC_UNIT_1_ISR_USED)) || \
- (defined(ADC_DMA_SUPPORTED)) || (ADC_READ_GROUP_API == STD_ON) \
- )
- uint8 Adc_Ipw_CalculateNumsBitShift
- (
- Adc_Ip_ResolutionType Resolution
- );
- #endif
- #ifdef ADC_DMA_SUPPORTED
- void Adc_Ipw_StartDmaOperation
- (
- Adc_HwUnitType Unit,
- Adc_GroupType Group,
- uint8 u8NumChannel,
- uint32 u32CoreId
- );
- #endif
- Std_ReturnType Adc_Ipw_Init(const Adc_Ipw_Config * pIpwCfg, const uint32 u32CoreId);
- #if (ADC_DEINIT_API == STD_ON)
- Std_ReturnType Adc_Ipw_DeInit(uint32 u32CoreId);
- #endif
- #if (ADC_ENABLE_START_STOP_GROUP_API == STD_ON)
- void Adc_Ipw_StartNormalConversion
- (
- Adc_HwUnitType Unit,
- uint32 u32CoreId
- );
- Std_ReturnType Adc_Ipw_StopCurrentConversion
- (
- Adc_HwUnitType Unit,
- Adc_GroupType Group,
- uint32 u32CoreId
- );
- #endif
- #if (ADC_HW_TRIGGER_API == STD_ON)
- Std_ReturnType Adc_Ipw_EnableHardwareTrigger
- (
- Adc_GroupType Group,
- Adc_HwUnitType Unit,
- uint32 u32CoreId
- );
- void Adc_Ipw_DisableHardwareTrigger
- (
- Adc_GroupType Group,
- Adc_HwUnitType Unit,
- uint32 u32CoreId
- );
- #endif
- boolean Adc_Ipw_CheckValidConversion
- (
- Adc_HwUnitType PhysicalHwUnitId,
- Adc_ChannelIndexType StartIndex,
- Adc_ChannelIndexType EndIndex
- );
- #if (ADC_READ_GROUP_API == STD_ON)
- Std_ReturnType Adc_Ipw_ReadGroup
- (
- const Adc_GroupType Group,
- Adc_ValueGroupType * pDataPtr,
- boolean * pFlag,
- uint32 u32CoreId
- );
- #endif
- #if (ADC_ENABLE_READ_RAW_DATA_API == STD_ON)
- Std_ReturnType Adc_Ipw_GetConvData
- (
- Adc_HwUnitType Unit,
- Adc_ChannelType Channel,
- uint32 u32CoreId,
- uint16 * Result
- );
- #endif
- #if (ADC_CALIBRATION == STD_ON)
- void Adc_Ipw_Calibrate
- (
- Adc_HwUnitType Unit,
- Adc_CalibrationStatusType * Status,
- uint32 u32CoreId
- );
- #endif
- void Adc_Ipw_ConfigureConversion
- (
- Adc_HwUnitType Unit,
- Adc_GroupType Group,
- Adc_HwTriggerTimerType Trigger,
- uint8 NumChannel,
- uint32 u32CoreId
- );
- #ifdef ADC_DMA_SUPPORTED
- void Adc_Ipw_ConfigureDmaConversion
- (
- Adc_HwUnitType Unit,
- Adc_GroupType Group,
- Adc_HwTriggerTimerType Trigger,
- uint8 NumChannel
- );
- #endif
- #if (ADC_HW_TRIGGER_API == STD_ON)
- void Adc_Ipw_StartHwTrigConversion
- (
- Adc_HwUnitType Unit,
- Adc_GroupType Group,
- uint32 u32CoreId
- );
- #endif
- #if (ADC_DUAL_CLOCK_MODE == STD_ON)
- Std_ReturnType Adc_Ipw_SetClockMode
- (
- Adc_SelectPrescalerType Prescaler,
- uint32 u32CoreId
- );
- #endif
- #if (ADC_ENABLE_LIMIT_CHECK == STD_ON)
- boolean Adc_Ipw_CheckConversionValuesInRange
- (
- Adc_ValueGroupType Value,
- Adc_HwUnitType LogicalHwUnitId,
- Adc_ChannelType ChannelIndex,
- uint32 u32CoreId
- );
- #endif
- #if (ADC_ENABLE_QUEUING == STD_ON)
- void Adc_RemoveFromQueue
- (
- const Adc_HwUnitType Unit,
- const Adc_QueueIndexType CurQueueIndex
- );
- #endif
- uint32 Adc_GetCoreID(void);
- #define ADC_STOP_SEC_CODE
- #include "Adc_MemMap.h"
- #ifdef __cplusplus
- }
- #endif
- #endif
|