/*
 * File: BSER_BattSopCalc.h
 *
 * Code generated for Simulink model 'BSER_BattSopCalc'.
 *
 * Model version                  : A100.2_0
 * Simulink Coder version         : 8.13 (R2017b) 24-Jul-2017
 * C/C++ source code generated on : Wed Aug 25 15:04:45 2021
 *
 * Target selection: ert.tlc
 * Embedded hardware selection: Infineon->TriCore
 * Code generation objectives:
 *    1. MISRA C:2012 guidelines
 *    2. Execution efficiency
 * Validation result: Not run
 */

#ifndef RTW_HEADER_BSER_BattSopCalc_h_
#define RTW_HEADER_BSER_BattSopCalc_h_
#include <math.h>
#ifndef BSER_BattSopCalc_COMMON_INCLUDES_
# define BSER_BattSopCalc_COMMON_INCLUDES_
#include "rtwtypes.h"
#endif                                 /* BSER_BattSopCalc_COMMON_INCLUDES_ */

#include "BSER_BattSopCalc_types.h"

/* Includes for objects with custom storage classes. */
#include "SopParameter.h"

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

/* user code (top of header file) */
#include "ASW_Interface.h"

/* Block signals for system '<S14>/CurrentLimit_LUT1' */
typedef struct {
  real32_T SOP_I_10s;                  /* '<S18>/SOP_I_10s' */
  real32_T SOP_I_Conti;                /* '<S18>/SOP_I_Conti' */
} B_CurrentLimit_LUT1_BSER_Batt_T;

/* Block signals for system '<S15>/CurrentLimit_LUT1' */
typedef struct {
  real32_T SOP_I_10s;                  /* '<S30>/SOP_I_10s' */
  real32_T SOP_I_Conti;                /* '<S30>/SOP_I_Conti' */
} B_CurrentLimit_LUT1_BSER_Ba_o_T;

/* Block signals for system '<S60>/PowerLimit_LUT1' */
typedef struct {
  real32_T SOP_P_10s;                  /* '<S64>/SOP_P_10s' */
  real32_T SOP_P_Conti;                /* '<S64>/SOP_P_Conti' */
} B_PowerLimit_LUT1_BSER_BattSo_T;

/* Block signals for system '<S61>/PowerLimit_LUT1' */
typedef struct {
  real32_T SOP_P_10s;                  /* '<S74>/SOP_P_10s' */
  real32_T SOP_P_Conti;                /* '<S74>/SOP_P_Conti' */
} B_PowerLimit_LUT1_BSER_Batt_d_T;

/* Block signals (auto storage) */
typedef struct {
  boolean_T Ini_enable;                /* '<S1>/SopStatus' */
  boolean_T Fault2_enable;             /* '<S1>/SopStatus' */
  boolean_T Fault3_enable;             /* '<S1>/SopStatus' */
  boolean_T Fault4_enable;             /* '<S1>/SopStatus' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT8_k;/* '<S61>/PowerLimit_LUT8' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT7_h;/* '<S61>/PowerLimit_LUT7' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT6_h;/* '<S61>/PowerLimit_LUT6' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT5_c;/* '<S61>/PowerLimit_LUT5' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT4_n;/* '<S61>/PowerLimit_LUT4' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT3_h;/* '<S61>/PowerLimit_LUT3' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT2_n;/* '<S61>/PowerLimit_LUT2' */
  B_PowerLimit_LUT1_BSER_Batt_d_T PowerLimit_LUT1_c;/* '<S61>/PowerLimit_LUT1' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT8;/* '<S60>/PowerLimit_LUT8' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT7;/* '<S60>/PowerLimit_LUT7' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT6;/* '<S60>/PowerLimit_LUT6' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT5;/* '<S60>/PowerLimit_LUT5' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT4;/* '<S60>/PowerLimit_LUT4' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT3;/* '<S60>/PowerLimit_LUT3' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT2;/* '<S60>/PowerLimit_LUT2' */
  B_PowerLimit_LUT1_BSER_BattSo_T PowerLimit_LUT1;/* '<S60>/PowerLimit_LUT1' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT8_a;/* '<S15>/CurrentLimit_LUT8' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT7_o;/* '<S15>/CurrentLimit_LUT7' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT6_d;/* '<S15>/CurrentLimit_LUT6' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT5_p;/* '<S15>/CurrentLimit_LUT5' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT4_h;/* '<S15>/CurrentLimit_LUT4' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT3_d;/* '<S15>/CurrentLimit_LUT3' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT2_m;/* '<S15>/CurrentLimit_LUT2' */
  B_CurrentLimit_LUT1_BSER_Ba_o_T CurrentLimit_LUT1_m;/* '<S15>/CurrentLimit_LUT1' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT8;/* '<S14>/CurrentLimit_LUT8' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT7;/* '<S14>/CurrentLimit_LUT7' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT6;/* '<S14>/CurrentLimit_LUT6' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT5;/* '<S14>/CurrentLimit_LUT5' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT4;/* '<S14>/CurrentLimit_LUT4' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT3;/* '<S14>/CurrentLimit_LUT3' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT2;/* '<S14>/CurrentLimit_LUT2' */
  B_CurrentLimit_LUT1_BSER_Batt_T CurrentLimit_LUT1;/* '<S14>/CurrentLimit_LUT1' */
} B_BSER_BattSopCalc_T;

