Challenge

Project 2-Highway Assistant-Lane Changing Assistant

AIM:

  1. To develop one specific requirement of Highway Assistant – Lane Changing Assistant algorithm must be developed in MATLAB Simulink as per MBD guidelines.
  2. To create a Simulink Data Dictionary of the model and map it to the current model
  3. To map all the input & output signals into the Autosar Editor.
  4. To Generate Model Advisor Report for the current model as per MAB Guidelines
  5. To generate code for the Simulink model using Autosar Coder.

Simulink Model

Figure 1 HighwayAssistant_LaneChangingAssistant Top Level System

Figure 2 HighwayAssistant_LaneChangingAssistant SubSystem

Step1: Developing MATLAB Simulink Model Based on the Requirements

  • Based on the Requirements provided, the Inputs, Outputs and control logic has been decided.
  • Requirement Analysis is a very useful method or tool as it simplifies the problem based on what requirements are needed to implement the algorithm.
  • All the requirements are defined by building the Model Based on the requirements it is the fastest way to achieve a solution to the problem.
  • Requirements traceability connects models, tests, and code with requirement definitions to help manage change and reduce waste in the design life cycle

In Traffic Jam Assistant Algorithm there are 3 main requirements

  • Highway_DisplayUnit
  • Lane_DisplayUnit
  • Switch_Blocks

Requirement No 1 (Highway_DisplayUnit)

Input Signals

  1. Highway_Input_Signal
  2. Enable_Display
  3. Input_Switch

Output Signals

  1. Highway_Display_Mode_1
  2. Highway_Display_Mode_2
  3. Highway_Display_Mode_3
  4. Highway_Display_Mode_4

Logic: The requirement must be implemented in the form of a Stateflow logic.

Condition

Action

Highway_Input_Signal = 1

Enable_Display = off

Input_Switch = on

Highway_Display_Mode_1 = 232

Highway_Display_Mode_2 = 183

Highway_Display_Mode_3 = 41

Highway_Display_Mode_4 = 94

Highway_Input_Signal = 1

Enable_Display = on

Input_Switch = on

Highway_Display_Mode_1 = 21

Highway_Display_Mode_2 = 18

Highway_Display_Mode_3 = 9

Highway_Display_Mode_4 = 94

Based on the above logic the Highway_DisplayUnit subsystem is modelled in MATLAB Simulink as per MAAB guidelines

Figure 3 Highway Display unit Algortihm

Requirement No 2 [Lane_DisplayUnit]

Input Signals

  1. Enable_Display
  2. Input_Switch
  3. Lane_Input_Signal

Output Signals

  1. Lane_Display_Mode_1
  2. Lane_Display_Mode_2
  3. Lane_Display_Mode_3
  4. Lane_Display_Mode_4

Logic: The requirement must be implemented in the form of Stateflow logic.

Condition

Action

Lane_Input_Signal = 6

Enable_Display = off

Input_Switch = on

Lane_Display_Mode_1 = 132

Lane_Display_Mode_2 = 185

Lane_Display_Mode_3 = 54

Lane_Display_Mode_4 = 67

Lane_Input_Signal= 6

Enable_Display = on

Input_Switch = on

Lane_Display_Mode_1 = 127

Lane_Display_Mode_2 = 248

Lane_Display_Mode_3 = 186

Lane_Display_Mode_4 = 84

Based on the above logic the Lane_DisplayUnit Subsystem is modelled in MATLAB Simulink as per MAAB guidelines

Figure 4 Lane Display unit Algortihm

Requirement No 3: Switch_Blocks

Input Signals:

  1. Highway_Input_Signal
  2. Highway_Display_Mode_1
  3. Highway_Display_Mode_2
  4. Highway_Display_Mode_3
  5. Highway_Display_Mode_4
  6. Lane_Display_Mode_1
  7. Lane_Display_Mode_2
  8. Lane_Display_Mode_3
  9. Lane_Display_Mode_4

Output Signals:

  1. Display_Mode_1
  2. Display_Mode_2
  3. Display_Mode_3
  4. Display_Mode_4

Logic

Switch Block

Input 1

Input_2

Input_3

Output

Switch_1

Highway_Display_Mode_1

Highway_Input_Signal

Lane_Display_Mode_1

Display_Mode_1

Switch_2

Highway_Display_Mode_2

Highway_Input_Signal

Lane_Display_Mode_2

Display_Mode_2

Switch_3

Highway_Display_Mode_3

