DEENESPTFRRUARHIKOZHNL

ADC Driver (Adc)

ModulAdc (ADC Driver)
BSW-Modul-ID123
Standard-Header#include "Adc.h"
SWS-SpezifikationAUTOSAR_SWS_ADCDriver.pdf
ClusterMicrocontroller Abstraction (MCAL)

Module guideAI-GENERATED

Controls the analog-to-digital converters of the microcontroller via channel groups and provides their raw values.
AI-GENERATED unreviewed Model: claude-opus-5-5 · Effort: high · Temperature: not controllable · Prompt: b520b4ed0d83 Provenance Open questions (5)
Causal anchor: R20-11 Valid from R20-11 Synthesized for this specification release.
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Controls the analog-to-digital converters of the microcontroller via channel groups and provides their raw values.

In the MCAL, the ADC driver encapsulates the analog-to-digital converters of the microcontroller and always converts channels as configured groups: software- or hardware-triggered, one-shot or continuous [SWS_Adc_00515]. After Adc_Init, users such as the IoHwAb start conversions. They detect completion via status query or notification, then read the raw values with Adc_ReadGroup or Adc_GetStreamLastPointer. Optionally, the driver supports two-stage power state transitions. Key boundary condition: Without a result buffer set up beforehand with Adc_SetupResultBuffer, no group conversion must start [SWS_Adc_91000].

In the MCAL, the ADC driver encapsulates the analog-to-digital converters of the microcontroller. EcuM initializes it with Adc_Init [SWS_Adc_00365]. A typical user is the IoHwAb; after completion of a group conversion, it receives the notification IoHwAb_AdcNotification<#groupID> [SWS_Adc_00082]. Before the first conversion, a sufficiently large result buffer must be set up with Adc_SetupResultBuffer after each reset [SWS_Adc_91000].

kontext swc Sensor/Actuator SWC iohwab IoHwAb (Adc User) swc->iohwab Spannungswert anfordern bswm BswM / Rte bswm->iohwab Leistungsmodus wechseln ecum EcuM adc Adc (MCAL) ecum->adc Adc_Init / Adc_DeInit iohwab->adc Control and read groups, power state APIs adc->iohwab IoHwAb_AdcNotification<#groupID>, IoHwAb_Adc_NotifyReadyForPowerState<#Mode> det Det adc->det Development and runtime errors hw ADC Conversion Unit adc->hw Wandlung starten / stoppen hw->adc Wandlung abgeschlossen trig HW Trigger Source trig->hw Trigger-Ereignis

Context diagram: EcuM initializes, IoHwAb controls and is notified, errors go to DET, conversions run in the peripheral. Sources: SWS IoHwAb p. 55, [SWS_Adc_00377]

The driver always converts channels as configured groups. Each group has three settings:

The group status shows the progress with ADC_IDLE, ADC_BUSY, ADC_COMPLETED, and ADC_STREAM_COMPLETED [SWS_Adc_00513].

gruppenstatus idle ADC_IDLE busy ADC_BUSY idle->busy Adc_StartGroupConversion busy->idle Adc_StopGroupConversion comp ADC_COMPLETED busy->comp Round of all channels finished [remaining samples >= 1] scomp ADC_STREAM_COMPLETED busy->scomp Streaming-Puffer voll comp->idle Adc_StopGroupConversion comp->busy Adc_ReadGroup / Adc_GetStreamLastPointer comp->scomp Streaming-Puffer voll scomp->idle Adc_ReadGroup / Adc_GetStreamLastPointer [linear] scomp->idle Adc_StopGroupConversion scomp->busy Adc_ReadGroup / Adc_GetStreamLastPointer [circular]

State diagram: Group status for continuous streaming conversion; a linear buffer ends in ADC_IDLE after reading. Sources: SWS ADC p. 39

Software-triggered groups are started by Adc_StartGroupConversion and stopped by Adc_StopGroupConversion. Hardware-triggered groups are switched via Adc_EnableHardwareTrigger and Adc_DisableHardwareTrigger [SWS_Adc_00367], [SWS_Adc_91001]. The user detects completion by polling Adc_GetGroupStatus or via notification; the user must activate this separately SWS ADC p. 57. Unscaled raw values are read with Adc_ReadGroup or Adc_GetStreamLastPointer [SWS_Adc_00369], [SWS_Adc_00375].

Competing requests are governed by priority mechanism, queuing, and preemption strategy [SWS_Adc_00522], [SWS_Adc_00523]. Without both, the driver rejects a second request with ADC_E_BUSY [SWS_Adc_91006]. Optionally, the driver transitions power states in two stages: prepare with Adc_PreparePowerState, switch with Adc_SetPowerState. Asynchronous parts run in Adc_Main_PowerTransitionManager [SWS_Adc_00478], [SWS_Adc_00479].

Role of the ADC Driver Between IoHwAb and Converter Hardware

The ADC driver is the MCAL module for the analog-to-digital converters of the microcontroller. Adc_Init initializes ADC hardware units and the driver [SWS_Adc_00365]. All further services operate on channel groups that are addressed via a numerical ID (Adc_GroupType) [SWS_Adc_00507]. A typical user is the I/O Hardware Abstraction: It starts conversions on behalf of a sensor SWC and is notified via IoHwAb_AdcNotification<#groupID> after completion [SWS_Adc_00082], SWS IoHwAb p. 55. EcuM initializes the driver, for which Adc_Init is an optional interface SWS EcuM p. 142.

The driver resides at the lowest architectural level. It therefore offers no callbacks for lower modules SWS ADC p. 79. The ADC API does not access hardware result registers directly. Results always reach the user via application buffers SWS ADC p. 27. The driver reports errors via Det_ReportError [SWS_Adc_00377]. The cited document passages originate predominantly from R23-11 to R25-11. The requirements are normative for R20-11.

kontext swc Sensor/Actuator SWC iohwab IoHwAb (Adc User) swc->iohwab Spannungswert anfordern bswm BswM / Rte bswm->iohwab Leistungsmodus wechseln ecum EcuM adc Adc (MCAL) ecum->adc Adc_Init / Adc_DeInit iohwab->adc Control and read groups, power state APIs adc->iohwab IoHwAb_AdcNotification<#groupID>, IoHwAb_Adc_NotifyReadyForPowerState<#Mode> det Det adc->det Development and runtime errors hw ADC Conversion Unit adc->hw Wandlung starten / stoppen hw->adc Wandlung abgeschlossen trig HW Trigger Source trig->hw Trigger-Ereignis

Context diagram: The ADC driver mediates between EcuM, IoHwAb, DET, and the converter peripheral; notifications flow upward only. Sources: SWS IoHwAb p. 55, [SWS_Adc_00082], [SWS_Adc_00480], [SWS_Adc_00377]

The implementation must reject configurations with unsupported partition assignments [SWS_Adc_00531]. The partitions referenced via AdcKernelEcucPartitionRef must be a subset of the partitions of AdcEcucPartitionRef [SWS_Adc_CONSTR_00001]. Interpretation: This is likely based on the division into an interrupt-related kernel part and an interface part, as shown by the memory mapping example for Adc SWS MemMap p. 57. Question Q-bb6e1ddff67fa0c3 (open)

Lifecycle: Initialization, Result Buffer, and Deinitialization

After reset, the driver is in ADC_UNINIT. Adc_Init leads to ADC_INIT, Adc_DeInit leads back SWS ADC p. 31. Adc_Init is synchronous and non-reentrant. In variant PB, ConfigPtr points to the configuration set; variant PC requires NULL_PTR [SWS_Adc_00365]. Adc_ConfigType is an implementation-specific structure [SWS_Adc_00505]. The configurator creates symbolic names for channels and groups in the configuration header SWS ADC p. 123.

