Serial_Communication_Output_MDD

Module – Serial Communications Output

High-Level Description

The Serial Communications Output module provides a signal level interface between the EPS application layer and the serial communications software. Provide for the network management functionality for the serial communications interface. This module will be customized for each distinct vehicle platform. This module will be responsible for converting the range and resolution of the Application Layer variables to the range and resolution of the associated serial communications signals.

This module processes the data for transmit signals that are sent from the EPS controller to other ECUs on the communication bus. Global application input data is scaled appropriately and then transferred to the serial communications Interaction Layer using function calls or macros provided. Similarly, the Serial Communications Input module, takes the signal data that is received from the Interaction Layer, scales the data as required by the EPS controller and transfers the updated global data to the EPS application software.

Figures

Component Diagram

This diagram shows all data that is shared between functions within the module.

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.

(Note: Full variable names required in table.)

Module Inputs (Global Variable Name)Module Outputs (Global Variable Name)
ATermActive_Cnt_lgc
ActiveFunctionBits_Cnt_u08
ActiveTunSet_Cnt_u16
CanMsgReceived_Cnt_lgc
DSTEOLDisable_Cnt_lgc
DSTExtSystemFltActive_Cnt_lgc
SystemState_Mode
DSTState_Cnt_u08
DiagStsRecRmpToZeroFltPres_Cnt_lgc(
DiagStsNonRecRmpToZeroFltPres_Cnt_lgc
RampDwnStatusComplete_Cnt_lgc
EngRPM_Cnt_u16
HaLFState_Cnt_u08
HaLFSuspend_Cnt_lgc
HandsOnDetect_Cnt_lgc
HwTrq_HwNm_f32
PrkAssistState_Cnt_u08
PrkAssistSuspend_Cnt_lgc
SrlComHwTrqValid_Cnt_lgc
SrlComVehSpdValid_Cnt_lgc
SumLmtTrqCmd_MtrNm_f32
SupplyCurrent_Amp_f32
VehicleSpeed_Kph_f32
CFG_STAT_RQ_Cnt_u16
EPS_MODE_REQ_Cnt_u16
CTermActive_Cnt_lgc
SpStPrsnt_Cnt_lgc
OutputRampMult_Uls_f32;

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
NMBusWaitSleepCancel_Cnt_M_lgc1FALSETRUESRLCOMOUTPUT_START_SEC_VAR_CLEARED_BOOLEAN
CanMsgReceived_Cnt_M_lgc1FALSETRUESRLCOMOUTPUT_START_SEC_VAR_CLEARED_BOOLEAN
MtrTrqValid_Cnt_M_lgc1FALSETRUESRLCOMOUTPUT_START_SEC_VAR_CLEARED_BOOLEAN
MCEPS1_Cnt_M_u0810FULLSRLCOMOUTPUT_START_SEC_VAR_CLEARED_8
NMFirstMsg_mS_M_u3210FULLSRLCOMOUTPUT_START_SEC_VAR_CLEARED_32
NMBusWaitSleepCancel_mS_M_u3210FULLSRLCOMOUTPUT_START_SEC_VAR_CLEARED_32
EPS1_M_str10FULLSRLCOMOUTPUT_START_SEC_VAR_CLEARED_32

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)


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
k_VehSpdAstLmt_Kph_f32
k_StrClmTrqPolarity_Cnt_s08
k_InvGearRatio_Uls_f32
k_StrClmTrqPolarity_Cnt_s08

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 NameValue
D_SUPPLYCURROFFSET_ULS_F3250.0
D_EPSCURR_HILMT_AMP_F32203.0
D_EPSCURR_LOLMT_AMP_F32-50.0
D_CRCINIT_CNT_U80xFF
D_CRCXORVALUE_CNT_U80xFF
D_COUNTERCYCLE16_CNT_U160x10
D_UNUSED0MSG221_CNT_U80xFF
D_STRCLMTRQLOLIMIT_HWNM_F32-8.0
D_STRCLMTRQHILIMIT_HWNM_F327. 9765625
D_STRCLMTRQOFFSET_HWNM_F328.0
D_STRCLMTRQ_SIGNOTAVAL_CNTS_U160x07FF
D_ASSTTRQ_HILMT_HWNM_F32104.65
D_ASSTTRQ_LOLMT_HWNM_F32-100.0
D_ASSTTRQ_OFFSET_HWNM_F32100.0
D_ASSTTRQ_ENGTOCNTS_SCALE_HWNM_F3220.0
D_HALFSTATEINACTIVE_CNT_U080
D_HALFSTATEACTIVE_CNT_U081
D_HALFSTATEINHIBITED_CNT_U082
D_HALFSTATERECOVERABLE_CNT_U083
D_PPPAFUNCBIT_CNT_U081
D_DSTFUNCBIT_CNT_U082
D_HALFFUNCBIT_CNT_U084
D_PASTATEINACTIVE_CNT_U080
D_PASTATEACTIVE_CNT_U081
D_PASTATEINHIBITED_CNT_U082
D_PASTATERECOVERABLE_CNT_U083
D_EPSMTRTRQ_HILMT_MTRNM_F321.998046875
D_EPSMTRTRQ_LOLMT_MTRNM_F32-2.0
D_EPSMTRTRQ_OFFSET_ULS_F322.0
D_EPSMTRTRQ_SIGNOTAVAL_CNT_U160xFFFF
D_NMAWAKENWST_CNT_U080x01U
D_NMAWAKEDIAGACTV_CNT_U080x02
D_NMAWAKERAMPOUT_CNT_U080x04
D_NMAWAKEVSSHIGH_CNT_U080x08
D_NMAWAKEENGRPMHIGH_CNT_U080x10
D_NMAWAKEIGNHIGH_CNT_U080x20
D_NMSTARTUPSLEEPDELAY_MS_U320x50000
D_NMWAKEUPREASONIGN_CNT_U080x01
D_ENGONRPM_CNT_U160x12
D_ENGRPMINVLD_CNT_U160xFFFF
EPSA1_AsstStat
EPSA1_AsstStat_Active0x00
EPSA1_AsstStat_Off0x01
EPSA1_AsstStat_ThrmRed0x02
EPSA1_AsstStat_SigNotAval0x07
EPSA1_WarnDisp
EPSA1_WarnDisp_FuncActive0x00
EPSA1_WarnDisp_ServPwrSteer0x01
EPSA1_WarnDisp_PwrSteerOvTmp0x02
EPSA1_WarnDisp_ServReqdHighPri0x03
EPSA1_WarnDisp_SigNotAval0x07
kDescStateSessionDefault0x01
D_TXAWAKE_NWST_CNT_U080x01
D_TXAWAKE_DIAGACTIVE_CNT_U080x02
D_TXAWAKE_RAMPOUT_CNT_U080x04
D_TXAWAKE_VSSHIGH_CNT_U080x08
D_TXAWAKE_ENGRPM_CNT_U080x10
D_TXAWAKE_IGNHIGH_CNT_U080x20
D_SLEEPINDICATORCLEAR_U080x40
D_SLEEPSTATE_U080x00U
D_ENGONRPM_CNT_U160x12C
D_ENGRPMINVLD_CNT_U160xFFFF
TOCSTATE_PNA2


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