Highway_Input_Signal

Lane_Display_Mode_3

Display_Mode_3

Switch_4

Highway_Display_Mode_4

Highway_Input_Signal

Lane_Display_Mode_4

Display_Mode_4

Based on the above logic the Switch_Blocks Subsystem is modelled in MATLAB Simulink as per MAAB guidelines

Figure 5 Switch_Block Algortihm

Requirement Tagging, Signal Propagation and Resolving

  • A word file is created with above three requirements and each of them are tagged to the corresponding subsystem and blocks.
  • All The input, output signals and constant parameters are propagated and resolved from the SLDD file to the Simulink Model as shown below.

Figure 6 Requirement Tagging and Signal Resolving and Propagation

Step 2: Creation of a Simulink Data Dictionary of the model

  • The Model Explorer is used in which, link to data dictionary option is selected to create, modify, and view the entries in a data dictionary
  • Here the access to base workspace is disabled as the requirement of data has already been provided and that data must be used for data referencing.
  • Based on the SLDD-XLFormat file provided a Simulink Data Dictionary file Highway Assistant_ Lane_Changing _Assistant_DD.sldd

Figure 7 Highway Assistant_ Lane_Changing _Assistant_ Data Dictionary

For Autosar code generation,

  • Storage class for Input signals, Output signal, local signals: Auto Mode
  • Main Advantage of using SLDD is it reduces repeatable initialisation or declaring init file for the parameters or signals in current model.
  • The input, output signals and constant parameters can be directly linked from the SLDD file to the Simulink Model.

Step 3: AUTOSAR Port Mapping:

  • The Input port and Output Port interfaces should be created, and corresponding data elements which are to be mapped are created.
  • There are 4 inport & 4 outport signals in the model, runnable for these inport & outport signals are created

The Autosar port Mapping is performed as follow

Step 3a : To make the model as AUTOSAR compliant, the Solver settings are made as

  • Type - fixed step size
  • solver method - discrete (no continuous states)
  • Fixed Step (fundamental sample time) – 0.01

Figure 8 Solver Settings under Model configuration parameters

Step 3b: Code Generation Settings

  • The System target file – autosar.tlc is selected as target file, to generate a Template of the current model for SIL Testing.
  • The Floating-point numbers are enabled to use the parameters or signals in SLDD

Figure 9 Code generation settings under Configuration parameters

Step 3c: Editing AUTOSAR XML Options in AUTOSAR Dictionary

Figure 10 AUTOSAR XML Options in AUTOSAR Dictionary

Step 3d: Creation of Autosar SR interfaces and Data Elements

  • The Sender- Receiver Interface (SRIF) for each input and output signal along with its corresponding data element is defined.
  • The Sender – receiver interface to each signal is prefixed with ‘SRIF_’
  • The Corresponding Data Element have prefix ‘DE_’

Figure 11 AUTOSAR S-R interface with respective Data Elements

Step 3e: Receiver and Sender Ports

  • The each inport prefix with 'Rp_' is mapped to corresponding receiver port and Data Element.

Figure 12 AUTOSAR Receiver ports mapping with their corresponding SR Input interfaces

  • Each outport prefix with 'Pp_' is mapped to its corresponding Sender port and Data Element

Figure 13 AUTOSAR Sender ports mapping with their corresponding SR Output interfaces

Step 3f: Creation of Runnables

Figure 14 AUTOSAR Runnables with Initialize and periodic sample step

Step 3g: The validation is done to check the mapping is performed correctly.

Click on the correct option to perform validation. Fix any errors if present

Figure 15 AUTOSAR Validation

Step 4: Model Advisor Check

  • The Model Advisor checks the model or subsystem for modelling conditions and configuration settings that cause inaccurate or inefficient simulation of the system that the model represents.
  • The Model Advisor checks helps to verify compliance with industry standards and guidelines.
  • By using the Model Advisor, we can implement consistent modelling guidelines across projects and development teams.

Here in this project, MAAB (MathWorks Automotive Advisory Board Standards) is used to check the modelling conditions and required errors are minimized to abide to the guidelines or Standards of the MAAB.

The detailed report is generated in HTML file after minimising the errors or warnings

Figure 16 Model Advisor Summary Report for Highway Assistant _Lane Changing Assistant

Step 5: Code Generation

After building the Simulink model to determine the correctness of the model as per the MAAB guidelines Model Advisor Check is done and report is generated without errors