lebenszyklus cluster_init ADC_INIT (Modus je Gruppe konfiguriert) reset Reset uninit ADC_UNINIT reset->uninit oneshot ONE-SHOT uninit->oneshot Adc_Init [ONE_SHOT] cont CONTINUOUS uninit->cont Adc_Init [CONTINUOUS] oneshot->uninit Adc_DeInit cont->uninit Adc_DeInit

State diagram: Adc_Init and Adc_DeInit switch between ADC_UNINIT and ADC_INIT; one-shot and continuous are configuration options per group. Sources: SWS ADC p. 31, SWS ADC p. 91

After each reset, the user must pass the start address of the result buffer using Adc_SetupResultBuffer prior to the first conversion of a group. The application ensures that the buffer can hold all results of the group [SWS_Adc_91000]. No conversion may start without a validly initialized buffer pointer SWS ADC p. 54.

Adc_DeInit brings all HW units into a state comparable to power-on reset [SWS_Adc_00366]. The service disables all used interrupts and notifications. It is only permitted if all groups are in ADC_IDLE, and can be disabled via AdcDeInitApi SWS ADC p. 59.

Channel Groups: Trigger, Conversion Mode, and Access Mode

A group bundles channels [SWS_Adc_00517], [SWS_Adc_00506]. It is configured along three axes:

  • Trigger source: ADC_TRIGG_SRC_SW or ADC_TRIGG_SRC_HW [SWS_Adc_00514].
  • Conversion mode: ADC_CONV_MODE_ONESHOT converts each channel exactly once per trigger. ADC_CONV_MODE_CONTINUOUS converts continuously and is only possible with a software trigger [SWS_Adc_00515].
  • Access mode: ADC_ACCESS_MODE_SINGLE or ADC_ACCESS_MODE_STREAMING [SWS_Adc_00528]. For streaming, Adc_StreamNumSampleType defines the number of rounds [SWS_Adc_00518]. A linear buffer stops the conversion as soon as it is full; a circular buffer wraps around [SWS_Adc_00519].

Prescaler, conversion time, sampling time, and resolution are not API types [SWS_Adc_00509], [SWS_Adc_00510], [SWS_Adc_00511], [SWS_Adc_00512]. For hardware triggers, the edge and timer reload can be set if supported by the hardware [SWS_Adc_00520], [SWS_Adc_00521]. Results are unscaled raw values, aligned left or right [SWS_Adc_00508], [SWS_Adc_00525].

The progress of a group is described by Adc_StatusType [SWS_Adc_00513]:

  • ADC_IDLE: not started.
  • ADC_BUSY: conversion in progress.
  • ADC_COMPLETED: one round is completed, but not the last one.
  • ADC_STREAM_COMPLETED: result buffer complete.

The transitions depend on the configuration SWS ADC p. 39.

gruppenstatus idle ADC_IDLE busy ADC_BUSY idle->busy Adc_StartGroupConversion busy->idle Adc_StopGroupConversion comp ADC_COMPLETED busy->comp Round of all channels finished [remaining samples >= 1] scomp ADC_STREAM_COMPLETED busy->scomp Streaming-Puffer voll comp->idle Adc_StopGroupConversion comp->busy Adc_ReadGroup / Adc_GetStreamLastPointer comp->scomp Streaming-Puffer voll scomp->idle Adc_ReadGroup / Adc_GetStreamLastPointer [linear] scomp->idle Adc_StopGroupConversion scomp->busy Adc_ReadGroup / Adc_GetStreamLastPointer [circular]

State diagram: Group status during continuous, software-triggered conversion with streaming; linear buffer ends in ADC_IDLE after reading, circular buffer continues running. Sources: SWS ADC p. 39, SWS ADC p. 70, [SWS_Adc_00513]

From Start to Result: Typical Conversion Sequences

In the simplest case, a one-shot conversion takes place in three steps SWS ADC p. 91:

  1. Adc_StartGroupConversion starts the group asynchronously [SWS_Adc_00367].
  2. Adc_GetGroupStatus queries the status [SWS_Adc_00374].
  3. Adc_ReadGroup reads the results [SWS_Adc_00369].

The start resets the buffer pointer to the base address. It does not automatically enable the notification SWS ADC p. 57.

Software-triggered one-shot conversion without notificationAdc UserAdcADC Conversion UnitPrerequisite after reset: set up result bufferAdc_SetupResultBuffer(Group1, DataBufferPtr)E_OKAdc_StartGroupConversion(Group1)start conversion(Group1)Return (asynchronous)loopAdc_GetGroupStatus = ADC_BUSYAdc_GetGroupStatus(Group1)ADC_BUSYconversion completed(Group1)Adc_GetGroupStatus(Group1)ADC_STREAM_COMPLETEDAdc_ReadGroup(Group1, DataBufferPtr)E_OK, raw values in read buffer

Sequence diagram: Set up buffer, start, poll status, read. Sources: SWS ADC p. 91, [SWS_Adc_91000]

Instead of polling, the user can call Adc_EnableGroupNotification in advance [SWS_Adc_91003]. This service is enabled by AdcGrpNotifCapability SWS ADC p. 67. In continuous conversion, the driver reports each completed round. This only ends with Adc_StopGroupConversion [SWS_Adc_00368], SWS ADC p. 92.

Software-triggered continuous conversion with notificationAdc UserAdcADC Conversion UnitAdc_EnableGroupNotification(Group1)ReturnAdc_StartGroupConversion(Group1)start conversion(Group1)Returnloopje abgeschlossene Wandlungsrundeconversion completed(Group1)Adc_Notification_Group_1()Adc_ReadGroup(Group1, DataBufferPtr)E_OKAdc_StopGroupConversion(Group1)stop conversion(Group1)Return

Sequence diagram: For each completed round, notification and reading follow until the user stops. Sources: SWS ADC p. 92, [SWS_Adc_00082]

Hardware-triggered groups are enabled by Adc_EnableHardwareTrigger [SWS_Adc_91001]. Thereafter, the group converts upon each trigger event SWS ADC p. 62. Adc_DisableHardwareTrigger [SWS_Adc_91002] has several effects SWS ADC p. 65:

  • It removes pending requests.
  • It aborts an ongoing conversion if supported by the hardware.
  • It disables the notification.
  • It sets the group to ADC_IDLE.

With linear streaming, the trigger is disabled as soon as the buffer is full SWS ADC p. 95.

Hardware-triggered one-shot conversion with notificationAdc UserAdcADC Conversion UnitHW Trigger SourceAdc_EnableGroupNotification(Group1)Adc_EnableHardwareTrigger(Group1)enable hardware trigger(Group1)loopHW-Trigger-Ereignis, Benachrichtigung aktivstart conversion()conversion completed()Adc_Notification_Group_1()Adc_ReadGroup(Group1, DataBufferPtr)E_OKAdc_DisableGroupNotification(Group1)loopHW-Trigger-Ereignis, Benachrichtigung inaktivstart conversion()conversion completed()no notificationAdc_DisableHardwareTrigger(Group1)disable hardware trigger source(Group1)Group changes to ADC_IDLE

Sequence diagram: Each trigger event initiates a conversion; notifications are only issued if notification is active. Sources: SWS ADC p. 93

There are two ways to read:

  • Adc_ReadGroup copies the values of the last complete round in ascending channel order. If no results are available, it returns E_NOT_OK [SWS_Adc_00369], SWS ADC p. 61.
  • Adc_GetStreamLastPointer returns the number of valid samples per channel and a pointer to the most recent result of the first group channel [SWS_Adc_00375]. The user must account for the channel-wise buffer layout themselves SWS ADC p. 27.

Competing Groups: Priority, Queuing, and Preemption

Simultaneous requests are governed by Adc_PriorityImplementationType: no mechanism, hardware only, or hardware and software [SWS_Adc_00522]. Priorities range from 0 (lowest) to 255 [SWS_Adc_00516]. If a group is interrupted by a higher-priority group, its round restarts (ADC_GROUP_REPL_ABORT_RESTART) or is resumed (ADC_GROUP_REPL_SUSPEND_RESUME). In both cases, results of earlier rounds are preserved [SWS_Adc_00523].

