/*
 * File: mrcanhubk344_can_s32ct.h
 *
 * Code generated for Simulink model 'mrcanhubk344_can_s32ct'.
 *
 * Model version                   : 8.1
 * Simulink Coder version          : 24.2 (R2024b) 21-Jun-2024
 * MBDT for S32K3xx Series Version :  Version 1.4.0 (R2021a-R2023a) 29-May-2023
 * C/C++ source code generated on  : Thu Oct 24 17:39:20 2024
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: ARM Compatible->ARM Cortex
 * Code generation objectives: Unspecified
 * Validation result: Not run
 */

#ifndef mrcanhubk344_can_s32ct_h_
#define mrcanhubk344_can_s32ct_h_
#ifndef mrcanhubk344_can_s32ct_COMMON_INCLUDES_
#define mrcanhubk344_can_s32ct_COMMON_INCLUDES_
#include "rtwtypes.h"
#include "mbdt_tja1153.h"
#include "Can_43_FLEXCAN.h"
#include "SchM_Can_43_FLEXCAN.h"
#include "Dio.h"
#include "Dio_Cfg.h"
#include "Adc.h"
#include "freemaster.h"
#include "freemaster_s32k344_lpuart.h"
#include "Lpuart_Uart_Ip_HwAccess.h"
#include "mbdt_lpuart.h"
#include "sys_init.h"
#endif                             /* mrcanhubk344_can_s32ct_COMMON_INCLUDES_ */

#include "mrcanhubk344_can_s32ct_types.h"
#include <stddef.h>

/* Macros for accessing real-time model data structure */
#ifndef rtmGetErrorStatus
#define rtmGetErrorStatus(rtm)         ((rtm)->errorStatus)
#endif

#ifndef rtmSetErrorStatus
#define rtmSetErrorStatus(rtm, val)    ((rtm)->errorStatus = (val))
#endif

/* Block signals (default storage) */
typedef struct {
  uint32_T Hardware_Interrupt_Handler6_o2;/* '<S1>/Hardware_Interrupt_Handler6' */
  uint32_T Hardware_Interrupt_Handler6_o3;/* '<S1>/Hardware_Interrupt_Handler6' */
  uint32_T CANID;                      /* '<S1>/Hardware_Interrupt_Handler6' */
  uint32_T CANLength;                  /* '<S1>/Hardware_Interrupt_Handler6' */
  uint32_T RxCounter0_out;             /* '<S6>/Chart' */
  uint32_T RxCounter1_out;             /* '<S6>/Chart' */
  uint32_T RxCounter2_out;             /* '<S6>/Chart' */
  uint32_T RxCounter3_out;             /* '<S6>/Chart' */
  uint32_T errorCounter_out;           /* '<S6>/Chart' */
  uint32_T idErrorCounter;             /* '<S6>/Chart' */
  uint32_T dataError;                  /* '<S6>/Chart' */
  uint8_T CANData[8];                  /* '<S1>/Hardware_Interrupt_Handler6' */
  uint8_T Can_SetControllerMode1;      /* '<S2>/Can_SetControllerMode1' */
  uint8_T Can_SetControllerMode2;      /* '<S2>/Can_SetControllerMode2' */
  uint8_T Can_SetControllerMode3;      /* '<S2>/Can_SetControllerMode3' */
  uint8_T Can_SetControllerMode4;      /* '<S2>/Can_SetControllerMode4' */
} B_mrcanhubk344_can_s32ct_T;

/* Block states (default storage) for system '<Root>' */
typedef struct {
  uint32_T RxCounter;                  /* '<S6>/Chart' */
  uint32_T RxCounter0_h;               /* '<S6>/Chart' */
  uint32_T RxCounter1_d;               /* '<S6>/Chart' */
  uint32_T RxCounter2_k;               /* '<S6>/Chart' */
  uint32_T RxCounter3_p;               /* '<S6>/Chart' */
  uint32_T RxCounter4;                 /* '<S6>/Chart' */
  uint32_T RxCounter5;                 /* '<S6>/Chart' */
  uint32_T errorCounter;               /* '<S6>/Chart' */
  uint8_T is_active_c9_mrcanhubk344_can_s;/* '<S6>/Chart' */
} DW_mrcanhubk344_can_s32ct_T;