Using Autosar coder(autosar.tlc) Code generated for the above Simulink model which can be used for the verification of code for Software in Loop Testing (SIL) and Hardware in Loop Testing (HIL)

Procedure for Code Generation

Step 5a: Treat as Atomic Unit

Figure 17 Block parameters of Highway Assistant _Lane Changing Assistant

Step 5b: Embedded C Code Generation using Autosar Component in MATLAB Apps section

  • A quick start guide is used for code generation is which helps to build the model and generate corresponding (.h, .c, rtwtypes.h, arxml) file formats.

1. Quick Start guide for Embedded C Code Generation

  1. Traffic_Jam_Assistant main Subsystem is considered here for code generation.

  1. C code is generated as Output and it is generated in Single instance

  1. Deployment of the above mode is done at single sample rate 0.01

  1. The target hardware processor type is selected by default by the current system as below

  1. The objective of code generation is set to Execution Efficiency for optimization.

  1. Code generation parameters for above model are shown as below

  1. Code generation is completed successful and the codes can be viewed in code generation report

Conclusion:

  1. Hence Highway Assistant _Lane Changing Assistant algorithm was implemented in MATLAB Simulink as per MBD guidelins.
  2. A Simulink Data Dictionary for the above model is created and mapped it to the current model.
  3. Autosar Port Mapping with runnables of these inport & outport signals are created in the given model.
  4. Validation of the Mapping is performed and found succedded as per AUTOSAR guidelines.
  5. A Model Advisor Report for the current model as per MAAB Guidelines without errors.
  6. Embedded C code is generated using Autosar.tlc for the Highway Assistant _Lane Changing Assistant model.

Appendices

-------------------------------------------------------------------------------------------------------------------------------------------------------
/*
* File: HighwayAssistant_LanechangingAssistant.c
*
* Code generated for Simulink model 'HighwayAssistant_LanechangingAssistant'.
*
* Model version : 1.29
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Thu May 5 01:21:55 2022
*
* Target selection: autosar.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives:
* 1. Execution efficiency
* 2. RAM efficiency
* Validation result: Not run
*/

#include "HighwayAssistant_LanechangingAssistant.h"

/* Named constants for Chart: '/Chart' */
#define IN_Condition1 ((uint8)1U)
#define IN_Condition2 ((uint8)2U)

/* Block signals and states (default storage) */
DW rtDW;

/* Model step function */
void HighwayAssistant_LanechangingAssistant_Step(void)
{
uint8 rtb_Highway_Display_Mode_1;
uint8 rtb_Highway_Display_Mode_2;
uint8 rtb_Highway_Display_Mode_3;
uint8 rtb_Lane_Display_Mode_1;
uint8 rtb_Lane_Display_Mode_2;
uint8 rtb_Lane_Display_Mode_3;
uint8 rtb_Lane_Display_Mode_4;

/* Outputs for Atomic SubSystem: '/HighwayAssistant_LaneChangingAssistant' */
/* Chart: '/Chart' incorporates:
* Inport: '/Enable_Display'
* Inport: '/Highway_Input_Signal'
* Inport: '/Input_Switch'
*/
if (rtDW.is_active_c3_HighwayAssistant_L == 0U) {
rtDW.is_active_c3_HighwayAssistant_L = 1U;
rtDW.is_c3_HighwayAssistant_Lanechan = IN_Condition1;
rtb_Highway_Display_Mode_1 = 232U;
rtb_Highway_Display_Mode_2 = 183U;
rtb_Highway_Display_Mode_3 = 41U;
} else if (rtDW.is_c3_HighwayAssistant_Lanechan == IN_Condition1) {
rtb_Highway_Display_Mode_1 = 232U;
rtb_Highway_Display_Mode_2 = 183U;
rtb_Highway_Display_Mode_3 = 41U;
if ((Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Highway_Input_Signal_DE_Highway_Input_Signal
() == 1) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Input_Switch_DE_Input_Switch
() == 1) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Enable_Display_DE_Enable_Display
() == 1)) {
rtDW.is_c3_HighwayAssistant_Lanechan = IN_Condition2;
rtb_Highway_Display_Mode_1 = 213U;
rtb_Highway_Display_Mode_2 = 189U;
rtb_Highway_Display_Mode_3 = 9U;
}
} else {
/* case IN_Condition2: */
rtb_Highway_Display_Mode_1 = 213U;
rtb_Highway_Display_Mode_2 = 189U;
rtb_Highway_Display_Mode_3 = 9U;
if ((Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Highway_Input_Signal_DE_Highway_Input_Signal
() == 1) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Input_Switch_DE_Input_Switch
() == 1) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Enable_Display_DE_Enable_Display
() == 0)) {
rtDW.is_c3_HighwayAssistant_Lanechan = IN_Condition1;
rtb_Highway_Display_Mode_1 = 232U;
rtb_Highway_Display_Mode_2 = 183U;
rtb_Highway_Display_Mode_3 = 41U;
}
}