Without priority and without queuing, the driver rejects a second request with ADC_E_BUSY SWS ADC p. 95. With software queuing, it stores the request and starts it later SWS ADC p. 96. With prioritization, the higher-priority group preempts the running one SWS ADC p. 97, SWS ADC p. 98. Adc_StopGroupConversion also removes a pending start request SWS ADC p. 58.

prioritaet start New group request while another group is converting prio Priority mechanism? (Adc_PriorityImplementationType) start->prio queue Queuing aktiviert? prio->queue ADC_PRIORITY_NONE higher Higher priority than running group? prio->higher ADC_PRIORITY_HW / ADC_PRIORITY_HW_SW busy Anforderung abgewiesen, Laufzeitfehler ADC_E_BUSY queue->busy no store Store request in queue, start after current group queue->store yes higher->store no repl Abort or suspend running group (Adc_GroupReplacementType) higher->repl yes conv Convert higher-priority group repl->conv resume Restart or resume suspended group conv->resume

Activity diagram: Whether a request is rejected, stored, or prioritized when the converter is busy depends on the priority mechanism and queuing. Sources: [SWS_Adc_00522], [SWS_Adc_00523], SWS ADC p. 99

Power States of the ADC Hardware

Power control is optional and restricted to the ADC peripheral. Architectural constraints are fulfilled by the upper layers; the driver only checks the invocation sequence SWS ADC p. 39. Adc_PowerStateType defines ADC_FULL_POWER (0) and states 1..255 with decreasing power consumption [SWS_Adc_00526]. The result of each request is reported by Adc_PowerStateRequestResultType [SWS_Adc_00527].

The transition takes place in two stages:

  1. Prepare: Adc_PreparePowerState starts the preparation [SWS_Adc_00478]. Asynchronous parts run in the cyclic Adc_Main_PowerTransitionManager [SWS_Adc_00498], [SWS_Adc_00479]. Its period is defined by AdcMainSchedulePeriod [SWS_Adc_00500]. In asynchronous mode, it reports readiness via IoHwAb_Adc_NotifyReadyForPowerState<#Mode> [SWS_Adc_00501], [SWS_Adc_00480].
  2. Switch: Adc_SetPowerState activates the prepared state [SWS_Adc_00475]. Preparatory actions such as idling channels are the responsibility of the users. There are no implicit intermediate states SWS ADC p. 81.
Asynchronous power state transition of the ADC via the IoHwAbBswMRteIoHwAbAdcUse Case: VorbereitungRTE/SchMSwitch (Moduswechsel)OnEntryRunnable_LowPowerModeA()IoHwAb_PreparePowerState_LowPowerModeA()Adc_PreparePowerState(PwrSts_1)E_OK, ADC_SERVICE_ACCEPTEDUse Case: Hintergrundverarbeitungloopcyclic until preparation is completedAdc_Main_PowerTransitionManager()IoHwAb_Adc_NotifyReadyForPowerStateLowPowerModeA()IoHwAb_PollForResults()Use Case: UmschaltenAdc_SetPowerState(&Result)E_OKAdc_GetCurrentPowerState()aktueller LeistungszustandRTE/SchMSwitch(LowPowerModeA_Transition_End)Completion of mode change

Sequence diagram: Asynchronous power state transition, coordinated by the IoHwAb. Sources: SWS IoHwAb p. 57, SWS IoHwAb p. 57, [SWS_Adc_00479]

The following presumably also applies to Adc_SetPowerState: The normal state uses the same configuration containers as Adc_Init, while other states only use transition-specific reconfigurations [SWS_Adc_00483], [SWS_Adc_00484], [SWS_Adc_00485]. Question (open) Adc_GetCurrentPowerState and Adc_GetTargetPowerState return current and target states [SWS_Adc_00476], [SWS_Adc_00477]. Without an ongoing transition, both match SWS ADC p. 77.

Behavior in the event of an error

The driver reports development errors via Det_ReportError [SWS_Adc_00377]. [SWS_Adc_91005] mentions, among others:

  • ADC_E_UNINIT
  • ADC_E_ALREADY_INITIALIZED
  • ADC_E_PARAM_POINTER
  • ADC_E_PARAM_GROUP
  • ADC_E_WRONG_CONV_MODE
  • ADC_E_WRONG_TRIGG_SRC
  • ADC_E_NOTIF_CAPABILITY

Two examples: In case of an unknown group, the notification services report ADC_E_PARAM_GROUP and return without effect SWS ADC p. 68. Adc_GetVersionInfo checks its pointer for NULL SWS ADC p. 80.

Runtime errors are ADC_E_BUSY (conversion running, trigger active, or request already queued), ADC_E_IDLE, ADC_E_NOT_DISENGAGED, and ADC_E_TRANSITION_NOT_POSSIBLE [SWS_Adc_91006]. Services with a return value additionally report failure with E_NOT_OK, such as Adc_ReadGroup and Adc_SetupResultBuffer [SWS_Adc_00369], [SWS_Adc_91000].

Specific errors apply to power control:

Result also distinguishes between ADC_SEQUENCE_ERROR and ADC_HW_FAILURE [SWS_Adc_00527]. Prior to initialization, Adc_Main_PowerTransitionManager returns without a DET report [SWS_Adc_00502].

Further detailed evidence

AI-generated module guide based on the requirements from R20-11 and associated document passages, some originating from later releases. The specification remains authoritative.

ADC Driver (Adc)

Provides initialization and conversion services for analog-to-digital converters.

Funktionen — Übersicht

Typen — Übersicht

Funktionen & Typen — Detailansicht

function Adc_Init [SWS_Adc_00365] 📄 PDF

void Adc_Init (const Adc_ConfigType* ConfigPtr);

Initializes the ADC hardware units and driver.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 8695b1caa4ff Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous function Adc_Init (service ID 0x00) serves for the initial configuration and startup of all ADC hardware units as well as the ADC driver according to [SWS_Adc_00365]. The interface is provided via the header file Adc.h and has no return value.

Parameters and Configuration Variants

Configuration data is passed via the pointer parameter ConfigPtr of type const Adc_ConfigType* [SWS_Adc_00365]. The required argument depends on the selected build variant:

  • When using the post-build configuration (Variant PB), ConfigPtr must point to the corresponding data structure containing the initialization values.
  • If the pre-compile variant (Variant PC) is used, the interface explicitly requires passing a NULL_PTR [SWS_Adc_00365].

Concurrency and system integration

The function Adc_Init is specified as non-reentrant (Non Reentrant) [SWS_Adc_00365]. Interpretation: Since hardware units are configured globally and no reentrancy is provided, the call is likely to typically occur centrally during system initialization before other module functions or conversions are initiated. Question Q-a82e9204ae7a5ab7 (open)

Regarding power management, there is a direct coupling to related requirements: If the normal power state (normal Power State) is requested during operation, the corresponding API must access configuration parameters located in the same containers as the initialization parameters of Adc_Init [SWS_Adc_00483].

This usage note was generated automatically based on the AUTOSAR specification R20-11.

Implementer's Guide to follow (complexity I2)

function Adc_SetupResultBuffer [SWS_Adc_91000] 📄 PDF

Std_ReturnType Adc_SetupResultBuffer (Adc_GroupType Group, Adc_ValueGroupType* DataBufferPtr);

Initializes ADC driver with the group specific result buffer start address where the conversion results will be stored. The applicatio n has to ensure that the application buffer, where Data Buffer Ptr points to, can hold all the conversion results of the specified group. The initialization with Adc_ Setup Result Buffer is required after reset, before a group conversion can be started.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 810f267dbee4 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function Adc_SetupResultBuffer initializes the ADC driver with the start address of a group-specific buffer for storing conversion results [SWS_Adc_91000]. This call is mandatory after a reset before a group conversion can be started [SWS_Adc_91000].