/* Parameters (default storage) */
struct P_mrcanhubk344_can_s32ct_T_ {
  real_T DataStoreMemory10_InitialValue;/* Expression: 0
                                         * Referenced by: '<Root>/Data Store Memory10'
                                         */
  real_T DataStoreMemory13_InitialValue[8];/* Expression: [0 0 0 0 0 0 0 0]
                                            * Referenced by: '<Root>/Data Store Memory13'
                                            */
  real_T DataStoreMemory14_InitialValue;/* Expression: 0
                                         * Referenced by: '<Root>/Data Store Memory14'
                                         */
  real_T DataStoreMemory15_InitialValue;/* Expression: 0
                                         * Referenced by: '<Root>/Data Store Memory15'
                                         */
  real_T DataStoreMemory20_InitialValue;/* Expression: 0
                                         * Referenced by: '<Root>/Data Store Memory20'
                                         */
  real_T DataStoreMemory21_InitialValue;/* Expression: 0
                                         * Referenced by: '<Root>/Data Store Memory21'
                                         */
  int32_T Hardware_Interrupt_Handler6_P1[13];/* Expression: funcParams
                                              * Referenced by: '<S1>/Hardware_Interrupt_Handler6'
                                              */
  uint32_T Can_SetControllerMode1_P1;  /* Expression: funcParams
                                        * Referenced by: '<S2>/Can_SetControllerMode1'
                                        */
  uint32_T Can_SetControllerMode2_P1;  /* Expression: funcParams
                                        * Referenced by: '<S2>/Can_SetControllerMode2'
                                        */
  uint32_T Can_SetControllerMode3_P1;  /* Expression: funcParams
                                        * Referenced by: '<S2>/Can_SetControllerMode3'
                                        */
  uint32_T Can_SetControllerMode4_P1;  /* Expression: funcParams
                                        * Referenced by: '<S2>/Can_SetControllerMode4'
                                        */
  uint32_T Dio_WriteChannel2_P1[2];    /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel2'
                                        */
  uint32_T Dio_WriteChannel3_P1[2];    /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel3'
                                        */
  uint32_T Dio_WriteChannel1_P1[2];    /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel1'
                                        */
  uint32_T Dio_WriteChannel4_P1[2];    /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel4'
                                        */
  uint32_T Dio_WriteChannel10_P1[2];   /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel10'
                                        */
  uint32_T Dio_WriteChannel9_P1[2];    /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel9'
                                        */
  uint32_T Dio_WriteChannel11_P1[2];   /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel11'
                                        */
  uint32_T Dio_WriteChannel12_P1[2];   /* Expression: funcParams
                                        * Referenced by: '<S2>/Dio_WriteChannel12'
                                        */
  uint32_T Can_EnableControllerInterrupts_;/* Expression: funcParams
                                            * Referenced by: '<S3>/Can_EnableControllerInterrupts'
                                            */
  uint32_T Can_EnableControllerInterrupts1;/* Expression: funcParams
                                            * Referenced by: '<S3>/Can_EnableControllerInterrupts1'
                                            */
  uint32_T Can_EnableControllerInterrupts2;/* Expression: funcParams
                                            * Referenced by: '<S3>/Can_EnableControllerInterrupts2'
                                            */
  uint32_T Can_EnableControllerInterrupts3;/* Expression: funcParams
                                            * Referenced by: '<S3>/Can_EnableControllerInterrupts3'
                                            */
  uint32_T Can_DisableControllerInterrupts;/* Expression: funcParams
                                            * Referenced by: '<S4>/Can_DisableControllerInterrupts'
                                            */
  uint32_T Can_DisableControllerInterrup_k;/* Expression: funcParams
                                            * Referenced by: '<S4>/Can_DisableControllerInterrupts1'
                                            */
  uint32_T Can_DisableControllerInterrup_e;/* Expression: funcParams
                                            * Referenced by: '<S4>/Can_DisableControllerInterrupts2'
                                            */
  uint32_T Can_DisableControllerInterrup_l;/* Expression: funcParams
                                            * Referenced by: '<S4>/Can_DisableControllerInterrupts3'
                                            */
  uint32_T Adc_StartGroupConversion_1_P1;/* Expression: funcParam
                                          * Referenced by: '<Root>/Adc_StartGroupConversion_1'
                                          */
  uint32_T DataStoreMemory11_InitialValue;
                           /* Computed Parameter: DataStoreMemory11_InitialValue
                            * Referenced by: '<Root>/Data Store Memory11'
                            */
  uint32_T DataStoreMemory16_InitialValue;
                           /* Computed Parameter: DataStoreMemory16_InitialValue
                            * Referenced by: '<Root>/Data Store Memory16'
                            */
  uint32_T DataStoreMemory17_InitialValue;
                           /* Computed Parameter: DataStoreMemory17_InitialValue
                            * Referenced by: '<Root>/Data Store Memory17'
                            */
  uint32_T DataStoreMemory18_InitialValue;
                           /* Computed Parameter: DataStoreMemory18_InitialValue
                            * Referenced by: '<Root>/Data Store Memory18'
                            */
  uint32_T DataStoreMemory19_InitialValue;
                           /* Computed Parameter: DataStoreMemory19_InitialValue
                            * Referenced by: '<Root>/Data Store Memory19'
                            */
  uint32_T DataStoreMemory5_InitialValue;
                            /* Computed Parameter: DataStoreMemory5_InitialValue
                             * Referenced by: '<Root>/Data Store Memory5'
                             */
  uint32_T DataStoreMemory6_InitialValue;
                            /* Computed Parameter: DataStoreMemory6_InitialValue
                             * Referenced by: '<Root>/Data Store Memory6'
                             */
  uint32_T DataStoreMemory7_InitialValue;
                            /* Computed Parameter: DataStoreMemory7_InitialValue
                             * Referenced by: '<Root>/Data Store Memory7'
                             */
  uint32_T DataStoreMemory9_InitialValue;
                            /* Computed Parameter: DataStoreMemory9_InitialValue
                             * Referenced by: '<Root>/Data Store Memory9'
                             */
  uint16_T DataStoreMemory1_InitialValue;
                            /* Computed Parameter: DataStoreMemory1_InitialValue
                             * Referenced by: '<Root>/Data Store Memory1'
                             */
  uint16_T DataStoreMemory3_InitialValue;
                            /* Computed Parameter: DataStoreMemory3_InitialValue
                             * Referenced by: '<Root>/Data Store Memory3'
                             */
  uint8_T Constant_Value;              /* Computed Parameter: Constant_Value
                                        * Referenced by: '<S2>/Constant'
                                        */
  uint8_T Constant1_Value;             /* Computed Parameter: Constant1_Value
                                        * Referenced by: '<S2>/Constant1'
                                        */
  uint8_T Constant5_Value;             /* Computed Parameter: Constant5_Value
                                        * Referenced by: '<S2>/Constant5'
                                        */
  uint8_T Constant6_Value;             /* Computed Parameter: Constant6_Value
                                        * Referenced by: '<S2>/Constant6'
                                        */
  uint8_T DataStoreMemory12_InitialValue;
                           /* Computed Parameter: DataStoreMemory12_InitialValue
                            * Referenced by: '<Root>/Data Store Memory12'
                            */
  uint8_T DataStoreMemory2_InitialValue;
                            /* Computed Parameter: DataStoreMemory2_InitialValue
                             * Referenced by: '<Root>/Data Store Memory2'
                             */
  uint8_T DataStoreMemory4_InitialValue;
                            /* Computed Parameter: DataStoreMemory4_InitialValue
                             * Referenced by: '<Root>/Data Store Memory4'
                             */
  uint8_T DataStoreMemory8_InitialValue;
                            /* Computed Parameter: DataStoreMemory8_InitialValue
                             * Referenced by: '<Root>/Data Store Memory8'
                             */
};

