ADC Driver (Adc)
Provides initialization and conversion services for analog-to-digital converters.
Funktionen — Übersicht
void Adc_Init (const Adc_ConfigType* ConfigPtr);Initializes the ADC hardware units and driver.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.void Adc_DeInit (void);Returns all ADC HW Units to a state comparable to their power on reset state.void Adc_StartGroupConversion (Adc_GroupType Group);Starts the conversion of all channels of the requested ADC Channel group.void Adc_StopGroupConversion (Adc_GroupType Group);Stops the conversion of the requested ADC Channel group.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...void Adc_EnableHardwareTrigger (Adc_GroupType Group);Enables the hardware trigger for the requested ADC Channel group.void Adc_DisableHardwareTrigger (Adc_GroupType Group);Disables the hardware trigger for the requested ADC Channel group.void Adc_EnableGroupNotification (Adc_GroupType Group);Enables the notification mechanism for the requested ADC Channel group.void Adc_DisableGroupNotification (Adc_GroupType Group);Disables the notification mechanism for the requested ADC Channel group.Adc_StatusType Adc_GetGroupStatus (Adc_GroupType Group);Returns the conversion status of the requested ADC Channel group.Adc_StreamNumSampleType Adc_GetStreamLastPointer (Adc_GroupType Group, Adc_ValueGroupType* * PtrToSamplePtr);Returns the number of valid samples per channel, stored in the result buffer.void Adc_GetVersionInfo (Std_VersionInfoType* versioninfo);Returns the version information of this module.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...Std_ReturnType Adc_GetCurrentPowerState (Adc_PowerStateType* CurrentPowerState, Adc_PowerStateRequestResultType* Result);Service Adc_GetCurrentPowerState.Std_ReturnType Adc_GetTargetPowerState (Adc_PowerStateType* TargetPowerState, Adc_PowerStateRequestResultType* Result);Service Adc_GetTargetPowerState.Std_ReturnType Adc_PreparePowerState (Adc_PowerStateType PowerState, Adc_PowerStateRequestResultType* Result);This API starts the needed process to allow the ADC HW module to enter thevoid Adc_Main_PowerTransitionManager (void);This API is cyclically called and supervises the power state transitions, checking for the readiness of the module and issuing...void IoHwAb_Adc_NotifyReadyForPower (void);The API shall be invoked by the ADC Driver when the requested power state preparation for mode is completed.
Typen — Übersicht
struct Adc_ConfigTypeData structure containing the set of configuration parameters required for initializing the ADC Driver and ADC HW Unit(s).Adc_ChannelTypeNumeric ID of an ADC channel.Adc_GroupTypeNumeric ID of an ADC channel group.Adc_ValueGroupTypeType for reading the converted values of a channel group (raw, without further scaling, alignment according precompile switch...Adc_PrescaleTypeType of clock prescaler factor.Adc_ConversionTimeTypeType of conversion time, i.Adc_SamplingTimeTypeType of sampling time, i.Adc_ResolutionTypeType of channel resolution in number of bits.enum Adc_StatusTypeCurrent status of the conversion of the requested ADC Channel group.Adc_TriggerSourceTypeType for configuring the trigger source for an ADC Channel group.enum Adc_GroupConvModeTypeType for configuring the conversion mode of an ADC Channel group.Adc_GroupPriorityTypePriority level of the channel.Adc_GroupDefTypeType for assignment of channels to a channel group (this is not an API type).Adc_StreamNumSampleTypeType for configuring the number of group conversions in streaming access mode (in single access mode, parameter is 1).enum Adc_StreamBufferModeTypeType for configuring the streaming access mode buffer type.enum Adc_GroupAccessModeTypeType for configuring the access mode to group conversion results.Adc_HwTriggerSignalTypeType for configuring on which edge of the hardware trigger signal the driver should react, i.Adc_HwTriggerTimerTypeType for the reload value of the ADC module embedded timer (only if supported by the ADC hardware).Adc_PriorityImplementationTypeType for configuring the prioritization mechanism.Adc_GroupReplacementTypeReplacement mechanism, which is used on ADC group level, if a group conversion is interrupted by a group which has a higher...Adc_ChannelIn case of active limit checking: defines which conversion values are taken into account related to the boardes defineed with...Adc_ResultAlignmentTypeType for alignment of ADC raw results in ADC result buffer (left/ right alignment).enum Adc_PowerStateTypePower state currently active or set as target power state.enum Adc_PowerStateRequestResultTypeType Adc_PowerStateRequestResultType.
Funktionen & Typen — Detailansicht
function Adc_Init [SWS_Adc_00365] 📄 PDF
void Adc_Init (const Adc_ConfigType* ConfigPtr);
Initializes the ADC hardware units and driver.
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),ConfigPtrmust point to the corresponding data structure containing the initialization values. - If the pre-compile variant (
Variant PC) is used, the interface explicitly requires passing aNULL_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.
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 (typeAdc_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.
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.
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.
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).
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.
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
Groupof typeAdc_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.
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
Groupof typeAdc_GroupTypeis 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.
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.
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 typeAdc_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_GetGroupStatus [SWS_Adc_00374] 📄 PDF
Adc_StatusType Adc_GetGroupStatus (Adc_GroupType Group);
Returns the conversion status of the requested ADC Channel group.
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_GetVersionInfo [SWS_Adc_00376] 📄 PDF
void Adc_GetVersionInfo (Std_VersionInfoType* versioninfo);
Returns the version information of this module.
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.
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_GetCurrentPowerState [SWS_Adc_00476] 📄 PDF
Std_ReturnType Adc_GetCurrentPowerState (Adc_PowerStateType* CurrentPowerState, Adc_PowerStateRequestResultType* Result);
Service Adc_GetCurrentPowerState.
function Adc_GetTargetPowerState [SWS_Adc_00477] 📄 PDF
Std_ReturnType Adc_GetTargetPowerState (Adc_PowerStateType* TargetPowerState, Adc_PowerStateRequestResultType* Result);
Service Adc_GetTargetPowerState.
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.
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
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.
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_ChannelType [SWS_Adc_00506] 📄 PDF
Numeric ID of an ADC channel.
type Adc_GroupType [SWS_Adc_00507] 📄 PDF
Numeric ID of an ADC channel group.
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_PrescaleType [SWS_Adc_00509] 📄 PDF
Type of clock prescaler factor. (This is not an API type).
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.
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
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_GroupPriorityType [SWS_Adc_00516] 📄 PDF
Priority level of the channel. Lowest priority is 0.
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.
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(value0x00): 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(value0x01): 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.
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(value0x00): Configures the single value access mode for the respective group.ADC_ACCESS_MODE_STREAMING(value0x01): 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_PriorityImplementationType [SWS_Adc_00522] 📄 PDF
Type for configuring the prioritization mechanism.
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).
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 value0x00): Configures a left-aligned arrangement of the conversion results in the buffer [SWS_Adc_00525]. -
ADC_ALIGN_RIGHT(numerical value0x01): 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.
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.
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
gemini-3.8-flash-low· 2026-10-13 · German original