Blog

ADC module of Autosar MCAL initializes and controls the internal analogue Digital converter units of the microcontroller.

It provides 

Concept’s in ADC Module:

  1.  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.
  2. 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
  3.  

Important terminologies:

  1. ADC HW Unit:
  2. ADC Module:
  3. ADC Channel:
  4. ADC Channel Group:
  5. ADC Result Buffer/ADC Streaming Buffer/ADC Strem Buffer
  6. Software Trigger
  7. Hardware Trigger
  8. Conversion Mode: One-Shot and continous.
  9. Sample Time
  10. Conversion Time
  11. Acquistaion Time:

Autosar Dependent Modules:

  1. MCU Module
  2. PORT Module

Add Your Heading Text Here

ADC Driver has API’s for interacting with following peripherals of MCU:

  1. PDB (Programmable Delay Block)
  2. BCTU (Body Cross Triggering Unit)
  3. CTU (Cross Trigger Unit)

 

 

Macros in ADC MCAL Module controlling enabling and disabling of Function API’s.

  1. ADC_POWER_STATE_SUPPORTED
  2. ADC_SET_HW_UNIT_POWER_MODE_API
  3. ADC_BCTU_AVAILABLE(Body Control Triggering Unit is peripheral)
  4. ADC_ENABLE_CTUTRIG_NONAUTO_API (Cross Triggering Unit)
  5. ADC_ENABLE_READ_RAW_DATA_API
  6. ADC_ENABLE_CH_DISABLE_CH_NONAUTO_API
  7. ADC_GET_INJECTED_CONVERSION_STATUS_API
  8. ADC_CALIBRATION
  9. ADC_SELF_TEST
  10. ADC_ENABLE_CONFIGURE_THRESHOLD_NONAUTO_API
  11. ADC_WDG_SUPPORTED
  12. ADC_DUAL_CLOCK_MODE
  13. ADC_CTU_CONTROL_MODE_EXTRA_APIS
  14. ADC_SETCHANNEL_API
  15. ADC_CMR_REGISTER_NOT_SUPPORTED
  16. ADC_ENABLE_CTU_CONTROL_MODE_API
  17. ADC_CTU_AVAILABLE
  18. ADC_ENABLE_TEMPSENSE_API

Functions guarded by macros

Non Guarded Functions:

  1. Adc_Init
  2. Asc_SetupResultBuffer
  3. Adc_GetGroupStatus()
  4. Adc_GetStreamLastPointer()

ADC_DEINIT_API Macro Guarded

  1. Adc_DeInit()

ADC_ENABLE_START_STOP_GROUP_API Macro Guarded:

  1. Adc_StartGroupConversion
  2. Adc_StopGroupConversion

ADC_READ_GROUP_API Macro Guarded

  1. Adc_ReadGroup()

ADC_HW_TRIGGER_API Macro Guarded

  1. Adc_EnableHardwareTrigger()
  2. Adc_DisableHardwareTrigger()

ADC_GRP_NOTIF_CAPABILITY Macro Guarded:

  1. Adc_EnableGroupNotification()
  2. Adc_DisableGroupNotification()

ADC_VERSION_INFO_API Macro Guarded:

  1. Adc_GetVersionInfo()

ADC_POWER_STATE_SUPPORTED Macro Guarded:

  1. Adc_SetPowerState()
  2. Adc_GetCurrentPowerState()
  3. Adc_GetTargetPowerState()
  4. Adc_PreparePowerState()

ADC_SET_HW_UNIT_POWER_MODE_API Macro Guarded:

  1. Adc_SetHwUnitPowerMode()

ADC_SET_HW_UNIT_POWER_MODE_API && ADC_BCTU_AVAILABLE && ADC_ENABLE_CTU_CONTROL_MODE_API Macro Guarded:

  1. Adc_CtuSetPowerMode

ADC_ENABLE_CTUTRIG_NONAUTO_API Macro guarded:

  1. Adc_EnableCTUTrigger()
  2. Adc_DisableCTUTrigger()
  3. Adc_HwResultReadGroup()

ADC_ENABLE_READ_RAW_DATA_API Macro Guarded:

  1. Adc_ReadRawData()

ADC_ENABLE_CH_DISABLE_CH_NONAUTO_API Macro guarded:

  1. Adc_EnableChannel()
  2. Adc_DisableChannel()

ADC_GET_INJECTED_CONVERSION_STATUS_API Macro Guarded:

  1. Adc_GetInjectedConversionStatus

ADC_CALIBRATION Macro Guarded:

  1. Adc_Calibrate()

ADC_SELF_TEST Macro guarded:

  1. Adc_SelfTest

ADC_ENABLE_CONFIGURE_THRESHOLD_NONAUTO_API Macro guarded:

  1. Adc_ConfigureThreshold()

ADC_WDG_SUPPORTED Macro guarded:

  1. Adc_EnableWdgNotification()
  2. Adc_DisableWdgNotification()

ADC_DUAL_CLOCK_MODE Macro Guarded:

  1. Adc_SetClockMode()

ADC_CTU_CONTROL_MODE_EXTRA_APIS Macro guarded:

  1. Adc_CtuWriteTriggerEnableMask()
  2. Adc_CtuSetTriggerEnable()
  3. Adc_CtuSetTriggerAdcCmdAddress
  4. Adc_CtuSetTriggerCompare

ADC_SETCHANNEL_API Macro guarded:

  1. Adc_SetChannel()

ADC_CMR_REGISTER_NOT_SUPPORTED Macro guarded:

  1. Adc_GetCmrRegister()

ADC_ENABLE_CTU_CONTROL_MODE_API macro guarded:

  1. Adc_EnableCtuControlMode()
  2. Adc_DisableCtuControlMode
  3. Adc_CtuEnableHwTrigger
  4. Adc_CtuDisableHwTrigger
  5. Adc_CtuStartConversion
  6. Adc_CtuReadFifoData
  7. Adc_CtuReadFifoResult
  8. Adc_CtuSetFifoWatermark
  9. Adc_CtuEnableNotification
  10. Adc_CtuDisableNotification
  11. Adc_CtuSetList
  12. Adc_CtuSetListPointer

ADC_ENABLE_CTU_CONTROL_MODE_API && ADC_CTU_AVAILABLE macro guarded:

  1. Adc_CtuMasterReload()

ADC_ENABLE_CTU_CONTROL_MODE_API && ADC_BCTU_AVAILABLE Macro guarded:

  1. Adc_CtuReadConvData
  2. Adc_CtuReadConvResult
  3. Adc_CtuStopLoopConversions

ADC_ENABLE_TEMPSENSE_API Macro guarded:

  1. Adc_TempSenseCalculateTemp
  2. Adc_TempSenseGetTemp
  3. Adc_TempSenseSetPowerMode

 

 

 

Kunal Gupta
Author: Kunal Gupta

Author

Kunal Gupta

Leave a comment

Stay Updated With Us

Error: Contact form not found.

      Blog