Parameters and call context

  • Group: Numeric identifier of the requested ADC channel group [SWS_Adc_91000].
  • DataBufferPtr: Pointer to the data buffer (type Adc_ValueGroupType*) in which the results are stored [SWS_Adc_91000].

The function is declared as reentrant and asynchronous and is available via the header file Adc.h (service ID 0x0c) [SWS_Adc_91000].

Return Values and Error Handling

The return type is Std_ReturnType [SWS_Adc_91000]:

  • E_OK: The pointer to the result buffer was initialized successfully [SWS_Adc_91000].
  • E_NOT_OK: The operation failed or a development error occurred [SWS_Adc_91000].

Application Obligations

The calling application must ensure that the buffer pointed to by DataBufferPtr provides sufficient memory space for all conversion results of the specified channel group [SWS_Adc_91000].

This usage note was generated automatically based on the specification of AUTOSAR R20-11.

Implementer's Guide to follow (complexity I2)

function Adc_DeInit [SWS_Adc_00366] 📄 PDF

void Adc_DeInit (void);

Returns all ADC HW Units to a state comparable to their power on reset state.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 2d8196154794 Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function Adc_DeInit serves to de-initialize the ADC driver and transitions all associated ADC hardware units into a state comparable to the state immediately following a power-on reset [SWS_Adc_00366]. It thereby restores the initial state of the hardware prior to a re-initialization.

Call and Interface

The function is declared in the header file Adc.h and has the service ID 0x01 [SWS_Adc_00366]. The call is synchronous (Synchronous) and requires no parameters whatsoever (neither in, inout nor out); a return value is likewise not provided (signature void Adc_DeInit(void)) [SWS_Adc_00366]. Neither input parameters nor return values are evaluated or generated in the process. Due to the synchronous semantics, execution blocks the caller until the reset of all units is complete [SWS_Adc_00366].

Concurrency and Limitations

Regarding concurrency, the function is specified as non-reentrant (Non Reentrant) [SWS_Adc_00366]. From this follows the interpretation: Concurrent or overlapping calls to Adc_DeInit from multiple tasks or different software layers are not permitted and must be coordinated and avoided by the caller.

Since Adc_DeInit completely resets all ADC hardware units to the reset state [SWS_Adc_00366], it is likely necessary to ensure before the call that no measurement or conversion processes are active anymore in order to prevent undefined hardware behavior. Question Q-15bfa2b822826786 (open)

This text was generated by an AI and serves as an orienting documentation aid.

Implementer's Guide to follow (complexity I2)

function Adc_StartGroupConversion [SWS_Adc_00367] 📄 PDF

void Adc_StartGroupConversion (Adc_GroupType Group);

Starts the conversion of all channels of the requested ADC Channel group.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f9cdec07ac51 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

use

The function Adc_StartGroupConversion starts the conversion of all channels of the passed ADC channel group according to [SWS_Adc_00367]. The numerical group ID Group of type Adc_GroupType is passed as a parameter. The function has no return value (void) and operates asynchronously ([SWS_Adc_00367]).

Concurrency and Limitations

According to the specification, the service is classified as reentrant ([SWS_Adc_00367]). Interpretation: This likely means that the function can be called concurrently for different channel groups. Question Q-8283232f222f7b0a (open) Since the start is performed asynchronously, the call returns before the actual conversion is completed.

Error Handling and Interaction

The service is available via header Adc.h and has the service ID 0x02 ([SWS_Adc_00367]). Specific DET or DEM error codes are not documented in the present payload.

This usage note is based on the AUTOSAR specification R20-11 and was generated automatically.

Implementer's Guide to follow (complexity I2)

function Adc_StopGroupConversion [SWS_Adc_00368] 📄 PDF

void Adc_StopGroupConversion (Adc_GroupType Group);

Stops the conversion of the requested ADC Channel group.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: e5e0a89f46f6 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous function Adc_StopGroupConversion terminates the ongoing conversion of a requested ADC channel group [SWS_Adc_00368]. The interface is declared in header Adc.h and specified under service ID 0x03 [SWS_Adc_00368].

As the sole parameter, the input value Group of type Adc_GroupType is passed, which represents the numerical ID of the respective ADC channel group [SWS_Adc_00368]. The call has no return value (void) and uses neither input/output nor pure output parameters [SWS_Adc_00368].

Regarding concurrency behavior, the service is classified as reentrant and exhibits synchronous execution semantics [SWS_Adc_00368]. Parallel calls to the interface are thus permitted. The synchronous behavior implies that the operation is completed immediately with the function call [SWS_Adc_00368].

Interpretation: A call is likely to functionally require that a conversion was previously initiated for the group in question in order to be able to execute the stop. Question Q-644ca5344ab849b0 (open) Specific error codes, return values for error indication, or notifications to development end devices (DET/DEM) are not reported for this service in the present specification excerpt [SWS_Adc_00368].

This usage note was generated automatically based on the specification AUTOSAR CP R20-11.

Implementer's Guide to follow (complexity I1)

function Adc_ReadGroup [SWS_Adc_00369] 📄 PDF

Std_ReturnType Adc_ReadGroup (Adc_GroupType Group, Adc_ValueGroupType* DataBufferPtr);

Reads the group conversion result of the last completed conversion round of the requested group and stores the channe l values starting at the Data Buffer Ptr address. The group channel values are stored in ascending channel number order ( in contrast to the storage layout of the result buffer if streaming access is configured).

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: d7f16748f658 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous function Adc_ReadGroup serves to read the conversion results of an ADC channel group from the last completed conversion round ([SWS_Adc_00369]). It is available via the header file Adc.h and has the service ID 0x04 ([SWS_Adc_00369]).

Parameters and Buffer Layout

  • Group: Numerical identifier of the requested ADC channel group ([SWS_Adc_00369]).
  • DataBufferPtr: Pointer to the destination buffer (Adc_ValueGroupType*), starting at whose address the conversion results of all channels of the group are stored ([SWS_Adc_00369]).

Channel values are stored starting from the destination address in ascending channel order ([SWS_Adc_00369]). This storage layout differs explicitly from the buffer arrangement with configured streaming access ([SWS_Adc_00369]). Interpretation: The caller is likely responsible for providing a sufficiently dimensioned buffer for all channels of the group. Question Q-f22a12a6c7ab0eb3 (open)

Return Values and Error Handling

The return value of type Std_ReturnType indicates the status of the read operation ([SWS_Adc_00369]):

  • E_OK: Results are available and were successfully written to the data buffer ([SWS_Adc_00369]).
  • E_NOT_OK: No results are available or a development error has occurred ([SWS_Adc_00369]).

Concurrency

The function is specified as reentrant ([SWS_Adc_00369]). It can thus be executed in parallel as long as separate buffer areas are used for concurrent accesses.

This text was generated automatically based on the AUTOSAR CP R20-11 specification.

Implementer's Guide to follow (complexity I2)

function Adc_EnableHardwareTrigger [SWS_Adc_91001] 📄 PDF

void Adc_EnableHardwareTrigger (Adc_GroupType Group);

Enables the hardware trigger for the requested ADC Channel group.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 859e88701dd8 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Parameters

The function Adc_EnableHardwareTrigger enables the hardware trigger for a configured ADC channel group [SWS_Adc_91001]. It is defined as a service with the service ID 0x05 in the module Adc and is available via the header file Adc.h [SWS_Adc_91001].

  • Input parameters: The numeric ID of the desired ADC channel group is passed via the parameter Group of type Adc_GroupType [SWS_Adc_91001]. Additional input/output or output parameters do not exist [SWS_Adc_91001].
  • Return value: The interface does not provide a return value (void) [SWS_Adc_91001].
  • Asynchronous semantics: The execution behavior is specified as asynchronous [SWS_Adc_91001]. The call enables triggering, while the actual conversion of the channels is only initiated by subsequent hardware events.

