4.1. ADC Module

4.1.1. Acronyms and Definitions

Abbreviation/Term

Explanation

AUTOSAR

Automotive Open System Architecture

BSW

Basic Software

MCAL

Micro Controller Abstraction Layer

API

Application Programming Interface

ADC

Analogue Digital Converter

DET

Default Error Tracer

MCU

Micro Controller Unit

OS

Operating System

SW

Software

HW

Hardware

ISR

Interrupt Service Routine

SPS

Samples Per Second

SOC

Start of Conversion

EOC

End of Conversion

INT

Interrupt

4.1.2. Introduction

This document describes MCAL ADC Driver functionality, its application interfaces and configuration details as per AUTOSAR version 4.3.1 .

Supported AUTOSAR Release

4.3.1

Supported Configuration Variants

Pre-Compile & Post Build

Vendor ID

ADC_VENDOR_ID (44)

Module ID

ADC_MODULE_ID (123)

Supported Platform

AM263Px

4.1.3. Functional Overview

The ADC module initiates analog to digital conversion requests and provides the conversion results for external analog monitoring channels and internally connected digital temperature sensors. It provides services to start, stop and read conversion results for configurable ADC groups consisting of one or more external analog monitoring channels.

4.1.3.1. ADC Driver Architecture

The following figure shows where the ADC is located in the AUTOSAR architecture

ADC in AUTOSAR architecture

Fig. 4.1 ADC in AUTOSAR architecture

The ADC hardware module is a successive approximation (SAR) style ADC. This ADC is composed of a core and a wrapper. The core is composed of the analog circuits which include the channel select MUX, the sample-and hold (S/H) circuit, the successive approximation circuits, voltage reference circuits, and other analog support circuits. The wrapper is composed of the digital circuits that configure and control the ADC. These circuits include the logic for programmable conversions, result registers, interfaces to analog circuits, interfaces to the peripheral buses, post-processing circuits, and interfaces to other on-chip modules. Each ADC module consists of a single sample-and-hold (S/H) circuit. The ADC module is designed to be duplicated multiple times on the same chip, allowing simultaneous sampling or independent operation of multiple ADCs.

ADC Hardware Overview

Fig. 4.2 ADC Hardware Overview

System Overview

Fig. 4.3 System Overview

4.1.3.2. Initialization

Adc_Init() has to be called to initialize the ADC driver before initiating any group conversion. This will also set all the groups to ADC_IDLE state.

4.1.3.3. States

There are 4 states in which each ADC group for one shot single access mode can be:

  1. ADC_IDLE: This is the state before starting a group, no conversion request for the group has been initiated or after the conversion result of a stream completed group is read.

  2. ADC_BUSY: This is the state after a group is started but hasn’t finished i.e. conversion result for the group is not yet available.

  3. ADC_COMPLETED: This is the state after a group has finished first or more samples of ADC analog input.

  4. ADC_STREAM_COMPLETED: This is the state after a group has finished i.e., conversion result for the group is available.

ADC State Diagram - 1

Fig. 4.4 ADC State Diagram - 1

ADC State Diagram - 2

Fig. 4.5 ADC State Diagram - 2

4.1.3.4. Assumptions

Below listed are assumed to valid for this design/implementation, exceptions and other deviations are listed for each explicitly. Care should be taken to ensure these assumptions are addressed.

  1. ADC module requires system clock to be in operation.

  2. ADC module is not dependent on PORT module for Configuration of ADC Port pins.

  3. Configuration of ADC cross bar interrupts shall be configured in MCU module.

  4. ADC data buffer control for each hardware unit is handled by MCU module.

  5. For using DMA feature, driver assumes that cache initialization is done in application only and not done by the driver.

4.1.3.5. Limitations

Maximum 4 hardware triggered channel groups can be queued, when ADC Priority implementation ADC_PRIORITY_HW and ADC_PRIORITY_HW_SW.

Note

Hardware Triggered Channel Groups can be queued with ADC Priority implementation ADC_PRIORITY_HW and ADC_PRIORITY_HW_SW.

ADC Priority implementation ADC_PRIORITY_HW and ADC_PRIORITY_HW_SW requires all four Interrupts (ADC_INT1 to ADC_INT4) for conversion of ADC (In case of using queuing mechanism).

4.1.3.6. Design overview

4.1.3.6.1. ADC Hardware Description

ADC module is composed of

  1. Five Hardware units,

  2. Each Hardware unit has four ADC interrupt

  3. Each Hardware unit has Analog input channels ADCIN[0:5] ( have dedicated pins ).

  4. Each Hardware unit has 15 SOC’s (start of conversion units) for conversion of ADC channels.

SOC architecture

Fig. 4.6 SOC architecture

The analog channel which needs to be converted, needs to be placed in one of the SOC’s for conversion and result will be available is respective result register as shown in below figure. Based on trigger (either HW trigger or SW trigger), conversion shall be started for ADC HW Channel.

ADC Channel Conversion Process

Fig. 4.7 ADC Channel Conversion Process

4.1.3.6.2. Autosar ADC Design

The ADC Analog input channels are configured in container AdcChannel. The actual physical channel ID needs to be specified here.

The ADC Group consists of the combination of ADC channels. These Groups configured in container AdcHwUnit.

The below figure shows, how physical channels are mapped in Group.

ADC Channel Group Configuration

Fig. 4.8 ADC Channel Group Configuration

Since the conversion of ADC Channels is based on ADC Group in AUTOSAR, the ADC Groups are placed in SOC’s based on Group’s being called for conversion using autosar API’s:

Adc_StartGroupConversion for SW triggered groups

Adc_EnableHardwareTrigger for HW triggered groups

The below figure shows the group conversion process for AUTOSAR ADC module in ADC hardware:

ADC Channel Group Conversion Process

Fig. 4.9 ADC Channel Group Conversion Process

Here based on group priority the ADC Groups are allocated with SOC’s of Hardware unit. Lowest priority group will be at bottom of SOC and highest will be at TOP of SOC structure. If high priority group comes during execution of low priority group, the high priority Group shall be placed above the top of low priority SOC. If the priority mechanism is active, the ADC module shall handle channel group conversion requests for groups with the same priority level, in a ‘first come first served’ order.