/* End of Chart: '/Chart' */

/* Chart: '/Chart' incorporates:
* Inport: '/Enable_Display'
* Inport: '/Input_Switch'
* Inport: '/Lane_Input_Signal'
*/
if (rtDW.is_active_c1_HighwayAssistant_L == 0U) {
rtDW.is_active_c1_HighwayAssistant_L = 1U;
rtDW.is_c1_HighwayAssistant_Lanechan = IN_Condition1;
rtb_Lane_Display_Mode_1 = 132U;
rtb_Lane_Display_Mode_2 = 185U;
rtb_Lane_Display_Mode_3 = 54U;
rtb_Lane_Display_Mode_4 = 67U;
} else if (rtDW.is_c1_HighwayAssistant_Lanechan == IN_Condition1) {
rtb_Lane_Display_Mode_1 = 132U;
rtb_Lane_Display_Mode_2 = 185U;
rtb_Lane_Display_Mode_3 = 54U;
rtb_Lane_Display_Mode_4 = 67U;
if ((Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Lane_Input_Signal_DE_Lane_Input_Signal
() == 6) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Input_Switch_DE_Input_Switch
() == 1) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Enable_Display_DE_Enable_Display
() == 1)) {
rtDW.is_c1_HighwayAssistant_Lanechan = IN_Condition2;
rtb_Lane_Display_Mode_1 = 127U;
rtb_Lane_Display_Mode_2 = 248U;
rtb_Lane_Display_Mode_3 = 186U;
rtb_Lane_Display_Mode_4 = 84U;
}
} else {
/* case IN_Condition2: */
rtb_Lane_Display_Mode_1 = 127U;
rtb_Lane_Display_Mode_2 = 248U;
rtb_Lane_Display_Mode_3 = 186U;
rtb_Lane_Display_Mode_4 = 84U;
if ((Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Lane_Input_Signal_DE_Lane_Input_Signal
() == 6) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Input_Switch_DE_Input_Switch
() == 1) &&
(Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Enable_Display_DE_Enable_Display
() == 0)) {
rtDW.is_c1_HighwayAssistant_Lanechan = IN_Condition1;
rtb_Lane_Display_Mode_1 = 132U;
rtb_Lane_Display_Mode_2 = 185U;
rtb_Lane_Display_Mode_3 = 54U;
rtb_Lane_Display_Mode_4 = 67U;
}
}

/* End of Chart: '/Chart' */

/* Switch: '/Switch' incorporates:
* Inport: '/Highway_Input_Signal'
* Switch: '/Switch1'
* Switch: '/Switch2'
* Switch: '/Switch3'
*/
if (Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Highway_Input_Signal_DE_Highway_Input_Signal
() != 0) {
/* Outport: '/Display_Mode_1' */
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1
(rtb_Highway_Display_Mode_1);

/* Outport: '/Display_Mode_2' */
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2
(rtb_Highway_Display_Mode_2);

/* Outport: '/Display_Mode_3' */
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3
(rtb_Highway_Display_Mode_3);
rtb_Lane_Display_Mode_4 = 94U;
} else {
/* Outport: '/Display_Mode_1' */
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1
(rtb_Lane_Display_Mode_1);

/* Outport: '/Display_Mode_2' */
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2
(rtb_Lane_Display_Mode_2);

/* Outport: '/Display_Mode_3' */
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3
(rtb_Lane_Display_Mode_3);
}

/* End of Switch: '/Switch' */
/* End of Outputs for SubSystem: '/HighwayAssistant_LaneChangingAssistant' */

/* Outport: '/Display_Mode_4' */
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_4_DE_Display_Mode_4
(rtb_Lane_Display_Mode_4);
}

/* Model initialize function */
void HighwayAssistant_LanechangingAssistant_Init(void)
{
/* (no initialization code required) */
}

/*
* File trailer for generated code.
*
* [EOF]
*/

-------------------------------------------------------------------------------------------------------------------------------------------------------