Concurrency

The driver specifies Adc_EnableHardwareTrigger as reentrant [SWS_Adc_91001]. Interpretation: Reentrancy is likely to refer primarily to concurrent calls with disjoint channel groups, since the hardware trigger is enabled per channel group. Question Q-5750576df9f0284d (open)

This usage note is based on the AUTOSAR Classic R20-11 specification.

Implementer's Guide to follow (complexity I1)

function Adc_DisableHardwareTrigger [SWS_Adc_91002] 📄 PDF

void Adc_DisableHardwareTrigger (Adc_GroupType Group);

Disables the hardware trigger for the requested ADC Channel group.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 545b24a2a7c9 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function Adc_DisableHardwareTrigger serves to disable the hardware triggering for a requested ADC channel group [SWS_Adc_91002].

Usage and Semantics

  • Parameters: The parameter Group of type Adc_GroupType is passed, which specifies the numerical ID of the desired ADC channel group [SWS_Adc_91002].
  • Return value: The function has no return value (void) [SWS_Adc_91002].
  • Execution behavior: The call is classified as asynchronous (Sync/Async: Asynchronous) [SWS_Adc_91002]. This presumably means that the actual stopping or decoupling of the hardware event can take effect on the hardware side with a time delay. Question Q-b0e613163b254242 (open)

Concurrency and Integration

The interface is declared as reentrant (Reentrancy: Reentrant) and is provided via the header file Adc.h; its service ID is 0x06 [SWS_Adc_91002]. Specific error codes, call contexts, or DET/DEM messages are not included in the present specification excerpt.

This text was automatically generated. All statements are based exclusively on the specification of AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I1)

function Adc_EnableGroupNotification [SWS_Adc_91003] 📄 PDF

void Adc_EnableGroupNotification (Adc_GroupType Group);

Enables the notification mechanism for the requested ADC Channel group.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: ff19c4d6582c Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function Adc_EnableGroupNotification serves to enable the notification mechanism for a requested ADC channel group [SWS_Adc_91003]. The declaration of this interface is provided for users via the header file Adc.h [SWS_Adc_91003].

As the only input parameter, Group of data type Adc_GroupType is passed, which determines the numeric ID of the requested ADC channel group [SWS_Adc_91003]. The function has neither input/output parameters nor output parameters and returns no return value (void) [SWS_Adc_91003]. The service is listed under service ID 0x07 and has asynchronous execution semantics [SWS_Adc_91003].

Regarding concurrency behavior, Adc_EnableGroupNotification is specified as reentrant [SWS_Adc_91003]. Multiple parallel calls are therefore permissible. The asynchronous classification of execution likely means that the activation of the group notification is queued in the driver or implemented in the background without blocking the calling context during processing [SWS_Adc_91003]. Question Q-bae8fba7810fa269 (open)

The present specification extract makes no further specifications regarding specific development or production errors (DET or DEM) or exact call conditions or task contexts.

This usage note is based exclusively on the specification requirements of AUTOSAR Release R20-11.

Implementer's Guide to follow (complexity I1)

function Adc_DisableGroupNotification [SWS_Adc_91004] 📄 PDF

void Adc_DisableGroupNotification (Adc_GroupType Group);

Disables the notification mechanism for the requested ADC Channel group.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 1ea9bcf60eb8 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function Adc_DisableGroupNotification declared in the header Adc.h is used in the ADC driver to specifically disable the notification mechanism for a requested ADC channel group [SWS_Adc_91004]. The service has the service ID 0x08 and is specified with the signature void Adc_DisableGroupNotification (Adc_GroupType Group) [SWS_Adc_91004].

Parameters and Interface

For the execution of the function, the passing of a single input parameter is specified:

  • Group: Passes, as a numerical identifier of type Adc_GroupType, the unique ID of the desired ADC channel group whose notification is to be disabled [SWS_Adc_91004].

The function returns no return value (void) to the caller [SWS_Adc_91004]. In addition, according to the specification, neither combined input/output parameters (inout) nor pure output parameters (out) are used [SWS_Adc_91004].

Execution behavior and concurrency

With regard to concurrency behavior, Adc_DisableGroupNotification is classified as reentrant [SWS_Adc_91004]. In principle, this allows the parallel or preemptive call of the service by different program contexts [SWS_Adc_91004].

Regarding temporal synchronization, the function is classified as asynchronous [SWS_Adc_91004]. Interpretation: Since the timing behavior is explicitly declared as asynchronous, disabling the notification mechanism is likely to occur driver-internally or in the ADC hardware in the background without blocking the calling context until complete termination. Question Q-a1a30a254aa96655 (open)

This usage note was generated automatically and serves as supplementary guidance for the specification.

Implementer's Guide to follow (complexity I1)

function Adc_GetStreamLastPointer [SWS_Adc_00375] 📄 PDF

Adc_StreamNumSampleType Adc_GetStreamLastPointer (Adc_GroupType Group, Adc_ValueGroupType* * PtrToSamplePtr);

Returns the number of valid samples per channel, stored in the result buffer. Reads a pointer, pointing to a position in the group result buffer. With the pointer position, the results of all group channels of the last completed conversion round can be acc essed. With the pointer and the return value, all valid group conversion results can be accessed (the user has to take the layout of the result buffer into account).

function Adc_SetPowerState [SWS_Adc_00475] 📄 PDF

Std_ReturnType Adc_SetPowerState (Adc_PowerStateRequestResultType* Result);

This API configures the Adc module so that it enters the already prepared power state, chosen between a predefined set of configured ones.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 65595ddb1315 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The synchronous service function Adc_SetPowerState transitions the ADC module into a previously prepared power state selected from a pre-configured set [SWS_Adc_00475].

use

The function is available via header Adc.h and has the service ID 0x10 [SWS_Adc_00475]. It takes no input parameters, but instead passes the result via the output parameter Result of type Adc_PowerStateRequestResultType* [SWS_Adc_00475]. Upon successful activation of the power state, the function returns E_OK and indicates the state ADC_SERVICE_ACCEPTED via Result [SWS_Adc_00475].

Error handling

If the request is rejected, the call yields the return value E_NOT_OK [SWS_Adc_00475]. The module differentiates between three specific error causes in parameter Result:

  • ADC_NOT_INIT: The ADC module is not yet initialized at the time of the call [SWS_Adc_00475].
  • ADC_SEQUENCE_ERROR: There is an incorrect sequence of API calls [SWS_Adc_00475].
  • ADC_HW_FAILURE: A hardware error has occurred that prevents entering the requested state [SWS_Adc_00475].

Concurrency and Limitations

Adc_SetPowerState is non-reentrant (Non Reentrant) and blocks the caller until the state is synchronously adopted [SWS_Adc_00475]. As an interpretation, a preparation step for the target state must strictly have been executed prior to the call, as the function explicitly requests an already prepared state and rejects sequence errors with ADC_SEQUENCE_ERROR [SWS_Adc_00475].

This text was generated by an AI based on the AUTOSAR R20-11 specification.

Implementer's Guide to follow (complexity I2)

function Adc_PreparePowerState [SWS_Adc_00478] 📄 PDF

Std_ReturnType Adc_PreparePowerState (Adc_PowerStateType PowerState, Adc_PowerStateRequestResultType* Result);

This API starts the needed process to allow the ADC HW module to enter the AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver requested power state.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: af5e7dcf1943 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Call Context

The synchronous function Adc_PreparePowerState initiates the required preparation process to transition the ADC hardware module into a requested power state [SWS_Adc_00478]. The desired target state PowerState and a pointer Result, via which the status of the request is reported back [SWS_Adc_00478], are passed as parameters. The return value indicates with E_OK that the preparation process was started, or with E_NOT_OK that the service was rejected [SWS_Adc_00478].