4.1.3.6.3. Cross Bar Interrupt

There are four interrupts for each hardware unit of ADC module, which can be access through cross bar interrupt.

There are 32 cross bar interrupts for AM263Px, ADC modules can be mapped to any of these cross interrupts as per requirement.

The Mapping of ADC interrupts and cross bar interrupts are handled by MCU module configuration. (Refer section : MCU)

Same interrupt source number should be configured by application.

Interrupt Cross Bar List

Fig. 4.10 Interrupt Cross Bar List

4.1.3.6.4. ADC Polling Mechanism

In Polling Mechanism, we shall use the API Adc_PollingMainFunction. This API shall be responsible to change the group status and updated the group channelbuffer(which are configured as polling mode). The Function “Adc_PollingMainFunction”, shall be called periodically or else via using API “Adc_GetStatus”.

The consistency of the group channel results can be obtained via API function Adc_GetGroupStatus and Adc_ReadGroup.

Note

Cross bar Interrupts for ADC interrupt shall be configured in MCU module.

If priority mechanism is ADC_PRIORITY_NONE, only SW triggered groups can be configured and SW groups are stored in SW Queue as per priority.

Multiple HW trigger Group can be stored in SOC’s (Depending on channels configured in Group), if priority mechanism ADC_PRIORITY_HW_SW or ADC_PRIORITY_HW.

SW trigger Group are stored in SW Queue and HW triggered Group’s are allocated with SOC’s ( if group priority is higher then current executing group ).

Its recommended to disable all the ADC interrupts related of particular Hardware unit in the application, if ADC groups are configured in Polling mode.

In case of mixed mode setting is used (Polling and Interrupt mode together) then the conversion should be triggered one after the other.

4.1.4. Hardware Features

4.1.4.1. ADC IP Supported Features

  • 12-bit resolution

  • Single-ended signal conversions

  • Multiple trigger sources

  • Input multiplexer with up to 6 channels

  • 16 individually addressable result registers

  • Four flexible interrupts

  • Post-Processing Blocks:

    • Flag a high or low compare limit

4.1.4.2. AUTOSAR Supported Features

  • Software triggered one-shot conversion where the converted group consists of exactly one channel.

  • Hardware triggered one-shot conversion where the converted group consists of exactly one channel.

  • Continuous conversion where the converted group consists of exactly one channel.

  • Software triggered one-shot conversion where the converted group consists of more than one channel.

  • Hardware triggered one-shot conversion where the converted group consists of more than one channel.

  • Continuous conversion where the converted group consists of more than one channel.

  • Support for limit checking for all ADC hardware channels.

4.1.4.3. Not supported Features

ADC Hardware Features not supported:

  • Burst mode

  • External reference set by VREFHI and VREFLO pins

  • Differential mode support

  • Four post-processing blocks each with

    • Saturating offset calibration

    • Error from set-point calculation

    • Trigger-to-sample delay capture

Autosar Features not supported:

Support and management of HW low power states

4.1.5. Source files

Description of static files is provided below:

📦AM263Px
┣ 📂build
┣ 📂mcal
┃ ┣ 📂Adc
┃ ┃ ┣ 📂include
┃ ┃ ┃ ┗ 📜Adc.h : Contains the API’s of the ADC driver to be used by upper layers
┃ ┃ ┣ 📂src
┃ ┃ ┃ ┗ 📜Adc.c : Contains the implementation of the API’s for ADC driver
┃ ┃ ┣ 📂V0
┃ ┃ ┃ ┣ 📜Adc_Dbg.h : Contains debug variable declaration for ADC MCAL driver
┃ ┃ ┃ ┣ 📜Adc_Irq.c : Contains ISR function definitions
┃ ┃ ┃ ┣ 📜Adc_Irq.h : Contains ISR function declaration
┃ ┃ ┃ ┣ 📜Adc_Platform.c : Contains device specific function definition, data types and definitions
┃ ┃ ┃ ┣ 📜Adc_Platform.h : Contains device specific function definition, data types and definitions
┃ ┃ ┃ ┣ 📜Adc_Priv.c : Contains Internal functions definition of ADC driver
┃ ┃ ┃ ┣ 📜Adc_Priv.h : Contains Internal functions declaration of ADC driver
┃ ┃ ┃ ┣ 📜Adc_Reg.h : Contains definition of ADC Registers.
┃ ┃ ┃ ┣ 📜Adc_RegResult.h : Contains definition of ADC result Registers
┃ ┃ ┃ ┣ 📜Adc_Types.h : Contains the autosar data types and internal macro definitions
┃ ┃ ┃ ┣ 📜Adc_Utils.c : Utility functions implementation file. This file defines the helper functions like create, add and remove nodes
┃ ┃ ┃ ┗ 📜Adc_Utils.h : Utility functions implementation file. This file defines the helper functions like create, add and remove nodes
┃ ┃ ┗ 📜Makefile
┣ 📂mcal_config
┣ 📂mcal_docs
┗ 📜README.txt

Description of generated files is provided below:

Plugin Files

Description

Adc_Cfg.h

Contains the Precompile switches, Symbolic names of Group, channels and hardware units and Configured maximum number Groups and hardware units

Adc_PBcfg.c

Contains all channels Post-Build Configuration parameters

Adc_Cfg.c

Contains all channels Pre-Compile Configuration parameters

The below diagram shows the files structure for the ADC driver.

ADC header file include structure

Fig. 4.11 ADC header file include structure

4.1.6. Module requirements

Will be updated in future release:

4.1.6.1. Memory Mapping

Memory Mapping Sections

ADC_CODE

ADC_CODE_ISR

ADC_VAR_NO_INIT

ADC_VAR

ADC_CONST

ADC_PBCFG

ADC_START_SEC_VAR_INIT_UNSPECIFIED(.bss)

x

ADC_STOP_SEC_VAR_INIT_UNSPECIFIED

x

ADC_START_SEC_CONFIG_DATA (.const)

x

ADC_STOP_SEC_CONFIG_DATA

x