/*
* File: HighwayAssistant_LanechangingAssistant.h
*
* Code generated for Simulink model 'HighwayAssistant_LanechangingAssistant'.
*
* Model version : 1.29
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Thu May 5 01:21:55 2022
*
* Target selection: autosar.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives:
* 1. Execution efficiency
* 2. RAM efficiency
* Validation result: Not run
*/

#ifndef RTW_HEADER_HighwayAssistant_LanechangingAssistant_h_
#define RTW_HEADER_HighwayAssistant_LanechangingAssistant_h_
#ifndef HighwayAssistant_LanechangingAssistant_COMMON_INCLUDES_
#define HighwayAssistant_LanechangingAssistant_COMMON_INCLUDES_
#include "rtwtypes.h"
#include "Rte_HighwayAssistant_LanechangingAssistant.h"
#endif /* HighwayAssistant_LanechangingAssistant_COMMON_INCLUDES_ */

/* Model Code Variants */

/* Macros for accessing real-time model data structure */

/* Block signals and states (default storage) for system '' */
typedef struct tag_DW {
uint8 is_active_c1_HighwayAssistant_L;/* '/Chart' */
uint8 is_c1_HighwayAssistant_Lanechan;/* '/Chart' */
uint8 is_active_c3_HighwayAssistant_L;/* '/Chart' */
uint8 is_c3_HighwayAssistant_Lanechan;/* '/Chart' */
} DW;

/* Block signals and states (default storage) */
extern DW rtDW;

/*-
* The generated code includes comments that allow you to trace directly
* back to the appropriate location in the model. The basic format
* is /block_name, where system is the system number (uniquely
* assigned by Simulink) and block_name is the name of the block.
*
* Use the MATLAB hilite_system command to trace the generated code back
* to the model. For example,
*
* hilite_system('') - opens system 3
* hilite_system('/Kp') - opens and selects block Kp which resides in S3
*
* Here is the system hierarchy for this model
*
* '' : 'HighwayAssistant_LanechangingAssistant'
* '' : 'HighwayAssistant_LanechangingAssistant/HighwayAssistant_LaneChangingAssistant'
* '' : 'HighwayAssistant_LanechangingAssistant/HighwayAssistant_LaneChangingAssistant/Highway_DisplayUnit'
* '' : 'HighwayAssistant_LanechangingAssistant/HighwayAssistant_LaneChangingAssistant/Lane_DisplayUnit'
* '' : 'HighwayAssistant_LanechangingAssistant/HighwayAssistant_LaneChangingAssistant/Switch_Blocks'
* '' : 'HighwayAssistant_LanechangingAssistant/HighwayAssistant_LaneChangingAssistant/Highway_DisplayUnit/Chart'
* '' : 'HighwayAssistant_LanechangingAssistant/HighwayAssistant_LaneChangingAssistant/Lane_DisplayUnit/Chart'
*/
#endif /* RTW_HEADER_HighwayAssistant_LanechangingAssistant_h_ */

/*
* File trailer for generated code.
*
* [EOF]
*/

-------------------------------------------------------------------------------------------------------------------------------------------------------


/*
* File: rtwtypes.h
*
* Code generated for Simulink model 'HighwayAssistant_LanechangingAssistant'.
*
* Model version : 1.29
* Simulink Coder version : 9.5 (R2021a) 14-Nov-2020
* C/C++ source code generated on : Thu May 5 01:21:55 2022
*
* Target selection: autosar.tlc
* Embedded hardware selection: Intel->x86-64 (Windows64)
* Code generation objectives:
* 1. Execution efficiency
* 2. RAM efficiency
* Validation result: Not run
*/

#ifndef RTWTYPES_H
#define RTWTYPES_H

/* Logical type definitions */
#if (!defined(__cplusplus))
#ifndef false
#define false (0U)
#endif

#ifndef true
#define true (1U)
#endif
#endif

/*=======================================================================*
* Target hardware information
* Device type: Intel->x86-64 (Windows64)
* Number of bits: char: 8 short: 16 int: 32
* long: 32 long long: 64
* native word size: 64
* Byte ordering: LittleEndian
* Signed integer division rounds to: Zero
* Shift right on a signed integer as arithmetic shift: on
*=======================================================================*/

/*=======================================================================*
* Fixed width word size data types: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
*=======================================================================*/
typedef signed char int8_T;
typedef unsigned char uint8_T;
typedef short int16_T;
typedef unsigned short uint16_T;
typedef int int32_T;
typedef unsigned int uint32_T;
typedef long long int64_T;
typedef unsigned long long uint64_T;

