ADC module of Autosar MCAL initializes and controls the internal analogue Digital converter units of the microcontroller.
It provides
Concept’s in ADC Module:
- The ADC module works on so called ADC Channel Groups, which are build from so
called ADC Channels.An ADC Channel Group combines an analogue input pin (ADC
Channel), the needed ADC circuitry itself and conversion result register into an entity
that can be individually controlled and accessed via the ADC module. - One Shot mode and streaming mode in ADC: In Oneshot mode the ADC performs a single conversion when triggered. It measures the analog signal and converts it to a digital value once. Manual triggered is required meaning we have to initiate the conversion process each time we need a new value. In streaming mode, ADC continously converts the analog signal to digital value at soecified rate without needing a manual trigger for each comversion
Important terminologies:
- ADC HW Unit:
- ADC Module:
- ADC Channel:
- ADC Channel Group:
- ADC Result Buffer/ADC Streaming Buffer/ADC Strem Buffer
- Software Trigger
- Hardware Trigger
- Conversion Mode: One-Shot and continous.
- Sample Time
- Conversion Time
- Acquistaion Time:
Autosar Dependent Modules:
- MCU Module
- PORT Module
Add Your Heading Text Here
ADC Driver has API’s for interacting with following peripherals of MCU:
- PDB (Programmable Delay Block)
- BCTU (Body Cross Triggering Unit)
- CTU (Cross Trigger Unit)
Macros in ADC MCAL Module controlling enabling and disabling of Function API’s.
- ADC_POWER_STATE_SUPPORTED
- ADC_SET_HW_UNIT_POWER_MODE_API
- ADC_BCTU_AVAILABLE(Body Control Triggering Unit is peripheral)
- ADC_ENABLE_CTUTRIG_NONAUTO_API (Cross Triggering Unit)
- ADC_ENABLE_READ_RAW_DATA_API
- ADC_ENABLE_CH_DISABLE_CH_NONAUTO_API
- ADC_GET_INJECTED_CONVERSION_STATUS_API
- ADC_CALIBRATION
- ADC_SELF_TEST
- ADC_ENABLE_CONFIGURE_THRESHOLD_NONAUTO_API
- ADC_WDG_SUPPORTED
- ADC_DUAL_CLOCK_MODE
- ADC_CTU_CONTROL_MODE_EXTRA_APIS
- ADC_SETCHANNEL_API
- ADC_CMR_REGISTER_NOT_SUPPORTED
- ADC_ENABLE_CTU_CONTROL_MODE_API
- ADC_CTU_AVAILABLE
- ADC_ENABLE_TEMPSENSE_API
Functions guarded by macros
Non Guarded Functions:
- Adc_Init
- Asc_SetupResultBuffer
- Adc_GetGroupStatus()
- Adc_GetStreamLastPointer()
ADC_DEINIT_API Macro Guarded
- Adc_DeInit()
ADC_ENABLE_START_STOP_GROUP_API Macro Guarded:
- Adc_StartGroupConversion
- Adc_StopGroupConversion
ADC_READ_GROUP_API Macro Guarded
- Adc_ReadGroup()
ADC_HW_TRIGGER_API Macro Guarded
- Adc_EnableHardwareTrigger()
- Adc_DisableHardwareTrigger()
ADC_GRP_NOTIF_CAPABILITY Macro Guarded:
- Adc_EnableGroupNotification()
- Adc_DisableGroupNotification()
ADC_VERSION_INFO_API Macro Guarded:
- Adc_GetVersionInfo()
ADC_POWER_STATE_SUPPORTED Macro Guarded:
- Adc_SetPowerState()
- Adc_GetCurrentPowerState()
- Adc_GetTargetPowerState()
- Adc_PreparePowerState()
ADC_SET_HW_UNIT_POWER_MODE_API Macro Guarded:
- Adc_SetHwUnitPowerMode()
ADC_SET_HW_UNIT_POWER_MODE_API && ADC_BCTU_AVAILABLE && ADC_ENABLE_CTU_CONTROL_MODE_API Macro Guarded:
- Adc_CtuSetPowerMode
ADC_ENABLE_CTUTRIG_NONAUTO_API Macro guarded:
- Adc_EnableCTUTrigger()
- Adc_DisableCTUTrigger()
- Adc_HwResultReadGroup()
ADC_ENABLE_READ_RAW_DATA_API Macro Guarded:
- Adc_ReadRawData()
ADC_ENABLE_CH_DISABLE_CH_NONAUTO_API Macro guarded:
- Adc_EnableChannel()
- Adc_DisableChannel()
ADC_GET_INJECTED_CONVERSION_STATUS_API Macro Guarded:
- Adc_GetInjectedConversionStatus
ADC_CALIBRATION Macro Guarded:
- Adc_Calibrate()
ADC_SELF_TEST Macro guarded:
- Adc_SelfTest
ADC_ENABLE_CONFIGURE_THRESHOLD_NONAUTO_API Macro guarded:
- Adc_ConfigureThreshold()
ADC_WDG_SUPPORTED Macro guarded:
- Adc_EnableWdgNotification()
- Adc_DisableWdgNotification()
ADC_DUAL_CLOCK_MODE Macro Guarded:
- Adc_SetClockMode()
ADC_CTU_CONTROL_MODE_EXTRA_APIS Macro guarded:
- Adc_CtuWriteTriggerEnableMask()
- Adc_CtuSetTriggerEnable()
- Adc_CtuSetTriggerAdcCmdAddress
- Adc_CtuSetTriggerCompare
ADC_SETCHANNEL_API Macro guarded:
- Adc_SetChannel()
ADC_CMR_REGISTER_NOT_SUPPORTED Macro guarded:
- Adc_GetCmrRegister()
ADC_ENABLE_CTU_CONTROL_MODE_API macro guarded:
- Adc_EnableCtuControlMode()
- Adc_DisableCtuControlMode
- Adc_CtuEnableHwTrigger
- Adc_CtuDisableHwTrigger
- Adc_CtuStartConversion
- Adc_CtuReadFifoData
- Adc_CtuReadFifoResult
- Adc_CtuSetFifoWatermark
- Adc_CtuEnableNotification
- Adc_CtuDisableNotification
- Adc_CtuSetList
- Adc_CtuSetListPointer
ADC_ENABLE_CTU_CONTROL_MODE_API && ADC_CTU_AVAILABLE macro guarded:
- Adc_CtuMasterReload()
ADC_ENABLE_CTU_CONTROL_MODE_API && ADC_BCTU_AVAILABLE Macro guarded:
- Adc_CtuReadConvData
- Adc_CtuReadConvResult
- Adc_CtuStopLoopConversions
ADC_ENABLE_TEMPSENSE_API Macro guarded:
- Adc_TempSenseCalculateTemp
- Adc_TempSenseGetTemp
- Adc_TempSenseSetPowerMode
Author: Kunal Gupta
Author