ADC_START_SEC_CODE(.text)

x

ADC_STOP_SEC_CODE

x

ADC_START_SEC_VAR_INIT_32(.bss)

x

ADC_STOP_SEC_VAR_INIT_32

x

ADC_START_SEC_VAR_NO_INIT_UNSPECIFIED(.data)

x

ADC_STOP_SEC_VAR_NO_INIT_UNSPECIFIED

x

ADC_START_SEC_ISR_CODE (.rodata)

x

ADC_STOP_SEC_ISR_CODE

x

4.1.6.2. Scheduling

Schedule Function API

Description

Adc_PollingMainFunction

This function will be used when Group is in Polling mode

4.1.6.3. Error handling

4.1.6.3.1. Development Error Reporting

The module ADC depends on the DET (by default) in order to report development errors. The DET can be replaced optionally by an equivalent component which is responsible to recognize development errors, if no DET component is available.

The DET error is reported with Module ID.

4.1.6.4. Error codes

4.1.6.4.1. Development Errors

Type of Error

Related Error code

Value (Hex)

API service used without module initialization

ADC_E_UNINIT

0x0A

API service called during ongoing process

ADC_E_BUSY

0x0B

API service called while no conversion is ongoing

ADC_E_IDLE

0x0C

API service called ADC is already initialized

ADC_E_ALREADY_INITIALIZED

0x0D

API service called with incorrect configuration parameter

ADC_E_PARAM_CONFIG

0x0E

API service called with invalid data buffer

ADC_E_PARAM_POINTER

0x14

API service called with invalid group ID

ADC_E_PARAM_GROUP

0x15

API service called on a group with conversion mode configured as continuous

ADC_E_WRONG_CONV_MODE

0x16

API service called for group with wrong trigger source

ADC_E_WRONG_TRIGG_SRC

0x17

Enable/disable notification function for a group whose configuration set has no notification available

ADC_E_NOTIF_CAPABILITY

0x18

Conversion started and result buffer pointer is not initialized

ADC_E_BUFFER_UNINIT

0x19

One or more ADC group/channel not in IDLE state

ADC_E_NOT_DISENGAGED

0x1A

Unsupported power state request

ADC_E_POWER_STATE_NOT_SUPPORTED

0x1B

Requested power state cannot be reached directly

ADC_E_TRANSITION_NOT_POSSIBLE

0x1C

ADC not prepared for target power state

ADC_E_PERIPHERAL_NOT_PREPARED

0x1D

4.1.6.4.2. Runtime Errors

Type of Error

Related Error code

Value (Hex)

API service called during ongoing process

ADC_E_BUSY

0x0B

API service called while no conversion is ongoing

ADC_E_IDLE

0x0C

AUTOSAR requires that API functions check the validity of their parameters. The checks are described in spec and are done as internal parameter checks of the API functions. These checks are for development error reporting and can be en/dis-abled separately. Refer to the configuration chapter where the en/dis-abling of the checks is described. En/dis-abling of single checks is an addition to the AUTOSAR standard which requires to en/dis-able the complete parameter checking via the parameter ADC_DEV_ERROR_DETECT. The following table shows which parameter checks are performed on which services:

Check Services

ADC_E_UNINIT

ADC_E_BUSY

ADC_E_IDLE

ADC_E_ALREADY_INITIALIZED

ADC_E_PARAM_CONFIG

ADC_E_PARAM_POINTER

ADC_E_PARAM_GROUP

ADC_E_WRONG_TRIGG_SRC

ADC_E_NOTIF_CAPABILITY

ADC_E_BUFFER_UNINIT

Adc_Init

x

x

Adc_DeInit

x

Adc_StartGroupConversion

x

x

x

x

Adc_StopGroupConversion

x

x

x

x

Adc_ReadGroup

x

x

x

x

Adc_EnableGroupNotification

x

x

x

x

Adc_DisableGroupNotification

x

x

x

Adc_GetGroupStatus

x

x

Adc_GetVersionInfo

x

Adc_SetupResultBuffer

x

x

x

x

Adc_EnableHardwareTrigger

x

x

x

x

Adc_DisEnableHardwareTrigger

x

x

x

x

Adc_Get_StreamLastPointer

4.1.6.4.3. DEM Errors

ADC modules does not report DEM errors.

4.1.7. Used resources

4.1.7.1. Interrupt Handling

For interrupt notification, ISR’s are provided in ADC driver. There are four ISR for each ADC hardware unit. Depending on hardware unit configured, it will call group notify function. The interrupt service routines shall be mapped to the interrupt sources of the respective cross bar interrupt. The supported ISR’s are part of the Adc_Irq.h file.

Following are ADC module ISR for each hardware unit:

For interrupt notification, ISR’s are provided in ADC driver. There is one ISR for each ADC hardware unit. Depending on hardware unit configured, it will call group notify function. The interrupt service routines shall be mapped to the interrupt sources of the respective cross bar interrupt. The supported ISR’s are part of the Adc_Irq.h file.

Following are ADC module ISR for each hardware unit:

ADC HW UNIT

HW Interrupt

SW ISR for ADC module

ADC HW UNIT 0

ADC0.INT1

Adc_ADCINT1_IrqUnit0

ADC HW UNIT 0

ADC0.INT2

Adc_ADCINT2_IrqUnit0

ADC HW UNIT 0

ADC0.INT3

Adc_ADCINT3_IrqUnit0

ADC HW UNIT 0

ADC0.INT4

Adc_ADCINT4_IrqUnit0

ADC HW UNIT 1

ADC1.INT1

Adc_ADCINT1_IrqUnit1

ADC HW UNIT 1

ADC1.INT2

Adc_ADCINT2_IrqUnit1

ADC HW UNIT 1

ADC1.INT3

Adc_ADCINT3_IrqUnit1

ADC HW UNIT 1

ADC1.INT4

Adc_ADCINT4_IrqUnit1

ADC HW UNIT 2

ADC2.INT1

Adc_ADCINT1_IrqUnit2

ADC HW UNIT 2

ADC2.INT2

Adc_ADCINT2_IrqUnit2

ADC HW UNIT 2

ADC2.INT3