Result and Error Handling

In case of success (E_OK), the output parameter Result provides the status value ADC_SERVICE_ACCEPTED [SWS_Adc_00478]. If the service was rejected with E_NOT_OK, Result specifies the exact cause [SWS_Adc_00478]:

  • ADC_NOT_INIT: The ADC module is not yet initialized [SWS_Adc_00478].
  • ADC_SEQUENCE_ERROR: Invalid call sequence, as the current state already corresponds to the target state [SWS_Adc_00478].
  • ADC_POWER_STATE_NOT_SUPP: The requested power state is not supported by the module [SWS_Adc_00478].
  • ADC_TRANS_NOT_POSSIBLE: A direct transition is not possible or the hardware peripheral is still busy [SWS_Adc_00478].

Concurrency and Interaction

The function is specified as non-reentrant [SWS_Adc_00478]. Therefore, the caller must ensure that calls occur sequentially and without overlap. Callers are likely required to conclude or stop ongoing conversions beforehand, since an active hardware peripheral leads to rejection. Question Q-210c59a46a90d781 (open) After successful preparation by Adc_PreparePowerState, subsequent actions to finalize the state transition that do not take effect immediately are executed via an associated follow-up API [SWS_Adc_00499].

This usage note was generated automatically and is based exclusively on the specification data from SWS_Adc_00478 and SWS_Adc_00499.

Implementer's Guide to follow (complexity I2)

function Adc_Main_PowerTransitionManager [SWS_Adc_00479] 📄 PDF

void Adc_Main_PowerTransitionManager (void);

This API is cyclically called and supervises the power state transitions, checking for the readiness of the module and issuing the callbacks Io Hw Ab_ Adc_ Notify Ready For Power State (see Adc Power State Ready Cb k Ref configuration parameter).

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f1697a47ca72 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Call Context

The main function Adc_Main_PowerTransitionManager serves the cyclic monitoring and handling of power state transitions in the ADC module [SWS_Adc_00479]. It has the signature void Adc_Main_PowerTransitionManager(void), takes no input parameters, and returns no value [SWS_Adc_00479]. The function is called cyclically and is declared via header SchM_Adc.h [SWS_Adc_00479]. The call is therefore typically expected to occur in the cyclic task context of the BSW scheduler (SchM). Question Q-4fc01e5bed5b3b57 (open)

State Monitoring and Asynchronous Routines

During cyclic execution, the function continuously checks the operational readiness of the module for the requested power state [SWS_Adc_00479]. As soon as module readiness is detected, it issues the notification callbacks IoHwAb_Adc_NotifyReadyForPowerState<Mode>, which are referenced via the configuration parameter AdcPowerStateReadyCbkRef [SWS_Adc_00479]. All asynchronous operations required to reach the target power state can be processed in the background within the execution context of Adc_Main_PowerTransitionManager [SWS_Adc_00498].

Error Handling and Boundary Conditions

If a requested power state cannot be reached directly from the current power state, the API reports the runtime error ADC_E_TRANSITION_NOT_POSSIBLE [SWS_Adc_00498]. By offloading longer transition processes to this cyclic manager function, higher-level callers are not blocked while the ADC module completes the state change in the background [SWS_Adc_00498].

This usage note was generated automatically based on the specification AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I1)

function IoHwAb_Adc_NotifyReadyForPower [SWS_Adc_00480] 📄 PDF

void IoHwAb_Adc_NotifyReadyForPowerState<#Mode> (void);

The API shall be invoked by the ADC Driver when the requested power state preparation for mode <#Mode> is completed.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 0b61ec2f265a Provenance Open questions (2)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The function IoHwAb_Adc_NotifyReadyForPower serves as a notification interface of the I/O hardware abstraction and is called by the ADC driver as soon as the preparation for a requested power state in mode <#Mode> has been completed [SWS_Adc_00480]. The declaration of this interface is provided via the header file IoHwAb_Adc.h [SWS_Adc_00480].

Call Context and Semantics

According to the specification, the following boundary conditions apply to the call [SWS_Adc_00480]:

  • Parameters and return value: The function has neither input, output, nor input/output parameters and returns no return value (void) [SWS_Adc_00480].
  • Synchronicity: The execution behavior is defined as synchronous [SWS_Adc_00480].
  • Reentrancy: The function is classified as non-reentrant (Non Reentrant) [SWS_Adc_00480]. Callers must therefore ensure that calls occur sequentially and are not overlapped concurrently.

Interaction and Error Handling

No error codes or notifications to DET or DEM are defined in the specification data [SWS_Adc_00480]. The syntax specification IoHwAb_Adc_NotifyReadyForPowerState<#Mode> is likely to indicate that the identifier is generated specifically depending on the configured power mode. Question Q-9e9c969f8a41d0de (open) The function presumably acts as a callback of the driver to indicate the readiness state for the transition to the higher-level power management.

This text was generated by an AI based on the specification SWS_Adc_00480.

Implementer's Guide to follow (complexity I1)

type Adc_ConfigType [SWS_Adc_00505] 📄 PDF

Data structure containing the set of configuration parameters required for initializing the ADC Driver and ADC HW Unit(s).

type Adc_ValueGroupType [SWS_Adc_00508] 📄 PDF

Type for reading the converted values of a channel group (raw, without further scaling, alignment according precompile switch ADC_ RESULT_ ALIGNMENT).

type Adc_ConversionTimeType [SWS_Adc_00510] 📄 PDF

Type of conversion time, i.e. the time during which the sampled analogue value is converted into digital representation. (This is not an API type).

type Adc_SamplingTimeType [SWS_Adc_00511] 📄 PDF

Type of sampling time, i.e. the time during which the value is sampled, (in clock - cycles). (This is not an API type).

type Adc_ResolutionType [SWS_Adc_00512] 📄 PDF

Type of channel resolution in number of bits. (This is not an API type).

type Adc_StatusType [SWS_Adc_00513] 📄 PDF

Current status of the conversion of the requested ADC Channel group.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: fc2ba1509144 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The enumeration type Adc_StatusType represents the current conversion status of a requested ADC channel group according to [SWS_Adc_00513] and is provided via the header Adc.h.

The enumeration values reflect the progress of the analog-to-digital conversion as well as the availability of results [SWS_Adc_00513]:

  • ADC_IDLE (0x00): Conversion of the specified group has not yet been started; no measurement results are available [SWS_Adc_00513].
  • ADC_BUSY (0x01): Conversion of the group has been started and is currently still ongoing; no result is available so far [SWS_Adc_00513].
  • ADC_COMPLETED (0x02): A conversion round (which is not the final one) of the group has been completed; a result is available for all channels of the group [SWS_Adc_00513].
  • ADC_STREAM_COMPLETED (0x03): The result buffer is completely filled; the required number of samples is available for each channel of the selected group [SWS_Adc_00513].

In applications, the type typically serves for querying or evaluating group progress to determine whether results can already be read out or further samples are pending.

This text was generated by an AI based on the specification AUTOSAR CP R20-11.

Implementer's Guide to follow (complexity I1)

type Adc_TriggerSourceType [SWS_Adc_00514] 📄 PDF

Type for configuring the trigger source for an ADC Channel group.

type Adc_GroupConvModeType [SWS_Adc_00515] 📄 PDF

Type for configuring the conversion mode of an ADC Channel group. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 222e382255e4 Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The enumeration type Adc_GroupConvModeType serves to configure the conversion mode of an ADC channel group and is declared via the header file Adc.h [SWS_Adc_00515]. The type specifies whether the channels of a group are converted once or repeatedly after the configured trigger event [SWS_Adc_00515].