/*===========================================================================*
* Generic type definitions: boolean_T, char_T, byte_T, int_T, uint_T, *
* ulong_T, ulonglong_T. *
*===========================================================================*/
typedef unsigned char boolean_T;
typedef int int_T;
typedef unsigned int uint_T;
typedef unsigned long ulong_T;
typedef unsigned long long ulonglong_T;
typedef char char_T;
typedef unsigned char uchar_T;
typedef char_T byte_T;

/*=======================================================================*
* Min and Max: *
* int8_T, int16_T, int32_T - signed 8, 16, or 32 bit integers *
* uint8_T, uint16_T, uint32_T - unsigned 8, 16, or 32 bit integers *
*=======================================================================*/
#define MAX_int8_T ((int8_T)(127))
#define MIN_int8_T ((int8_T)(-128))
#define MAX_uint8_T ((uint8_T)(255U))
#define MAX_int16_T ((int16_T)(32767))
#define MIN_int16_T ((int16_T)(-32768))
#define MAX_uint16_T ((uint16_T)(65535U))
#define MAX_int32_T ((int32_T)(2147483647))
#define MIN_int32_T ((int32_T)(-2147483647-1))
#define MAX_uint32_T ((uint32_T)(0xFFFFFFFFU))
#define MAX_int64_T ((int64_T)(9223372036854775807LL))
#define MIN_int64_T ((int64_T)(-9223372036854775807LL-1LL))
#define MAX_uint64_T ((uint64_T)(0xFFFFFFFFFFFFFFFFULL))

/* Block D-Work pointer type */
typedef void * pointer_T;

/* Include definitions for AUTOSAR Standard and Platform data types. */
#include "Std_Types.h"
#endif /* RTWTYPES_H */

/*
* File trailer for generated code.
*
* [EOF]
*/

-------------------------------------------------------------------------------------------------------------------------------------------------------
Components

HighwayAssistant_LanechangingAssistant

Rp_Highway_Input_Signal

/Highway_LanechangeAssistants_SWC_Pkg/Interfaces/SRIf_Highway_Input_Signal/DE_Highway_Input_Signal
NONE
false
0
false
false
NONE

DefaultInitValue_UInt8
0

/Highway_LanechangeAssistants_SWC_Pkg/Interfaces/SRIf_Highway_Input_Signal

Rp_Lane_Input_Signal

/Highway_LanechangeAssistants_SWC_Pkg/Interfaces/SRIf_Lane_Input_Signal/DE_Lane_Input_Signal
NONE
false
0
false
false
NONE

DefaultInitValue_UInt8
0

/Highway_LanechangeAssistants_SWC_Pkg/Interfaces/SRIf_Lane_Input_Signal

Rp_Enable_Display

/Highway_LanechangeAssistants_SWC_Pkg/Interfaces/SRIf_Enable_Display/DE_Enable_Display
NONE
false
0
false
false
NONE

DefaultInitValue_UInt8
0

/Highway_LanechangeAssistants_SWC_Pkg/Interfaces/SRIf_Enable_Display

Rp_Input_Switch

/Highway_LanechangeAssistants_SWC_Pkg/Interfaces/SRIf_Input_Switch/DE_Input_Switch
NONE
false
0


---------------------------------------------------------------------------------------------------------------------------------------------------------


Highway_LanechangeAssistants_SWC_Pkg

DataConstr

DC_UInt8
0
255


DataTypes

UInt8
VALUE

/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/SwBaseType/uint8
/Highway_LanechangeAssistants_SWC_Pkg/DataConstr/DC_UInt8

SwBaseType

uint8
FIXED_LENGTH
8
NONE
uint8

----------------------------------------------------------------------------------------------------------------------------------------------------------


Components


SwcImplementations

HighwayAssistant_LanechangingAssistant_Impl

Code

HighwayAssistant_LanechangingAssistant_c
SWSRC

HighwayAssistant_LanechangingAssistant_h
SWHDR

rtwtypes_h
SWHDR


C

RsrcCons_HighwayAssistant_LanechangingAssistant

1.29.1
Embedded Coder 7.6 (R2021a) 14-Nov-2020
0
/Components/HighwayAssistant_LanechangingAssistant/HighwayAssistant_LanechangingAssistant_IB


--------------------------------------------------------------------------------------------------------------------------------------------------------

Highway_LanechangeAssistants_SWC_Pkg

Interfaces