/* Block states (auto storage) for system '<Root>' */
typedef struct {
  real32_T Delay_DSTATE;               /* '<S9>/Delay' */
  real32_T Delay_DSTATE_d;             /* '<S10>/Delay' */
  real32_T Delay_DSTATE_dv;            /* '<S11>/Delay' */
  real32_T Delay_DSTATE_a;             /* '<S12>/Delay' */
  real32_T Delay_DSTATE_b;             /* '<S41>/Delay' */
  real32_T Delay1_DSTATE;              /* '<S41>/Delay1' */
  real32_T Delay2_DSTATE;              /* '<S41>/Delay2' */
  real32_T Delay3_DSTATE;              /* '<S41>/Delay3' */
  real32_T Delay4_DSTATE;              /* '<S41>/Delay4' */
  real32_T Delay5_DSTATE;              /* '<S41>/Delay5' */
  real32_T Delay6_DSTATE;              /* '<S41>/Delay6' */
  real32_T Delay7_DSTATE;              /* '<S41>/Delay7' */
  real32_T Delay_DSTATE_e;             /* '<S39>/Delay' */
  real32_T Delay_DSTATE_a0;            /* '<S26>/Delay' */
  real32_T UnitDelay_DSTATE;           /* '<S13>/Unit Delay' */
  real32_T counter;                    /* '<S1>/SopStatus' */
  boolean_T Delay_DSTATE_o;            /* '<S13>/Delay' */
  uint8_T is_active_c3_BSER_BattSopCalc;/* '<S1>/SopStatus' */
  uint8_T is_c3_BSER_BattSopCalc;      /* '<S1>/SopStatus' */
} DW_BSER_BattSopCalc_T;

/* Block signals (auto storage) */
extern B_BSER_BattSopCalc_T BSER_BattSopCalc_B;

/* Block states (auto storage) */
extern DW_BSER_BattSopCalc_T BSER_BattSopCalc_DW;

/* Model entry point functions */
extern void BSER_BattSopCalc_initialize(void);
extern void BSER_BattSopCalc_step(void);

/* Exported data declaration */
#define ASW1_OEM_START_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"

/* Declaration for custom storage class: OutputSignal */
extern volatile boolean_T BSER_bDisFloorFlg;
extern volatile real32_T BSER_iConstCurrChMax;
extern volatile real32_T BSER_iConstCurrDisChMax;
extern volatile real32_T BSER_iPeakCurrCh;
extern volatile real32_T BSER_iPeakCurrDisCh;
extern volatile real32_T BSER_pConstPwrCh;
extern volatile real32_T BSER_pConstPwrDisCh;
extern volatile real32_T BSER_pPeakPwrCh;
extern volatile real32_T BSER_pPeakPwrDisCh;
extern volatile real32_T BSER_rLSOCMax;
extern volatile real32_T BSER_rLSOCMin;
extern volatile real32_T BSER_uPeakVoltCh;
extern volatile real32_T BSER_uPeakVoltDisCh;

#define ASW1_OEM_STOP_SEC_DEFAULT_RAM1_CLEARED_UNSPECIFIED
#include "Asw1_OEM_MemMap.h"