Adc_ADCINT3_IrqUnit2

ADC HW UNIT 2

ADC2.INT4

Adc_ADCINT4_IrqUnit2

ADC HW UNIT 3

ADC3.INT1

Adc_ADCINT1_IrqUnit3

ADC HW UNIT 3

ADC3.INT2

Adc_ADCINT2_IrqUnit3

ADC HW UNIT 3

ADC3.INT3

Adc_ADCINT3_IrqUnit3

ADC HW UNIT 3

ADC3.INT4

Adc_ADCINT4_IrqUnit3

ADC HW UNIT 4

ADC4.INT1

Adc_ADCINT1_IrqUnit4

ADC HW UNIT 4

ADC4.INT2

Adc_ADCINT2_IrqUnit4

ADC HW UNIT 4

ADC4.INT3

Adc_ADCINT3_IrqUnit4

ADC HW UNIT 4

ADC4.INT4

Adc_ADCINT4_IrqUnit4

DMA Module ISR

EDMA INT

CDD_EDMA_lld_transferCompletionMasterIsrFxn

4.1.8. Integration description

4.1.8.1. Dependent modules

4.1.8.1.1. MCU

The ADC modules expects the MCU module to be powered on. The ADC module depends on MCU module for data buffer control and crossbar interrupt mapping of ADC interrupts depending on the Hardware unit being configured.

Suppose the Hardware Unit 1 and Hardware Unit 3 are configured for ADC module:

ADC Hardware container

Fig. 4.12 ADC Hardware container

Then, the MCU module container McuAdcConfiguration should be configured as shown in below figure:

McuAdcConfiguration container

Fig. 4.13 McuAdcConfiguration container

ADC Hardware unit selection

Fig. 4.14 ADC Hardware unit selection

Similarly, the crossbar interrupts also needs to be mapped in MCU module according to HW unit and interrupts being required.

The ADC interrupts needs to be mapped to the corresponding cross bar interrupt required.

Please refer limitation section of Interrupts to be configured for ADC as per AdcPriorityImplementation.

ADC Interrupt configuration

Fig. 4.15 ADC Interrupt configuration

ADC Interrupt selection

Fig. 4.16 ADC Interrupt selection

4.1.8.1.2. DMA

The ADC Module requires DMA module to be configured, when ADC is configured in DMA mode and ADC channel Group is configured for DMA access.

  1. ADC Module Configuration:

    • The ADC module parameter AdcDMAEnable should be configured for TRUE.

    • The ADC Channel Group parameter AdcGroupDataAccessMethod should be configured with ADC_GROUP_DMA_ACCESS.

    • The ADC parameter AdcDmaChannelId in AdcChannel container represents the DMA Channel ID (0 to 63) to be configured.

    • This AdcDmaChannelId parameter should be configured sequentially.

  2. DMA module Configuration:

    • In CDD DMA module, CddDmaChannelTriggerConfiguration container should be configured w.r.t the trigger selection for ADC module.

    • ADC module is dependent on X-BAR DMA interrupts, thus we have configure the X-BAR interrupts in DMA module.

  3. The ADC Trigger source should be configured for one and many of DMA channels using following parameters, in containers

    • CddDmaDmaChannelModule represents the DMA Channel ID (0 - 63)

    • CddDmaChannelTriggerSource represents which Trigger source we should map the DMA Channel ID.

    • CddDmaDmaChannelXbar represents the DMA Cross-BAR. If the CddDmaChannelTriggerSource is selected between DMA_TRIG_XBAR_DMA_XBAR_OUT_0 to DMA_TRIG_XBAR_DMA_XBAR_OUT_15, then this parameter should be mapped to respective Cross-BAR.

    • CddDmaDmaChannelXbarMap represents the trigger source for the Cross-BAR, which can be from module like ADC, EPWM, FSI etc.

    • The ADC Trigger source should be selected according to the Interrupt Source and ADC instance configured. The ADC parameter AdcDmaChannelId in AdcChannel container and CddDmaDmaChannelModule in CddDmaChannelTriggerConfiguration container should be same.

CDD DMA configuration

Fig. 4.17 CDD DMA configuration

ADC module DMA channel ID selection

Fig. 4.18 ADC module DMA channel ID selection

4.1.8.1.3. DET

This implementation depends on the DET in order to report development errors The detection of development errors is configurable (ON / OFF).

4.1.8.1.4. SchM

If multiple AUTOSAR runnables have access to the same Data Store Memory block, the exported AUTOSAR specification enforces data consistency by using an AUTOSAR exclusive area. With this specification, the runnables have mutually exclusive access to the per-instance memory global data, which prevents data corruption. Beside the OS, the BSW Scheduler provides functions that ADC module calls at begin and end of critical sections. This implementation requires 1 level of exclusive access to guard critical sections.

The data consistency mechanism that has to be applied to an ExclusiveArea might be domain, ECU or even project specific. The decision which mechanism has to be applied by RTE / Basic Software Scheduler is taken during ECU integration by setting the Exclusive Area configuration parameter RteExclusiveAreaImplMechanism. This parameter is an input for RTE generator.

For ADC Module, data consistency and exclusive access to critical sections are required for the following sections as shown in the table below:

Exclusive Area Functions used

ADC Function calling Exclusive Area

Need for Exclusive Area

Recommended Exclusive Area Mapping

ADC_EXCLUSIVE_AREA_0

Adc_DeInit
Adc_SetupResultBuffer
Adc_GetGroupStatus
Adc_GetStreamLastPointer
Adc_StartGroupConversion
Adc_StopGroupConversion
Adc_ReadGroup
Adc_EnableGroupNotification
Adc_DisableGroupNotification
Adc_EnableHardwareTrigger
Adc_DisableHardwareTrigger
Adc_PollingMainFunction

To protect against multiple access for shared resources

ALL_INTERRUPT_BLOCKING : All interrupts should be blocked as this API’s can be called in the interrupts

4.1.8.1.5. Callback Functions

The ADC driver does not provide any call back functions

4.1.8.1.6. Callback Notification

Notifications:

As it is a configurable interface, the ADC defines notifications that can be mapped to callback functions provided by other modules. The mapping is not statically defined by the ADC but can be performed at configuration time. The function prototypes that can be used for the configuration have to match the appropriate function prototype signatures, which are described in the following.

Adc_GroupEndNotifyType:

This is of type Adc_GroupEndNotifyType which is defined in Adc_Types.h file. This is called to notify the group about the completion of the requested conversion and availability of the conversion results.

4.1.8.2. Multi-core support

Not Supported

4.1.9. Configuration

4.1.9.1. AdcConfigSet

This container contains the configuration parameters and sub containers of the AUTOSAR Adc module.

4.1.9.1.1. AdcHwUnit

This container contains the Driver configuration (parameters) depending on grouping of channels

4.1.9.1.1.1. AdcHwUnitId

Item

Name

AdcHwUnitId

Description

Description: Numeric ID of the HW Unit. This symbolic name allows accessing Hw Unit data. Enumeration literals are defined vendor specific. Number of instances can vary depending on SOC variant.Corresponding error checks are added in template files

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_HWUNIT_0

Range

ADC_HWUNIT_0
ADC_HWUNIT_1
ADC_HWUNIT_2
ADC_HWUNIT_3
ADC_HWUNIT_4

4.1.9.1.1.2. AdcHwUnitResolution

Item

Name

AdcHwUnitResolution

Description

Description: ADC Resolution of Hardware unit.

Origin

Texas Instrument

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_RESOLUTION_12BIT

Range

ADC_RESOLUTION_12BIT

4.1.9.1.1.3. AdcHwPrescale

Item

Name

AdcHwPrescale

Description

Optional ADC module specific clock prescale factor, if supported by hardware.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

Texas Instrument

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_CLK_DIV_1_0

Range

ADC_CLK_DIV_1_0
ADC_CLK_DIV_2_0
ADC_CLK_DIV_2_5
ADC_CLK_DIV_3_0
ADC_CLK_DIV_3_5
ADC_CLK_DIV_4_0
ADC_CLK_DIV_4_5
ADC_CLK_DIV_5_0
ADC_CLK_DIV_5_5
ADC_CLK_DIV_6_0
ADC_CLK_DIV_6_5
ADC_CLK_DIV_7_0
ADC_CLK_DIV_7_5
ADC_CLK_DIV_8_0
ADC_CLK_DIV_8_5

4.1.9.1.2. AdcChannel

This container contains the channel configuration (parameters) depending on the hardware capability.

4.1.9.1.2.1. AdcChannelId

Item

Name

AdcChannelId

Description

This parameter defines the assignment of the channel to the physical ADC hardware channel.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

0

Max-value

5

Min-value

0

4.1.9.1.2.2. AdcChannelLimitCheck

Item

Name

AdcChannelLimitCheck

Description

Enables or disables limit checking for an ADC channel.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

4.1.9.1.2.3. AdcChannelHighLimit

Item

Name

AdcChannelHighLimit

Description

High limit - used for limit checking.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

4095

Max-value

4095

Min-value

0

4.1.9.1.2.4. AdcChannelLowLimit

Item

Name

AdcChannelLowLimit

Description

Low limit - used for limit checking.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

0

Max-value

4096

Min-value

0

4.1.9.1.2.5. AdcChannelRangeSelect

Item

Name

AdcChannelRangeSelect

Description

In case of active limit checking: defines which conversion values are taken into account related to the boarders defined with AdcChannelLowLimit and AdcChannelHighLimit.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_RANGE_ALWAYS

Range

ADC_RANGE_ALWAYS
ADC_RANGE_BETWEEN
ADC_RANGE_NOT_BETWEEN
ADC_RANGE_NOT_OVER_HIGH
ADC_RANGE_NOT_UNDER_LOW
ADC_RANGE_OVER_HIGH
ADC_RANGE_UNDER_LOW

4.1.9.1.2.6. AdcChannelSampleWindow

Item

Name

AdcChannelSampleWindow

Description

The sampleWindow parameter is the acquisition window duration in SYSCLK cycles. It should be a value between 1 and 512 cycles inclusive. The selected duration must be at least as long as one ADCCLK cycle. Also, the datasheet will specify a minimum window duration requirement in nanoseconds.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

Texas Instruments

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Max-value

512

Min-value

1

4.1.9.1.3. AdcGroup

This container contains the Group configuration (parameters).

4.1.9.1.3.1. AdcGroupAccessMode

Item

Name

AdcGroupAccessMode

Description

Type of access mode to group conversion results.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_ACCESS_MODE_SINGLE

Range

ADC_ACCESS_MODE_SINGLE
ADC_ACCESS_MODE_STREAMING

4.1.9.1.3.2. AdcGroupConversionMode

Item

Name

AdcGroupConversionMode

Description

Type of conversion mode supported by the driver.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_CONV_MODE_CONTINUOUS

Range

ADC_CONV_MODE_CONTINUOUS
ADC_CONV_MODE_ONESHOT

4.1.9.1.3.3. AdcGroupId

Item

Name

AdcGroupId

Description

Numeric ID of the group. This parameter is the symbolic name to be used on the API. This symbolic name allows accessing Channel Group data. This value will be assigned to the symbolic name derived of the AdcGroup container shortName.This parameter is calculated internally

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Max-value

1023

Min-value

0

4.1.9.1.3.4. AdcGroupPriority

Item

Name

AdcGroupPriority

Description

Priority level of the AdcGroup.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

0

Max-value

255

Min-value

0

4.1.9.1.3.5. AdcGroupDataAccessMethod

Item

Name

AdcGroupDataAccessMethod

Description

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

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

Texas Instrument

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_GROUP_INTERRUPT_ACCESS

Range

ADC_GROUP_INTERRUPT_ACCESS
ADC_GROUP_POLLING_ACCESS
ADC_GROUP_DMA_ACCESS

4.1.9.1.3.6. AdcGroupReplacement

Item

Name

AdcGroupReplacement

Description

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

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_GROUP_REPL_SUSPEND_RESUME

Range

ADC_GROUP_REPL_ABORT_RESTART
ADC_GROUP_REPL_SUSPEND_RESUME