Two modes are available for the configuration [SWS_Adc_00515]:

  • ADC_CONV_MODE_ONESHOT (0x00): Executes exactly one conversion of each channel of the ADC channel group after the configured trigger event [SWS_Adc_00515]. If a software trigger was configured as the trigger source, a started conversion can be stopped via a software API call [SWS_Adc_00515]. If, on the other hand, a hardware trigger source is assigned, a started one-shot conversion can be stopped by disabling the trigger event, provided this is supported by the hardware [SWS_Adc_00515].
  • ADC_CONV_MODE_CONTINUOUS (0x01): Performs continuously repeated conversions of each channel within the channel group [SWS_Adc_00515]. This continuous mode is available exclusively for groups with a software trigger source [SWS_Adc_00515]. An already started continuous conversion run can be stopped at any time via a software API call [SWS_Adc_00515].

Regarding restrictions, it should be noted that ADC_CONV_MODE_CONTINUOUS is only permitted with software triggering and cannot be combined with hardware trigger sources [SWS_Adc_00515]. Stopping ongoing conversions requires a dedicated software API call in the case of software triggers, whereas hardware-triggered one-shot sequences require disabling the trigger event [SWS_Adc_00515].

This text was created by an AI and is based exclusively on the specification data from AUTOSAR R20-11.

Implementer's Guide to follow (complexity I1)

type Adc_GroupDefType [SWS_Adc_00517] 📄 PDF

Type for assignment of channels to a channel group (this is not an API type).

type Adc_StreamNumSampleType [SWS_Adc_00518] 📄 PDF

Type for configuring the number of group conversions in streaming access mode (in single access mode, parameter is 1). Available Adc.h AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver via

type Adc_StreamBufferModeType [SWS_Adc_00519] 📄 PDF

Type for configuring the streaming access mode buffer type.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 8863b0f61a56 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The enumeration type Adc_StreamBufferModeType serves to configure the buffer behavior in the streaming access mode of the ADC driver and is available via the header file Adc.h [SWS_Adc_00519].

The type defines two specific operating modes for buffer management during streaming conversions [SWS_Adc_00519]:

  • ADC_STREAM_BUFFER_LINEAR (value 0x00): The ADC driver stops the conversion automatically as soon as the stream buffer is full or the specified number of samples has been reached [SWS_Adc_00519].
  • ADC_STREAM_BUFFER_CIRCULAR (value 0x01): The ADC driver continues the conversion even after reaching the full buffer capacity by wrapping around to the beginning of the buffer and overwriting it circularly [SWS_Adc_00519].

Integrating layers and application software must align the buffer behavior with the respective processing strategy: While ADC_STREAM_BUFFER_LINEAR is intended for self-contained measurement series with a fixed sample size, ADC_STREAM_BUFFER_CIRCULAR presumably requires continuous buffer monitoring or prompt data retrieval to prevent unnoticed data loss caused by automatic overwriting [SWS_Adc_00519]. Question Q-23b411e5e6c50591 (open)

This text was generated by an AI based on the specification AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I1)

type Adc_GroupAccessModeType [SWS_Adc_00528] 📄 PDF

Type for configuring the access mode to group conversion results.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: c0d3496276ea Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The enumeration type Adc_GroupAccessModeType is used to configure the access mode to the conversion results of an ADC channel group according to [SWS_Adc_00528]. The type definition is provided via the header file Adc.h and specifies how results are stored in memory.

Two values are defined in the specification for configuring the group access mode [SWS_Adc_00528]:

  • ADC_ACCESS_MODE_SINGLE (value 0x00): Configures the single value access mode for the respective group.
  • ADC_ACCESS_MODE_STREAMING (value 0x01): Configures the streaming access mode for the respective group.

The type is used during the configuration of the ADC driver to control the access behavior to the conversion result buffers [SWS_Adc_00528]. Interpretation: While the single value mode is presumably designed to provide a single current result value per group channel, the streaming mode is likely designed for more continuous measurement series with multiple buffer values. Question Q-8a933cffcd1132ef (open)

Since this is a pure configuration type, the requirement does not define its own error codes, return values, or DET/DEM notifications for this type [SWS_Adc_00528].

This text was generated by an AI based on the specification AUTOSAR Classic R20-11.

Implementer's Guide to follow (complexity I1)

type Adc_HwTriggerSignalType [SWS_Adc_00520] 📄 PDF

Type for configuring on which edge of the hardware trigger signal the driver should react, i.e. start the conversion (only if supported by the ADC hardware).

type Adc_HwTriggerTimerType [SWS_Adc_00521] 📄 PDF

Type for the reload value of the ADC module embedded timer (only if supported by the ADC hardware).

type Adc_GroupReplacementType [SWS_Adc_00523] 📄 PDF

Replacement mechanism, which is used on ADC group level, if a group conversion is interrupted by a group which has a higher priority.

type Adc_Channel [SWS_Adc_00524] 📄 PDF

In case of active limit checking: defines which conversion values are taken into account related to the boardes defineed with Adc Channel Low Limit and Adc Channel High Limit.

type Adc_ResultAlignmentType [SWS_Adc_00525] 📄 PDF

Type for alignment of ADC raw results in ADC result buffer (left/ right alignment).

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: f16034a7dc84 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

Usage and Value Range

The enumeration type Adc_ResultAlignmentType is provided via the header file Adc.h and is used in the module Adc to define the alignment of ADC raw values in the result buffer [SWS_Adc_00525]. It forms the standardized interface for configuring the driver's buffer layout [SWS_Adc_00525]. As a pure data type, it has no function parameters, return values, or asynchronous semantics of its own [SWS_Adc_00525].

According to the specification, the value range of the enumeration comprises exactly two literals [SWS_Adc_00525]:

  • ADC_ALIGN_LEFT (numerical value 0x00): Configures a left-aligned arrangement of the conversion results in the buffer [SWS_Adc_00525].
  • ADC_ALIGN_RIGHT (numerical value 0x01): Configures a right-aligned arrangement of the conversion results in the buffer [SWS_Adc_00525].

Meaning and Constraints

The selected value determines at which bit positions of the buffer area the raw data are stored after a conversion [SWS_Adc_00525]. This defines whether significant data bits are located left- or right-aligned in memory [SWS_Adc_00525]. Interpretation: The choice between left- or right-alignment is likely to be particularly relevant when the hardware resolution of the analog-to-digital converter is lower than the element width of the allocated buffer memory. Question Q-54221124172a3d87 (open) Downstream software components must take the configured alignment into account in order to be able to read raw values without calculation or bit-shift errors.

Specific error codes, DET, or DEM messages do not exist for this enumeration [SWS_Adc_00525].

This usage note was generated automatically and is based on the AUTOSAR specification R20-11.

type Adc_PowerStateType [SWS_Adc_00526] 📄 PDF

Power state currently active or set as target power state.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 05e817463b33 Provenance Open questions (1)
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The enumeration type Adc_PowerStateType defines the power status of the ADC driver in AUTOSAR Classic [SWS_Adc_00526]. It is used in the driver to represent either the currently assumed operating state of the module or to specify a new target state to be approached for power management [SWS_Adc_00526]. The declaration of this data type is provided via the header Adc.h [SWS_Adc_00526].

For the individual states of the enumeration, the specification defines a hierarchical order regarding power consumption [SWS_Adc_00526]:

  • ADC_FULL_POWER (numerical value 0): Denotes the full operating and functional mode of the ADC driver without current limitations [SWS_Adc_00526].
  • Value range 1 to 255: Represents optional power saving modes with incrementally decreasing power consumption [SWS_Adc_00526].

Regarding the interaction and integration into the system environment, the following interpretation applies: The type is likely to serve primarily as a passed parameter in control functions for power state transitions as well as for status feedback to higher-level modules such as BSW or ECU State Management. Question Q-e4f964bd79ad550c (open) Because it is an elementary data type definition, specific properties such as call contexts, reentrancy requirements, synchronous or asynchronous semantics, as well as runtime errors and DET messages, are only defined in the associated driver APIs and are not part of this type description [SWS_Adc_00526].

This text was generated by an AI. It is based exclusively on the specifications of the AUTOSAR release R20-11.