/*-
 * 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>' : 'BSER_BattSopCalc'
 * '<S1>'   : 'BSER_BattSopCalc/BSER_SOP'
 * '<S2>'   : 'BSER_BattSopCalc/BSER_SOP/CellVoltageProc'
 * '<S3>'   : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit'
 * '<S4>'   : 'BSER_BattSopCalc/BSER_SOP/Filter&Output'
 * '<S5>'   : 'BSER_BattSopCalc/BSER_SOP/LSocCalc'
 * '<S6>'   : 'BSER_BattSopCalc/BSER_SOP/PowertLimit'
 * '<S7>'   : 'BSER_BattSopCalc/BSER_SOP/SopStatus'
 * '<S8>'   : 'BSER_BattSopCalc/BSER_SOP/CellVoltageProc/Compare To Constant'
 * '<S9>'   : 'BSER_BattSopCalc/BSER_SOP/CellVoltageProc/Debounce_COVhit'
 * '<S10>'  : 'BSER_BattSopCalc/BSER_SOP/CellVoltageProc/Debounce_CUVhit'
 * '<S11>'  : 'BSER_BattSopCalc/BSER_SOP/CellVoltageProc/Debounce_CUVhit1'
 * '<S12>'  : 'BSER_BattSopCalc/BSER_SOP/CellVoltageProc/Debounce_CUVhit2'
 * '<S13>'  : 'BSER_BattSopCalc/BSER_SOP/CellVoltageProc/K_Lowpass2'
 * '<S14>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge'
 * '<S15>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge'
 * '<S16>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_Correct'
 * '<S17>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_Fault'
 * '<S18>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT1'
 * '<S19>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT2'
 * '<S20>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT3'
 * '<S21>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT4'
 * '<S22>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT5'
 * '<S23>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT6'
 * '<S24>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT7'
 * '<S25>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_LUT8'
 * '<S26>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_Correct/Integrate1'
 * '<S27>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_Charge/CurrentLimit_Correct/Integrate1/Compare To Constant1'
 * '<S28>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_Correct'
 * '<S29>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_Fault'
 * '<S30>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT1'
 * '<S31>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT2'
 * '<S32>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT3'
 * '<S33>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT4'
 * '<S34>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT5'
 * '<S35>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT6'
 * '<S36>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT7'
 * '<S37>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT8'
 * '<S38>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_LUT9'
 * '<S39>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_Correct/Integrate1'
 * '<S40>'  : 'BSER_BattSopCalc/BSER_SOP/CurrentLimit/I_DisCharge/CurrentLimit_Correct/Integrate1/Compare To Constant1'
 * '<S41>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter'
 * '<S42>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Output'
 * '<S43>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_ICF'
 * '<S44>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_ICF1'
 * '<S45>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Ichg10Filter '
 * '<S46>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Idis10Filter'
 * '<S47>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_PCF'
 * '<S48>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_PCF1'
 * '<S49>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Pchg10Filter'
 * '<S50>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Pdis10Filter'
 * '<S51>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_ICF/Compare To Constant'
 * '<S52>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_ICF1/Compare To Constant'
 * '<S53>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Ichg10Filter /Compare To Constant'
 * '<S54>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Idis10Filter/Compare To Constant'
 * '<S55>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_PCF/Compare To Constant'
 * '<S56>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_PCF1/Compare To Constant'
 * '<S57>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Pchg10Filter/Compare To Constant'
 * '<S58>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Filter/SOP_Pdis10Filter/Compare To Constant'
 * '<S59>'  : 'BSER_BattSopCalc/BSER_SOP/Filter&Output/Output/Compare To Constant'
 * '<S60>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg'
 * '<S61>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis'
 * '<S62>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_Correct'
 * '<S63>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_Fault'
 * '<S64>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT1'
 * '<S65>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT2'
 * '<S66>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT3'
 * '<S67>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT4'
 * '<S68>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT5'
 * '<S69>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT6'
 * '<S70>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT7'
 * '<S71>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Chg/PowerLimit_LUT8'
 * '<S72>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_Correct'
 * '<S73>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_Fault'
 * '<S74>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT1'
 * '<S75>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT2'
 * '<S76>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT3'
 * '<S77>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT4'
 * '<S78>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT5'
 * '<S79>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT6'
 * '<S80>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT7'
 * '<S81>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT8'
 * '<S82>'  : 'BSER_BattSopCalc/BSER_SOP/PowertLimit/PowerLimit_Dis/PowerLimit_LUT9'
 */
#endif                                 /* RTW_HEADER_BSER_BattSopCalc_h_ */

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