Module specific Lookup Tables Constants

(This is for lookup tables (arrays) with fixed values, same name as other tables)

Constant NameResolutionValueSoftware Segment
none

Functions/Macros used by the Sub-Modules

Library Functions / Macros

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

  1. None

Data Hiding Functions

The data hiding functions / macros used in this module are identified below,

Local Functions/Macros Used by this MDD only

(Note if they are defined in another source file, then reference the appropriate header file)

The local functions/macros in this module are identified below,

  1. CalcCRC_EPS_1( void)

  2. DetermineWarnDisp(void)

  3. ScaleSignal_u16( float32 Signal_Uls_T_f32, float32 LoLmt_Uls_T_f32, float32 HiLmt_Uls_T_f32, float32 Scale_Uls_T_f32, Offset_Uls_T_f32)

  4. SrlComOutput_WriteBits(uint32 Data_T_Cnt_u32, uint8* Buffer_T_Cnt_u08, uint16 StartBit_Cnt_T_u16, uint16 EndBit_Cnt_T_u16)


Software Module Implementation

Initialization Functions

Init: SrlComOutput_Init1

Design Rationale

Module Outputs

Module Internal

Set Default Messages

EPSA1_T_str.s.unused0 = 0x00

SetValueTxEPS_AsstStat(EPSA1_T_str, 0x01)