4.1.9.1.3.7. AdcGroupTriggSrc

Item

Name

AdcGroupTriggSrc

Description

Type of source event that starts a group conversion.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_TRIGG_SRC_SW

Range

ADC_TRIGG_SRC_HW
ADC_TRIGG_SRC_SW

4.1.9.1.3.8. AdcHwTrigSignal

Item

Name

AdcHwTrigSignal

Description

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

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Range

ADC_HW_TRIG_BOTH_EDGES
ADC_HW_TRIG_FALLING_EDGE
ADC_HW_TRIG_RISING_EDGE

4.1.9.1.3.9. AdcHwTrigTimer

Item

Name

AdcHwTrigTimer

Description

Reload value of the ADC module embedded timer (only if supported by ADC hardware).

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Max-value

4294967295

Min-value

0

4.1.9.1.3.10. AdcExtHwTrigTimer

Item

Name

AdcExtHwTrigTimer

Description

Configure streaming buffer as “linear buffer” (i.e. the ADC Driver stops the conversion as soon as the stream buffer is full) or as “ring buffer” (wraps around if the end of the stream buffer is reached).

Origin

Texas Instrument

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_TRIGGER_EPWM0_SOCA

Range

ADC_TRIGGER_RTI0
ADC_TRIGGER_RTI1
ADC_TRIGGER_RTI2
ADC_TRIGGER_RTI3
ADC_TRIGGER_INPUT_XBAR_OUT5
ADC_TRIGGER_EPWM0_SOCA
ADC_TRIGGER_EPWM0_SOCB
ADC_TRIGGER_EPWM1_SOCA
ADC_TRIGGER_EPWM1_SOCB
ADC_TRIGGER_EPWM2_SOCA
ADC_TRIGGER_EPWM2_SOCB
ADC_TRIGGER_EPWM3_SOCA
ADC_TRIGGER_EPWM3_SOCB
ADC_TRIGGER_EPWM4_SOCA
ADC_TRIGGER_EPWM4_SOCB
ADC_TRIGGER_EPWM5_SOCA
ADC_TRIGGER_EPWM5_SOCB
ADC_TRIGGER_EPWM6_SOCA
ADC_TRIGGER_EPWM6_SOCB
ADC_TRIGGER_EPWM7_SOCA
ADC_TRIGGER_EPWM7_SOCB
ADC_TRIGGER_EPWM8_SOCA
ADC_TRIGGER_EPWM8_SOCB
ADC_TRIGGER_EPWM9_SOCA
ADC_TRIGGER_EPWM9_SOCB
ADC_TRIGGER_EPWM10_SOCA
ADC_TRIGGER_EPWM10_SOCB
ADC_TRIGGER_EPWM11_SOCA
ADC_TRIGGER_EPWM11_SOCB
ADC_TRIGGER_EPWM12_SOCA
ADC_TRIGGER_EPWM12_SOCB
ADC_TRIGGER_EPWM13_SOCA
ADC_TRIGGER_EPWM13_SOCB
ADC_TRIGGER_EPWM14_SOCA
ADC_TRIGGER_EPWM14_SOCB
ADC_TRIGGER_EPWM15_SOCA
ADC_TRIGGER_EPWM15_SOCB
ADC_TRIGGER_EPWM16_SOCA
ADC_TRIGGER_EPWM16_SOCB
ADC_TRIGGER_EPWM17_SOCA
ADC_TRIGGER_EPWM17_SOCB
ADC_TRIGGER_EPWM18_SOCA
ADC_TRIGGER_EPWM18_SOCB
ADC_TRIGGER_EPWM19_SOCA
ADC_TRIGGER_EPWM19_SOCB
ADC_TRIGGER_EPWM20_SOCA
ADC_TRIGGER_EPWM20_SOCB
ADC_TRIGGER_EPWM21_SOCA
ADC_TRIGGER_EPWM21_SOCB
ADC_TRIGGER_EPWM22_SOCA
ADC_TRIGGER_EPWM22_SOCB
ADC_TRIGGER_EPWM23_SOCA
ADC_TRIGGER_EPWM23_SOCB
ADC_TRIGGER_EPWM24_SOCA
ADC_TRIGGER_EPWM24_SOCB
ADC_TRIGGER_EPWM25_SOCA
ADC_TRIGGER_EPWM25_SOCB
ADC_TRIGGER_EPWM26_SOCA
ADC_TRIGGER_EPWM26_SOCB
ADC_TRIGGER_EPWM27_SOCA
ADC_TRIGGER_EPWM27_SOCB
ADC_TRIGGER_EPWM28_SOCA
ADC_TRIGGER_EPWM28_SOCB
ADC_TRIGGER_EPWM29_SOCA
ADC_TRIGGER_EPWM29_SOCB
ADC_TRIGGER_EPWM30_SOCA
ADC_TRIGGER_EPWM30_SOCB
ADC_TRIGGER_EPWM31_SOCA
ADC_TRIGGER_EPWM31_SOCB
ADC_TRIGGER_ECAP0
ADC_TRIGGER_ECAP1
ADC_TRIGGER_ECAP2
ADC_TRIGGER_ECAP3
ADC_TRIGGER_ECAP4
ADC_TRIGGER_ECAP5
ADC_TRIGGER_ECAP6
ADC_TRIGGER_ECAP7
ADC_TRIGGER_ECAP8
ADC_TRIGGER_ECAP9

4.1.9.1.3.11. AdcNotification

Item

Name

AdcNotification

Description

Callback function for each group

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

NULL_PTR

4.1.9.1.3.12. AdcStreamingBufferMode

Item

Name

AdcStreamingBufferMode

Description

Configure streaming buffer as “linear buffer” (i.e. the ADC Driver stops the conversion as soon as the stream buffer is full) or as “ring buffer” (wraps around if the end of the stream buffer is reached).

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_STREAM_BUFFER_LINEAR

Range

ADC_STREAM_BUFFER_CIRCULAR
ADC_STREAM_BUFFER_LINEAR

4.1.9.1.3.13. AdcStreamingNumSamples

Item

Name

AdcStreamingNumSamples

Description