Implementer's Guide to follow (complexity I1)

type Adc_PowerStateRequestResultType [SWS_Adc_00527] 📄 PDF

Type Adc_PowerStateRequestResultType.

AI-GENERATED unreviewed Model: gemini-3.8-flash-medium · Effort: medium · Temperature: not controllable · Prompt: 27fe65fc865c Provenance
translated from the German guidegemini-3.8-flash-low · 2026-10-13 · German original

The enumeration type Adc_PowerStateRequestResultType defines the return values for state transition requests in the power management of the ADC driver and is provided via the header file Adc.h [SWS_Adc_00527].

The values of the type represent the success or specific error causes of a requested power state change [SWS_Adc_00527]:

  • ADC_SERVICE_ACCEPTED (0): The transition to the desired state was executed successfully [SWS_Adc_00527].
  • ADC_NOT_INIT (1): The call failed because the ADC module is not yet initialized [SWS_Adc_00527].
  • ADC_SEQUENCE_ERROR (2): An incorrect sequence of API calls occurred [SWS_Adc_00527].
  • ADC_HW_FAILURE (3): A hardware error prevents the transition to the requested state [SWS_Adc_00527].
  • ADC_POWER_STATE_NOT_SUPP (4): The requested power state is not supported by the ADC module [SWS_Adc_00527].
  • ADC_TRANS_NOT_POSSIBLE (5): A direct transition from the current to the desired state is not possible or the hardware peripheral is still busy [SWS_Adc_00527].

Callers must evaluate the return value to distinguish between regular execution and error conditions such as an incorrect sequence, missing module initialization, or hardware conflicts [SWS_Adc_00527].

This text was generated by an AI based on the specification.

Implementer's Guide to follow (complexity I1)

Request a governed re-review of this record. The record is not changed immediately.

Record
AUTOSAR/AP/record/CP_MOD_Adc
Status
unspecified
Version
AUTOSAR/AP/record/CP_MOD_Adc@rel:R20-11#ddf63d70
Content hash
ddf63d70
Source
https://www.autosar.org/fileadmin/standards/R20-11/CP/AUTOSAR_SWS_ADCDriver.pdf#nameddest=SWS_Adc_00365

Initialization and status

Adc_DeInit function

Returns all ADC HW Units to a state comparable to their power on reset state.

void Adc_DeInit (void);

Returns the version information of this module.

void Adc_GetVersionInfo (Std_VersionInfoType* versioninfo);
Adc_Init function

Initializes the ADC hardware units and driver.

void Adc_Init (const Adc_ConfigType* ConfigPtr);

Services · Get…

Service Adc_GetCurrentPowerState.

Std_ReturnType Adc_GetCurrentPowerState (Adc_PowerStateType* CurrentPowerState, Adc_PowerStateRequestResultType* Result);

Returns the conversion status of the requested ADC Channel group.

Adc_StatusType Adc_GetGroupStatus (Adc_GroupType Group);

Returns the number of valid samples per channel, stored in the result buffer. Reads a pointer, pointing to a position in the group result buffer. With the pointer position, the results of all group channels of the last completed conversion round can be acc essed. With the pointer and the return value, all valid group conversion results can be accessed (the user has to take the layout of the result buffer into account).

Adc_StreamNumSampleType Adc_GetStreamLastPointer (Adc_GroupType Group, Adc_ValueGroupType* * PtrToSamplePtr);

Service Adc_GetTargetPowerState.

Std_ReturnType Adc_GetTargetPowerState (Adc_PowerStateType* TargetPowerState, Adc_PowerStateRequestResultType* Result);

Services · More

Disables the notification mechanism for the requested ADC Channel group.

void Adc_DisableGroupNotification (Adc_GroupType Group);

Disables the hardware trigger for the requested ADC Channel group.

void Adc_DisableHardwareTrigger (Adc_GroupType Group);

Enables the notification mechanism for the requested ADC Channel group.

void Adc_EnableGroupNotification (Adc_GroupType Group);

Enables the hardware trigger for the requested ADC Channel group.

void Adc_EnableHardwareTrigger (Adc_GroupType Group);

This API is cyclically called and supervises the power state transitions, checking for the readiness of the module and issuing the callbacks Io Hw Ab_ Adc_ Notify Ready For Power State (see Adc Power State Ready Cb k Ref configuration parameter).

void Adc_Main_PowerTransitionManager (void);

This API starts the needed process to allow the ADC HW module to enter the AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver requested power state.

Std_ReturnType Adc_PreparePowerState (Adc_PowerStateType PowerState, Adc_PowerStateRequestResultType* Result);
Adc_ReadGroup function

Reads the group conversion result of the last completed conversion round of the requested group and stores the channe l values starting at the Data Buffer Ptr address. The group channel values are stored in ascending channel number order ( in contrast to the storage layout of the result buffer if streaming access is configured).

Std_ReturnType Adc_ReadGroup (Adc_GroupType Group, Adc_ValueGroupType* DataBufferPtr);

This API configures the Adc module so that it enters the already prepared power state, chosen between a predefined set of configured ones.

Std_ReturnType Adc_SetPowerState (Adc_PowerStateRequestResultType* Result);

Initializes ADC driver with the group specific result buffer start address where the conversion results will be stored. The applicatio n has to ensure that the application buffer, where Data Buffer Ptr points to, can hold all the conversion results of the specified group. The initialization with Adc_ Setup Result Buffer is required after reset, before a group conversion can be started.

Std_ReturnType Adc_SetupResultBuffer (Adc_GroupType Group, Adc_ValueGroupType* DataBufferPtr);

Starts the conversion of all channels of the requested ADC Channel group.

void Adc_StartGroupConversion (Adc_GroupType Group);

Stops the conversion of the requested ADC Channel group.

void Adc_StopGroupConversion (Adc_GroupType Group);

The API shall be invoked by the ADC Driver when the requested power state preparation for mode <#Mode> is completed.

void IoHwAb_Adc_NotifyReadyForPowerState<#Mode> (void);

Types

In case of active limit checking: defines which conversion values are taken into account related to the boardes defineed with Adc Channel Low Limit and Adc Channel High Limit.

Numeric ID of an ADC channel.

Data structure containing the set of configuration parameters required for initializing the ADC Driver and ADC HW Unit(s).

Type of conversion time, i.e. the time during which the sampled analogue value is converted into digital representation. (This is not an API type).

Type for configuring the access mode to group conversion results.

Type for configuring the conversion mode of an ADC Channel group. AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver

Type for assignment of channels to a channel group (this is not an API type).

Priority level of the channel. Lowest priority is 0.

Replacement mechanism, which is used on ADC group level, if a group conversion is interrupted by a group which has a higher priority.

Numeric ID of an ADC channel group.

Type for configuring on which edge of the hardware trigger signal the driver should react, i.e. start the conversion (only if supported by the ADC hardware).

Type for the reload value of the ADC module embedded timer (only if supported by the ADC hardware).

Type Adc_PowerStateRequestResultType.

Power state currently active or set as target power state.

Type of clock prescaler factor. (This is not an API type).

Type for configuring the prioritization mechanism.

Type of channel resolution in number of bits. (This is not an API type).

Type for alignment of ADC raw results in ADC result buffer (left/ right alignment).

Type of sampling time, i.e. the time during which the value is sampled, (in clock - cycles). (This is not an API type).

Current status of the conversion of the requested ADC Channel group.

Type for configuring the streaming access mode buffer type.

Type for configuring the number of group conversions in streaming access mode (in single access mode, parameter is 1). Available Adc.h AUTOSAR CP R20 - of Document ID : AUTOSAR_SWS_ADCDriver via

Type for configuring the trigger source for an ADC Channel group.

Type for reading the converted values of a channel group (raw, without further scaling, alignment according precompile switch ADC_ RESULT_ ALIGNMENT).