Adc2_MDD

Module – ADC2

High-Level Description

The ADC2 module shall control sampling and conversion of voltages from the hardware layer into digital signals.

Figures

Component Diagram


Variable Data Dictionary

For details on module input / output variable, refer to the Data Dictionary for the application. Input / output variable names are listed here for reference.

Module InputsModule Outputs
NoneNone

Module Internal Variables

This section identifies the name, range and resolutions for module specific data created by this module. If there are no range restrictions on the variable, the term “FULL” is placed into the table for legal range.

Variable NameResolution

Legal Range

(min)

Legal Range

(max)

Software Segment
None

User defined typedef definition/declaration

This section documents any user types uniquely used for the module.

Typedef NameElement NameUser Defined Type

Legal Range

(min)

Legal Range

(max)

See Adc_MDD.doc for Adc subsystem types

Constant Data Dictionary

Calibration Constants

This section lists the calibrations used by the module. For details on calibration constants, refer to the Data Dictionary for the application.

Constant Name
None

Program(fixed) Constants

Embedded Constants

All embedded constants whose values are provided in Eng units will be evaluated to the equivalent counts by using the FPM_InitFixedPoint_m() macro within the #define statement.

Local

Constant NameResolutionUnitsValue
D_GROUPEV_CNT_U81Counts0
D_GROUP1_CNT_U81Counts1
D_GROUP2_CNT_U81Counts2
D_NTCPARMBIT1_CNT_U81Counts2
D_ADC2EVTBUFSZ_CNT_U081CountsGenerated in Adc_Cfg.h
D_ADC2G1BUFSZ_CNT_U081CountsGenerated in Adc_Cfg.h
D_ADC2G2BUFSZ_CNT_U081CountsGenerated in Adc_Cfg.h
D_ADC2EVSRC_CNT_U321CountsGenerated in Adc_Cfg.h
D_ADC2G1SRC_CNT_U321CountsGenerated in Adc_Cfg.h
D_ADC2G2SRC_CNT_U321CountsGenerated in Adc_Cfg.h
D_ADC2NUMEVTCH_CNT_U081CountsGenerated in Adc_Cfg.h
D_ADC2EVTCH_CNT_U321CountsGenerated in Adc_Cfg.h
D_ADC2NUMG1CH_CNT_U081CountsGenerated in Adc_Cfg.h
D_ADC2G1CH_CNT_U321CountsGenerated in Adc_Cfg.h
D_ADC2NUMG2CH_CNT_U081CountsGenerated in Adc_Cfg.h
D_ADC2G2CH_CNT_U321CountsGenerated in Adc_Cfg.h
D_ADC2RSLTBASEADR_CNT_U321CountsGenerated in Adc_Cfg.h

Global

This section lists the global constants used by the module. For details on global constants, refer to the Data Dictionary for the application.

Constant Name
None

Module specific Lookup Tables Constants

Constant NameResolutionValueSoftware Segment
T_Adc2GroupConfigData_Cnt_Str[3]Adc_GroupConfigDataType

{

D_ADC2NUMEVTCH_CNT_U08,

D_ADC2EVTCH_CNT_U32,

&(((uint32*)D_ADC2RSLTBASEADR_CNT_U32)[0]),

},

{

D_ADC2NUMG1CH_CNT_U08,

D_ADC2G1CH_CNT_U32,

&(((uint32*)D_ADC2RSLTBASEADR_CNT_U32)[D_ADC2EVTBUFSZ_CNT_U08]),

},

{

D_ADC2NUMG2CH_CNT_U08,

D_ADC2G2CH_CNT_U32,

&(((uint32*)D_ADC2RSLTBASEADR_CNT_U32)[D_ADC2EVTBUFSZ_CNT_U08 + D_ADC2G1BUFSZ_CNT_U08]),

}

CONST_32


Functions/Macros used by the Sub-Modules

Library Functions / Macros

The library and functions / Macros that are called by the various sub modules are identified below,

  1. None

Data Hiding Functions

Global Functions/Macros Defined by this Module

ADC2 Init

Function NameAdc2_init1TypeMinMaxUTP Tol.
Arguments PassedConfigPtrAdc_ConfigType*N/AN/A
Return ValueN/A

This function is used to initialize each of the ADC2 Groups (Event, Group1, and Group2).

Initialize Module Internal Variables

None

Register Configuration


Start Initial Conversions

Start Group Conversion

Function NameAdc2_StartGroupConversionTypeMinMaxUTP Tol.
Arguments Passedgroupuint802
Return ValueN/A

This function starts a software triggered conversion of all channels of the requested Adc channel group.

Start Conversions

Enable Group Notification

Function NameAdc2_EnableGroupNotificationTypeMinMaxUTP Tol.
Arguments Passedgroupuint8015
Return ValueN/A

This inline function reads and returns the individual channel conversion result.

Enable Notification Conditions

Local Functions/Macros Used by this MDD only

Read Channel Conversions

Function NameAdc2_ReadConversionTypeMinMaxUTP Tol.
Arguments PassedConvIduint16015
Return Valueconversion resultuint16040950

This inline function reads and returns the individual channel conversion result.

Read Group

Software Module Implementation

Runtime Environment (RTE) Initial Values

None

Initialization Functions

None

Periodic Functions

None

Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None

Transition Functions

None


Execution Requirements

Execution Sequence of the Module

Adc2_Init should be called after SystemTime_Init due to the use of the uS System Time.

Adc2_Init should be called prior to MtrCtrl ISR being enabled.

Execution Rates for sub-modules called by the Scheduler

This table serves as reference for the Scheduler design

Function NameCalling FrequencySystem State(s) in which the function is called
Adc2_InitOnce (at initialization)STARTUP

Execution Requirements for Serial Communication Functions

Function NameSub-Module called by (Serial Comm Function Name)
N/A


Memory Map Definition Requirements

Sub Modules (Functions)

This table identifies the software segments for functions identified in this module.

Name of Sub ModuleSoftware Segment
Adc2_InitADC2_START_SEC_CODE
Adc2_StartGroupConversionADC2_START_SEC_CODE
Adc2_EnableGroupNotificationADC2_START_SEC_CODE
Adc2_ReadConversioninline

Local Functions

This table identifies the software segments for local functions identified in this module.

Name of Sub ModuleSoftware Segment
None


Known Issues / Limitations With Design

  1. INLINE functions defined in “GlobalMacro.h” are not unit tested


Revision Control Log

Item #Rev #Change DescriptionDateAuthor Initials
11.0Initial version based on FDD 33C rev 00605Nov12LN
22.0Design updates to meet FDD and simplify configuration24APR13Selva
33.0Fixed typo in flowchart22MAY13LWW
Last modified October 12, 2025: Initial commit (0347a62)