SetValueTxEPS_Warn_Disp_Rq(EPSA1_T_str, 0x00)

EPSA1_T_str.s.unused1 = 0x00

EPSA1_T_str.s.unused2 = 0x00

SetValueTxEPS_Curr(EPSA1_T_str, 0xFF)

EPSA1_T_str.s.unused3 = 0x00

EPSA1_T_str.s.unused4 = 0x00

EPSA1_T_str.s.unused5 = 0x00

EPSA1_T_str.s.unused6 = 0x00

dbkPutTxEPS_A1_PKT(EPSA1_T_str)

CclEnableCommunication()

DpmExternalRequest(DPM_EPS)

SetValueTxWakeupRsn_EPS(WakeupEPS_T_str, D_NMWAKEUPREASONIGN_CNT_U08)

SetValueTxWakeupCnt(WakeupEPS_T_str, 0x00)

WakeupEPS_T_str.s.unused0 = 0x00

nmpduPutWakeup_EPS(WakeupEPS_T_str)

SetValueTxTOI_Act_Sts(EPS1_M_str, 0x00)

SetValueTxStrClmTrqVD(EPS1_M_str, 0x00)

SetValueTxStrClmTrq(EPS1_M_str, 0x07FF)

SetValueTxAssistanceTorque(EPS1_M_str, 0x00)

SetValueTxPTSDriveStyleSts(EPS1_M_str, 0x00)

SetValueTxDSTTorqueOverlayFault(EPS1_M_str, 0x00)

SetValueTxHALFTorqueOverlayFault(EPS1_M_str, 0x00)

SetValueTxHALFTorqueOverlayIntActivated(EPS1_M_str, 0x00)

SetValueTxEPSMotorTorque(EPS1_M_str, 0x00)

SetValueTxEPSMotorTorqueValidData(EPS1_M_str, 0x00)

SetValueTxEPSHandsOnRecognition(EPS1_M_str, 0x00)

SetValueTxEPSTemporaryDeactivationLDW(EPS1_M_str, 0x00)

SetValueTxPTSTorqueOverlayFault(EPS1_M_str, 0x00)

SetValueTxPTSTorqueOverlayIntActivated(EPS1_M_str, 0x00)

SetValueTxMC_EPS_1(EPS1_M_str, MCEPS1_Cnt_M_u08)

CalcCRC_EPS_1()

dbkPutTxEPS_1_PKT(EPS1_M_str)

Rte_Call_SystemTime_GetSystemTime_mS_u32(&NMFirstMsg_mS_M_u32)

Periodic Functions

Per: SrlComOutput_Per1

Design Rationale

Process and update Transmit signal data.

Program Flow Start

N/A

Store Module Inputs to Local copies

Rte_Read_ATermActive_Cnt_lgc(&ATermActive_Cnt_T_lgc)

Rte_Read_EngRPM_Cnt_u16(&EngRPM_Cnt_T_u16)

Rte_Read_VehicleSpeed_Kph_f32(&VehSpd_Kph_T_f32)

Rte_Read_SrlComVehSpdValid_Cnt_lgc(&VehSpdValid_Cnt_T_lgc)