SRIf_Highway_Input_Signal
false

DE_Highway_Input_Signal
VALUE

READ-ONLY
STANDARD

/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/UInt8

SRIf_Lane_Input_Signal
false

DE_Lane_Input_Signal
VALUE

READ-ONLY
STANDARD

/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/UInt8

SRIf_Enable_Display
false

DE_Enable_Display
VALUE

READ-ONLY
STANDARD

/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/UInt8

SRIf_Input_Switch
false

DE_Input_Switch
VALUE

READ-ONLY
STANDARD

/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/UInt8

SRIF_Display_Mode_1
false

DE_Display_Mode_1
VALUE

READ-ONLY
STANDARD

/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/UInt8

SRIf_Display_Mode_2
false

DE_Display_Mode_2
VALUE

READ-ONLY
STANDARD


/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/UInt8


SRIf_Display_Mode_3
false

DE_Display_Mode_3
VALUE

READ-ONLY
STANDARD

/Highway_LanechangeAssistants_SWC_Pkg/DataTypes/UInt8

SRIf_Display_Mode_4
false

DE_Display_Mode_4
VALUE

-------------------------------------------------------------------------------------------------------------------------------------------------------

/* Copyright 2018 The MathWorks, Inc. */

/*
* File: Compiler.h
*
* Compiler Abstraction Macros
*
* This header file specifies macros for the abstraction of compiler specific
* keywords used for addressing data and code within declarations and
* definitions. This is used to overcome problems caused by the limited 16 bit
* addressing range. For SIL/PIL macros behave as identity operators.
*
* Note that this file should be replaced with an appropriate RTE file when
* deploying the generated code outside of Simulink.
*/

#ifndef Compiler_h
#define Compiler_h

/* Compiler abstraction macros */
#define FUNC(type, memclass) type
#define P2VAR(ptrtype, memclass, ptrclass) ptrtype *
#define P2CONST(ptrtype, memclass, ptrclass) const ptrtype *
#define CONSTP2VAR(ptrtype, memclass, ptrclass) ptrtype * const
#define CONSTP2CONST(ptrtype, memclass, ptrclass) const ptrtype * const
#define CONST(consttype, memclass) const consttype
#define VAR( type, memclass ) type

#endif /* Compiler_h */
----------------------------------------------------------------------------------------------------------------------------------------------------------

/* Copyright 2018 The MathWorks, Inc. */

/*
* File: Platform_Types.h
*
* Definitions for AUTOSAR platform types
*
* This file contains stub implementations of the AUTOSAR Platform Types.
* The stub implementations can be used for testing the generated code in
* Simulink, for example, in SIL/PIL simulations of the component under
* test. Note that this file should be replaced with an appropriate RTE
* file when deploying the generated code outside of Simulink.
*/

#ifndef PLATFORM_TYPES_H
#define PLATFORM_TYPES_H

/* Define AUTOSAR platform types */
typedef boolean_T boolean;
typedef int16_T sint16;
typedef int32_T sint32;
typedef int8_T sint8;
typedef uint16_T uint16;
typedef uint32_T uint32;
typedef uint8_T uint8;
typedef float float32;
typedef double float64;

/* if target supports long long, rtwtypes.h will define MAX_uint64_T */
#ifdef MAX_uint64_T
typedef int64_T sint64;
typedef uint64_T uint64;
#endif

/* Define AUTOSAR standard primitive types */
typedef boolean Boolean;
typedef uint8 Char8;
typedef sint16 SInt16;
typedef sint32 SInt32;
typedef sint8 SInt4;
typedef sint8 SInt8;
typedef uint16 UInt16;
typedef uint32 UInt32;
typedef uint8 UInt4;
typedef uint8 UInt8;
typedef float64 Double;
typedef float64 Double_with_Nan;
typedef float32 Float;
typedef float32 Float_with_NaN;
#ifdef MAX_uint64_T
typedef int64_T SInt64;
typedef uint64_T UInt64;
#endif


#endif /* PLATFORM_TYPES_H */

-----------------------------------------------------------------------------------------------------------------------------------------------------------

/* This file contains stub implementations of the AUTOSAR RTE functions.
The stub implementations can be used for testing the generated code in
Simulink, for example, in SIL/PIL simulations of the component under
test. Note that this file should be replaced with an appropriate RTE
file when deploying the generated code outside of Simulink.

This file is generated for:
Atomic software component: "HighwayAssistant_LanechangingAssistant"
ARXML schema: "4.3"
File generated on: "05-May-2022 01:22:15" */