/* Real-time Model Data Structure */
struct tag_RTM_mrcanhubk344_can_s32c_T {
  const char_T * volatile errorStatus;
};

/* Block parameters (default storage) */
extern P_mrcanhubk344_can_s32ct_T mrcanhubk344_can_s32ct_P;

/* Block signals (default storage) */
extern B_mrcanhubk344_can_s32ct_T mrcanhubk344_can_s32ct_B;

/* Block states (default storage) */
extern DW_mrcanhubk344_can_s32ct_T mrcanhubk344_can_s32ct_DW;

/* Model entry point functions */
extern void mrcanhubk344_can_s32ct_initialize(void);
extern void mrcanhubk344_can_s32ct_step(void);
extern void mrcanhubk344_can_s32ct_terminate(void);

/* Exported data declaration */

/* Volatile memory section */
/* Declaration for custom storage class: Volatile */
extern volatile real_T ADC_Received;   /* '<Root>/Data Store Memory20' */
extern volatile uint16_T Adc1Group0_ResultBuffer;/* '<Root>/Data Store Memory1' */
extern volatile uint16_T Channel1;     /* '<Root>/Data Store Memory3' */
extern volatile real_T Data[8];        /* '<Root>/Data Store Memory13' */
extern volatile real_T Dio_Received;   /* '<Root>/Data Store Memory21' */
extern volatile real_T Length;         /* '<Root>/Data Store Memory15' */
extern volatile uint32_T RxCounter0;   /* '<Root>/Data Store Memory19' */
extern volatile uint32_T RxCounter1;   /* '<Root>/Data Store Memory16' */
extern volatile uint32_T RxCounter2;   /* '<Root>/Data Store Memory17' */
extern volatile uint32_T RxCounter3;   /* '<Root>/Data Store Memory18' */
extern volatile uint8_T SetControllerMode_Status;/* '<Root>/Data Store Memory4' */
extern volatile uint8_T SetControllerMode_Status1;/* '<Root>/Data Store Memory2' */
extern volatile uint32_T canHardwareObjectID;/* '<Root>/Data Store Memory11' */
extern volatile uint32_T controllerId; /* '<Root>/Data Store Memory9' */
extern volatile uint32_T ctrlErrOut;   /* '<Root>/Data Store Memory5' */
extern volatile uint32_T dataErrOut;   /* '<Root>/Data Store Memory7' */
extern volatile uint32_T idErrOut;     /* '<Root>/Data Store Memory6' */

/* Real-time Model object */
extern RT_MODEL_mrcanhubk344_can_s32_T *const mrcanhubk344_can_s32ct_M;
extern volatile boolean_T stopRequested;
extern volatile boolean_T runModel;

/*-
 * The generated code includes comments that allow you to trace directly
 * back to the appropriate location in the model.  The basic format
 * is <system>/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('<S3>')    - opens system 3
 * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3
 *
 * Here is the system hierarchy for this model
 *
 * '<Root>' : 'mrcanhubk344_can_s32ct'
 * '<S1>'   : 'mrcanhubk344_can_s32ct/HardwareRx'
 * '<S2>'   : 'mrcanhubk344_can_s32ct/Initialize Function'
 * '<S3>'   : 'mrcanhubk344_can_s32ct/Simulink Function'
 * '<S4>'   : 'mrcanhubk344_can_s32ct/Simulink Function1'
 * '<S5>'   : 'mrcanhubk344_can_s32ct/Subsystem'
 * '<S6>'   : 'mrcanhubk344_can_s32ct/can_out'
 * '<S7>'   : 'mrcanhubk344_can_s32ct/can_out/Chart'
 */
#endif                                 /* mrcanhubk344_can_s32ct_h_ */

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