Rte_Read_RampDwnStatusComplete_Cnt_lgc(&RampStatusComplete_T_Cnt_lgc)

Rte_Read_Ap_SrlComOutput_CanMsgReceived_Cnt_lgc(&CanMsgReceived_Cnt_T_lgc)

Rte_Read_Ap_SrlComOutput_OutputRampMult_Uls_f32(&OutputRampMult_Uls_T_f32)

Description

Store Local copy of outputs into Module Outputs

See section above.

Program Flow End

N/A

Fault Recovery Functions

None

Shutdown Functions

None

Interrupt Functions

None

Serial Communication Functions

None

Transition Functions

SrlComOutput_

Design Rationale

Program Flow Start

N/A

Store Module Inputs to Local copies

*See below

Description

Store Local copy of outputs into Module Outputs

See section above.

Program Flow End

N/A

Local Function/Macro Definitions

If these are numerous and defined in a separate source file then reference the source file only.

CalcCRC_EPS_1

Function NameCalcCRC_EPS_1TypeMinMax
Arguments Passed
Return Value

Description

DetermineWarnDisp

Function NameDetermineWarnDispTypeMinMax
Arguments Passed
Return ValueFinalOutput_Cnt_T_u08uint807

Description


ScaleSignal_u16

Function NameScaleSignal_u16TypeMinMax
Arguments PassedSignal_Uls_T_f32float32FullFull
LoLmt_Uls_T_f32float32FullFull
HiLmt_Uls_T_f32float32FullFull
Scale_Uls_T_f32float32FullFull
Offset_Uls_T_f32float32FullFull
Return ValueSignal_Cnt_T_u16Uint160Full

Description


EPS1_PKTConfirmation

Function NameEPS1_PKTConfirmationTypeMinMax
Arguments Passed
Return Value

Description

ApplCclComStart

Function NameApplCclComStartTypeMinMax
Arguments Passed
Return Value

Description


SrlComOutput_WriteBits

Function NameSrlComOutput_WriteBitsTypeMinMax
Arguments PassedData_T_Cnt_u32uint32FullFull
Buffer_T_Cnt_u08uint8FullFull
StartBit_Cnt_T_u16uint16FullFull
EndBit_Cnt_T_u16uint16FullFull
Return Value

Description


Execution Requirements

Execution Sequence of the Module

(Describe in words relevant details about the execution sequence of the different sub modules.)

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
SrlComOutput_Init1()OnceSTART UP
SrlComOutput_Per1()10msWARM INIT, OPERATE, DISABLE

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
SrlComOutput_Init1()RTE_AP_SRLCOMOUTPUT_APPL_CODE
SrlComOutput_Per1()RTE_AP_SRLCOMOUTPUT_APPL_CODE
SrlComOutput_Trns1()RTE_AP_SRLCOMOUTPUT_APPL_CODE

Local Functions

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

Name of Sub ModuleSoftware Segment
CalcCRC_EPS_1 ()AP_SRLCOMOUTPUT_CODE
DetermineWarnDispAP_SRLCOMOUTPUT_CODE
ScaleSignal_u16AP_SRLCOMOUTPUT_CODE
EPS1_PKTConfirmationAP_SRLCOMOUTPUT_CODE
ApplCclComStartAP_SRLCOMOUTPUT_CODE
SrlComOutput_WriteBitsRTE_AP_SRLCOMINPUT_APPL_CODE


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 Version29May13M. Story
22.0Anomaly 5014 DetermineWarnDisp16JUN13M. Story
33.0Anomaly 541612AUG13M. Story
44.0Fully implemented A001 A002 A003 A00413SEP13M. Story
55.0Changes for 01.00.01 version of CL30SEP13M. Story
66.0Changes for 01.00.03 version of CL25OCT13M. Story
77.0Changes for NM anomaly 591131OCT13M. Story
88.0Import prior changes to L path20NOV13M. Story
99.0Anomaly 640810APR14M. Story
Last modified October 12, 2025: Initial commit (0347a62)