Number of ADC values to be acquired per channel in streaming access mode.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

1

Max-value

255

Min-value

1

4.1.9.1.3.14. AdcDmaReference

Item

Name

AdcDmaReference

Description

Reference to the DMA Group Channel

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

4.1.9.1.3.15. AdcGroupDefinition

Item

Name

AdcGroupDefinition

Description

Assignment of AdcChannels to a AdcGroups.

Multiplicity-Configuration-Class

Post-Build Time

VARIANT-POST-BUILD

Pre-Compile Time

VARIANT-PRE-COMPILE

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

true

Post-Build-Variant-Value

true

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

4.1.9.2. AdcGeneral

General configuration (parameters) of the ADC Driver software module.

4.1.9.2.1. AdcDeInitApi

Item

Name

AdcDeInitApi

Description

Adds / removes the service Adc_DeInit() from the code.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.2. AdcDevErrorDetect

Item

Name

AdcDevErrorDetect

Description

Switches the development error detection and notification on or off.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.3. AdcEnableLimitCheck

Item

Name

AdcEnableLimitCheck

Description

Enables or disables limit checking feature in the ADC driver.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

false

4.1.9.2.4. AdcEnableQueuing

Item

Name

AdcEnableQueuing

Description

Determines, if the queuing mechanism is active in case of priority mechanism disabled.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.5. AdcEnableStartStopGroupApi

Item

Name

AdcEnableStartStopGroupApi

Description

Adds / removes the services Adc_StartGroupConversion() and Adc_StopGroupConversion() from the code.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.6. AdcMaxDmaChannelId

Item

Name

AdcMaxDmaChannelId

Description

Number of actual DMA channels. This is of type published information and not editable

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

63

4.1.9.2.7. AdcDmaInstance

Item

Name

AdcDmaInstance

Description

Number of actual DMA channels. This is of type published information and not editable

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

0

4.1.9.2.8. AdcGrpNotifCapability

Item

Name

AdcGrpNotifCapability

Description

Determines, if the group notification mechanism (the functions to enable and disable the notifications) is available at runtime.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.9. AdcHwTriggerApi

Item

Name

AdcHwTriggerApi

Description

Adds / removes the services Adc_EnableHardwareTrigger() and Adc_DisableHardwareTrigger() from the code.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

false

4.1.9.2.10. AdcPriorityImplementation

Item

Name

AdcPriorityImplementation

Description

Determines whether a priority mechanism is available for prioritization of the conversion requests and if available, the type of prioritization mechanism. The selection applies for groups with trigger source software and trigger source hardware. Two

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_PRIORITY_HW_SW

Range

ADC_PRIORITY_HW
ADC_PRIORITY_HW_SW
ADC_PRIORITY_NONE

4.1.9.2.11. AdcReadGroupApi

Item

Name

AdcReadGroupApi

Description

Adds / removes the service Adc_ReadGroup() and from the code.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.12. AdcResultAlignment

Item

Name

AdcResultAlignment

Description

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

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_ALIGN_RIGHT

Range

ADC_ALIGN_LEFT
ADC_ALIGN_RIGHT

4.1.9.2.13. AdcVersionInfoApi

Item

Name

AdcVersionInfoApi

Description

Adds / removes the service Adc_GetVersionInfo() from the code.

Origin

AUTOSAR_ECUC

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.14. AdcReadTemperatureApi

Item

Name

AdcReadTemperatureApi

Description

Adds / removes the service AdcReadTemperatureApi() from the code.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

false

4.1.9.2.15. AdcFifoErrLog

Item

Name

AdcFifoErrLog

Description

Enables/Disables ADC Fifo error logging.Useful in debugging

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.16. AdcErrLogMaxLen

Item

Name

AdcErrLogMaxLen

Description

Max length of error log buffer that can be used

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

100

Max-value

1024

Min-value

0

4.1.9.2.17. AdcDefaultOSCounterId

Item

Name

AdcDefaultOSCounterId

Description

Default Os Counter Id if node reference to OsCounter ref AdcOsCounterRef is not set

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

0

Max-value

16

Min-value

0

4.1.9.2.18. AdcMaxGroupCount

Item

Name

AdcMaxGroupCount

Description

Maximum group count across all hwunits configured

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

10

Max-value

1024

Min-value

1

4.1.9.2.19. AdcMaxChannelCount

Item

Name

AdcMaxChannelCount

Description

Maximum Channels count across all hwunits configured

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

10

Max-value

15

Min-value

1

4.1.9.2.20. AdcMaxHwUnitCount

Item

Name

AdcMaxHwUnitCount

Description

Maximum HW unit count - This should match the sum of the units of ISR

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

5

Max-value

5

Min-value

1

4.1.9.2.21. AdcEnableRegisterReadbackApi

Item

Name

AdcEnableRegisterReadbackApi

Description

Enable API to readback ADC critical registers

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

true

4.1.9.2.22. AdcPollingMainFunctionApi

Item

Name

AdcPollingMainFunctionApi

Description

Enable API to do the polling operation

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

false

4.1.9.2.23. AdcTypeofInterruptFunction

Item

Name

AdcTypeofInterruptFunction

Description

Type of ISR function

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

ADC_ISR_CAT1

Range

ADC_ISR_VOID
ADC_ISR_CAT1
ADC_ISR_CAT2

4.1.9.2.24. AdcDMAEnable

Item

Name

AdcDMAEnable

Description

Enables DMA Access method for ADC Channel Group.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

Default-value

false

4.1.9.2.25. AdcDeviceVariant

Item

Name

AdcDeviceVariant

Description

Select SOC variant .This parameter shall be used by driver to impose device specific constraints. The user guide shall detail the device specific constraints

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Pre-Compile-Time

VARIANT-PRE-COMPILE

Post-Build-Time

VARIANT-POST-BUILD

Default-value

AM263Px

Range

AM263Px

4.1.9.2.26. AdcOsCounterRef

Item

Name

AdcOsCounterRef

Description

This parameter contains a reference to the OsCounter, which is used by the ADC driver.

Origin

Texas Instruments

Post-build-variant-multiplicity

false

Post-Build-Variant-Value