#ifndef Rte_HighwayAssistant_LanechangingAssistant_h
#define Rte_HighwayAssistant_LanechangingAssistant_h
#include "Rte_Type.h"
#include "Compiler.h"

/* Data access functions */
#define Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Enable_Display_DE_Enable_Display Rte_IRead_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Rp_Enable_Display_DE_Enable_Display

UInt8
Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Enable_Display_DE_Enable_Display
(void);

#define Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Highway_Input_Signal_DE_Highway_Input_Signal Rte_IRead_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Rp_Highway_Input_Signal_DE_Highway_Input_Signal

UInt8
Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Highway_Input_Signal_DE_Highway_Input_Signal
(void);

#define Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Input_Switch_DE_Input_Switch Rte_IRead_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Rp_Input_Switch_DE_Input_Switch

UInt8
Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Input_Switch_DE_Input_Switch
(void);

#define Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Lane_Input_Signal_DE_Lane_Input_Signal Rte_IRead_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Rp_Lane_Input_Signal_DE_Lane_Input_Signal

UInt8
Rte_IRead_HighwayAssistant_LanechangingAssistant_Step_Rp_Lane_Input_Signal_DE_Lane_Input_Signal
(void);

#define Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1 Rte_IWrite_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1

void
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1
(UInt8 u);

#define Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1 Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1

UInt8*
Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_1_DE_Display_Mode_1
(void);

#define Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2 Rte_IWrite_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2

void
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2
(UInt8 u);

#define Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2 Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2

UInt8*
Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_2_DE_Display_Mode_2
(void);

#define Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3 Rte_IWrite_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3

void
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3
(UInt8 u);

#define Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3 Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3

UInt8*
Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_3_DE_Display_Mode_3
(void);

#define Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_4_DE_Display_Mode_4 Rte_IWrite_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_4_DE_Display_Mode_4

void
Rte_IWrite_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_4_DE_Display_Mode_4
(UInt8 u);

#define Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_4_DE_Display_Mode_4 Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_4_DE_Display_Mode_4

UInt8*
Rte_IWriteRef_HighwayAssistant_LanechangingAssistant_Step_Pp_Display_Mode_4_DE_Display_Mode_4
----------------------------------------------------------------------------------------------------------------------------------------------------------

/* This file contains stub implementations of the AUTOSAR RTE functions.
The stub implementations can be used for testing the generated code in
Simulink, for example, in SIL/PIL simulations of the component under
test. Note that this file should be replaced with an appropriate RTE
file when deploying the generated code outside of Simulink.

This file is generated for:
Atomic software component: "HighwayAssistant_LanechangingAssistant"
ARXML schema: "4.3"
File generated on: "05-May-2022 01:22:15" */

#ifndef Rte_Type_h
#define Rte_Type_h
#include "rtwtypes.h"
#include "Std_Types.h"

/* AUTOSAR RTE Status Types */
#ifndef RTE_E_OK
#define RTE_E_OK (0x00)
#endif

#ifndef RTE_E_LOST_DATA
#define RTE_E_LOST_DATA (0x40)
#endif

#ifndef RTE_E_LIMIT
#define RTE_E_LIMIT (0x82)
#endif

#ifndef E2E_E_OK
#define E2E_E_OK (0x00)
#endif

#ifndef E2EPW_STATUS_OK
#define E2EPW_STATUS_OK (0x00)
#endif

#ifndef E2EPW_STATUS_OKSOMELOST
#define E2EPW_STATUS_OKSOMELOST (0x20)
#endif

/* AUTOSAR Implementation data types, specific to software component */
typedef void* Rte_Instance;

#endif

-----------------------------------------------------------------------------------------------------------------------------------------------------------

/* Copyright 2018 The MathWorks, Inc. */

/*
* File: Std_Types.h
*
* Definitions for AUTOSAR Standard Types
*
* This file contains stub implementations of the AUTOSAR Standard Types.
* The stub implementations can be used for testing the generated code in
* Simulink, for example, in SIL/PIL simulations of the component under
* test. Note that this file should be replaced with an appropriate RTE
* file when deploying the generated code outside of Simulink.
*/

#ifndef Std_Types_h
#define Std_Types_h
#include "Compiler.h"
#include "Platform_Types.h"

/* define Std_ReturnType */
typedef uint8 Std_ReturnType;


#endif /* Std_Types_h */

-----------------------------------------------------------------------------------------------------------------------------------------------------------

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.