false

Value-Configuration-Class

Post-Build-Time

VARIANT-POST-BUILD

Pre-Compile-Time

VARIANT-PRE-COMPILE

4.1.9.2.27. AdcPowerStateConfig

Each instance of this parameter defines a power state and the callback to be called when this power state is reached.

4.1.10. Examples

4.1.10.1. Overview

  • Adc Example:

    • Initialize clock using Mcu_Init()

    • Apply different voltages (between 0 - 3.3 volts) to the six ADC channels

    • Initialize Adc using Adc_Init()

    • Configure Adc interrupt using AdcApp_interruptConfig() after init to avoid interrupts at start-up.

    • Get Adc Version using Adc_GetVersionInfo()

    • Enable notification using Adc_EnableGroupNotification()

    • Start ADC conversion using Adc_StartGroupConversion()

    • Read and store the result using Adc_ReadGroup()

    • Wait for all group conversion to get over

    • Disable notification using Adc_DisableGroupNotification()

    • Deinitialize ADC using Adc_DeInit()

4.1.10.2. Setup required to run example

ADC module is tested using CC board (PROC111E2) and analog input is provided to ADC input channels through DC power supply (0-12V).

The ADC analog input for the AM263Px ranges from 0 – 3.3V.

ADC_ANI0 is provided with 1V.

ADC_ANI1 is provided with 3.2V.

PMIC Settings should be initialized for AM263Px CC board.

4.1.10.3. How to run examples

4.1.10.3.1. Steps to build and run example

ADC example application demonstrating the MCAL ADC driver features is in folder <MCAL_ROOT>/examples/Adc.

This application can be built from the root folder by giving gmake –s adc_app PLATFORM=am263px.

Once the build is completed we get a binary file, which is loaded in our controller and executed.

4.1.10.3.2. Configuration used to test this example

The ADC module example is configured with following groups on ADC Hardware Unit 1

  1. Adc Group 0 : One Shot Conversion Software Triggered with Data Access Polling Mode.

  2. Adc Group 1 : One Shot Conversion Software Triggered with Data Access Interrupt Mode.

  3. Adc Group 2 : One Shot Conversion Software Triggered with Data Access Polling Mode.

  4. Adc Group 3 : One Shot Conversion Software Triggered with Data Access Interrupt Mode.

The ADC module example application testing procedure as follows:

HW UNIT 1 is configured

One Shot Mode Testing: (Group 0) (Group 1) (Group 2) (Group 3) (HW UNIT 1)

  1. Group is Triggered for Conversion using API Adc_StartConversion()

  2. Adc_PollingMainFunction() is called for Groups configured as Data Access Polling Mode.

  3. AdcApp_procIsr() is called through AdcApp_GroupEndNotification for Groups configured as Data Access Interrupt Mode.

  4. Wait until the conversion is completed.

  5. Conversion is stopped using API Adc_StopConversion().

  6. Check the notification message, the notification counter should be incremented with ADC results available in the ADC result buffer ( Adc_AppBuffer )

Cross bar mapping:

  1. ADC HW UNIT 1 : ADC1.INT1 is mapped to XBAR1 (147)

  2. ADC HW UNIT 3 : ADC3.INT1 is mapped to XBAR2 (148)

Refer crossbar section in MCU module to map crossbar.

4.1.10.4. Sample Log

 ADC_APP: Sample Application - STARTS !!!
 ADC_APP: GROUPs 4: HWUNIT 1: LOOP COUNT 1:!!!
  
 --------------------------------------
 Apply different voltages (between 0 - 3.3 volts) to the Six ADC channels
 --------------------------------------
  
 Press any key to start conversion

  
  ADC MCAL Version Info
  ---------------------
  Vendor ID           : 44
  Module ID           : 123
  SW Major Version    : 9
  SW Minor Version    : 1
  SW Patch Version    : 0
  
  
  Read Buffer Content
  -------------------
  ADC Group 0 Log:
  ----------------
  Channel                ADC Value       Volt
  ----------------------------------------------------
  0              0x00000cc1      1434mV
  ADC Group 1 Log:
  ----------------
  Channel                ADC Value       Volt
  ----------------------------------------------------
  0              0x00000cc1      1434mV
  ADC Group 2 Log:
  ----------------
  Channel                ADC Value       Volt
  ----------------------------------------------------
  0              0x00000cc1      1434mV
  1              0x00000000      0000mV
  2              0x00000000      0000mV
  3              0x00000000      0000mV
  ADC Group 3 Log:
  ----------------
  Channel                ADC Value       Volt
  ----------------------------------------------------
  0              0x00000cc1      1434mV
  1              0x00000000      0000mV
  ADC Test Passed!!!
  ADC_APP: Sample Application - DONE !!!

4.1.10.5. File Structure

📦AM263Px
┣ 📂build
┣ 📂mcal
┃ ┣ 📂examples
┃ ┃ ┣ 📂Adc
┃ ┃ ┃ ┣ 📂soc
┃ ┃ ┃ ┣ 📜AdcApp.c : Contains ADC test example
┃ ┃ ┃ ┣ 📜AdcApp.h : ADC example header file
┃ ┃ ┃ ┗ 📜Makefile
┃ ┣ 📂examples_config
┃ ┃ ┣ 📂Adc_Demo_Cfg
┃ ┃ ┃ ┗ 📂soc
┃ ┃ ┃ ┃ ┣ 📂am263px
┃ ┃ ┃ ┃ ┃ ┗ 📂r5f0_0
┃ ┃ ┃ ┃ ┃ ┃ ┣ 📂include
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗📜Adc_Cfg.h : Contains the configuration parameters
┃ ┃ ┃ ┃ ┃ ┃ ┗ 📂src
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┣ 📜Adc_Cfg.c : Contains all Pre-Compile Configured parameters
┃ ┃ ┃ ┃ ┃ ┃ ┃ ┗📜Adc_PBcfg.c : Contains all Post-Build Configured parameters
┃ 📂mcal_config
┃ 📂mcal_docs
┗ 📜README.txt

4.1.11. References

AUTOSAR_SWS_ADC
Technical Reference Manual