| 1 | /* |
| 2 | * Academic License - for use in teaching, academic research, and meeting |
| 3 | * course requirements at degree granting institutions only. Not for |
| 4 | * government, commercial, or other organizational use. |
| 5 | * |
| 6 | * File: m3_core.h |
| 7 | * |
| 8 | * Code generated for Simulink model 'm3_core'. |
| 9 | * |
| 10 | * Model version : 1.91 |
| 11 | * Simulink Coder version : 8.11 (R2016b) 25-Aug-2016 |
| 12 | * C/C++ source code generated on : Thu Sep 27 00:27:58 2018 |
| 13 | * |
| 14 | * Target selection: ert.tlc |
| 15 | * Embedded hardware selection: ARM Compatible->ARM Cortex |
| 16 | * Code generation objectives: Unspecified |
| 17 | * Validation result: Not run |
| 18 | */ |
| 19 | |
| 20 | #ifndef RTW_HEADER_m3_core_h_ |
| 21 | #define RTW_HEADER_m3_core_h_ |
| 22 | #include <float.h> |
| 23 | #include <string.h> |
| 24 | #include <stddef.h> |
| 25 | #ifndef m3_core_COMMON_INCLUDES_ |
| 26 | # define m3_core_COMMON_INCLUDES_ |
| 27 | #include "rtwtypes.h" |
| 28 | #include "rtw_extmode.h" |
| 29 | #include "sysran_types.h" |
| 30 | #include "dt_info.h" |
| 31 | #include "ext_work.h" |
| 32 | #include "concerto_ethernet_wrapper.h" |
| 33 | #include "hw_types.h" |
| 34 | #include "concerto_gpio_wrapper.h" |
| 35 | #endif /* m3_core_COMMON_INCLUDES_ */ |
| 36 | |
| 37 | #include "m3_core_types.h" |
| 38 | |
| 39 | /* Shared type includes */ |
| 40 | #include "multiword_types.h" |
| 41 | #include "MW_target_hardware_resources.h" |
| 42 | |
| 43 | /* Macros for accessing real-time model data structure */ |
| 44 | #ifndef rtmGetFinalTime |
| 45 | # define rtmGetFinalTime(rtm) ((rtm)->Timing.tFinal) |
| 46 | #endif |
| 47 | |
| 48 | #ifndef rtmGetRTWExtModeInfo |
| 49 | # define rtmGetRTWExtModeInfo(rtm) ((rtm)->extModeInfo) |
| 50 | #endif |
| 51 | |
| 52 | #ifndef rtmGetErrorStatus |
| 53 | # define rtmGetErrorStatus(rtm) ((rtm)->errorStatus) |
| 54 | #endif |
| 55 | |
| 56 | #ifndef rtmSetErrorStatus |
| 57 | # define rtmSetErrorStatus(rtm, val) ((rtm)->errorStatus = (val)) |
| 58 | #endif |
| 59 | |
| 60 | #ifndef rtmStepTask |
| 61 | # define rtmStepTask(rtm, idx) ((rtm)->Timing.TaskCounters.TID[(idx)] == 0) |
| 62 | #endif |
| 63 | |
| 64 | #ifndef rtmGetStopRequested |
| 65 | # define rtmGetStopRequested(rtm) ((rtm)->Timing.stopRequestedFlag) |
| 66 | #endif |
| 67 | |
| 68 | #ifndef rtmSetStopRequested |
| 69 | # define rtmSetStopRequested(rtm, val) ((rtm)->Timing.stopRequestedFlag = (val)) |
| 70 | #endif |
| 71 | |
| 72 | #ifndef rtmGetStopRequestedPtr |
| 73 | # define rtmGetStopRequestedPtr(rtm) (&((rtm)->Timing.stopRequestedFlag)) |
| 74 | #endif |
| 75 | |
| 76 | #ifndef rtmGetT |
| 77 | # define rtmGetT(rtm) ((rtm)->Timing.taskTime0) |
| 78 | #endif |
| 79 | |
| 80 | #ifndef rtmGetTFinal |
| 81 | # define rtmGetTFinal(rtm) ((rtm)->Timing.tFinal) |
| 82 | #endif |
| 83 | |
| 84 | #ifndef rtmTaskCounter |
| 85 | # define rtmTaskCounter(rtm, idx) ((rtm)->Timing.TaskCounters.TID[(idx)]) |
| 86 | #endif |
| 87 | |
| 88 | /* Block signals (auto storage) */ |
| 89 | typedef struct { |
| 90 | uint16_T UDPReceive_o1[8]; /* '<Root>/UDP Receive' */ |
| 91 | uint8_T UDPReceive_o2; /* '<Root>/UDP Receive' */ |
| 92 | } B_m3_core_T; |
| 93 | |
| 94 | /* Block states (auto storage) for system '<Root>' */ |
| 95 | typedef struct { |
| 96 | void *UDPSend1_PWORK; /* '<Root>/UDP Send1' */ |
| 97 | void *UDPReceive_PWORK; /* '<Root>/UDP Receive' */ |
| 98 | int32_T clockTickCounter; /* '<S1>/Pulse Generator' */ |
| 99 | concerto_UdpReceive_m3_core_T obj; /* '<Root>/UDP Receive' */ |
| 100 | concerto_UdpSend_m3_core_T obj_c; /* '<Root>/UDP Send1' */ |
| 101 | } DW_m3_core_T; |
| 102 | |
| 103 | /* Parameters (auto storage) */ |
| 104 | struct P_m3_core_T_ { |
| 105 | real_T PulseGenerator_Amp; /* Expression: 1 |
| 106 | * Referenced by: '<S1>/Pulse Generator' |
| 107 | */ |
| 108 | real_T PulseGenerator_Period; /* Computed Parameter: PulseGenerator_Period |
| 109 | * Referenced by: '<S1>/Pulse Generator' |
| 110 | */ |
| 111 | real_T PulseGenerator_Duty; /* Computed Parameter: PulseGenerator_Duty |
| 112 | * Referenced by: '<S1>/Pulse Generator' |
| 113 | */ |
| 114 | real_T PulseGenerator_PhaseDelay; /* Expression: 0 |
| 115 | * Referenced by: '<S1>/Pulse Generator' |
| 116 | */ |
| 117 | uint16_T Constant_Value[8]; /* Computed Parameter: Constant_Value |
| 118 | * Referenced by: '<Root>/Constant' |
| 119 | */ |
| 120 | }; |
| 121 | |
| 122 | /* Real-time Model Data Structure */ |
| 123 | struct tag_RTM_m3_core_T { |
| 124 | const char_T *errorStatus; |
| 125 | RTWExtModeInfo *extModeInfo; |
| 126 | |
| 127 | /* |
| 128 | * Sizes: |
| 129 | * The following substructure contains sizes information |
| 130 | * for many of the model attributes such as inputs, outputs, |
| 131 | * dwork, sample times, etc. |
| 132 | */ |
| 133 | struct { |
| 134 | uint32_T checksums[4]; |
| 135 | } Sizes; |
| 136 | |
| 137 | /* |
| 138 | * SpecialInfo: |
| 139 | * The following substructure contains special information |
| 140 | * related to other components that are dependent on RTW. |
| 141 | */ |
| 142 | struct { |
| 143 | const void *mappingInfo; |
| 144 | } SpecialInfo; |
| 145 | |
| 146 | /* |
| 147 | * Timing: |
| 148 | * The following substructure contains information regarding |
| 149 | * the timing information for the model. |
| 150 | */ |
| 151 | struct { |
| 152 | time_T taskTime0; |
| 153 | uint32_T clockTick0; |
| 154 | time_T stepSize0; |
| 155 | uint32_T clockTick1; |
| 156 | uint32_T clockTick2; |
| 157 | struct { |
| 158 | uint8_T TID[3]; |
| 159 | } TaskCounters; |
| 160 | |
| 161 | time_T tFinal; |
| 162 | boolean_T stopRequestedFlag; |
| 163 | } Timing; |
| 164 | }; |
| 165 | |
| 166 | /* Block parameters (auto storage) */ |
| 167 | extern P_m3_core_T m3_core_P; |
| 168 | |
| 169 | /* Block signals (auto storage) */ |
| 170 | extern B_m3_core_T m3_core_B; |
| 171 | |
| 172 | /* Block states (auto storage) */ |
| 173 | extern DW_m3_core_T m3_core_DW; |
| 174 | |
| 175 | /* External function called from main */ |
| 176 | extern void m3_core_SetEventsForThisBaseStep(boolean_T *eventFlags); |
| 177 | |
| 178 | /* Model entry point functions */ |
| 179 | extern void m3_core_SetEventsForThisBaseStep(boolean_T *eventFlags); |
| 180 | extern void m3_core_initialize(void); |
| 181 | extern void m3_core_step0(void); |
| 182 | extern void m3_core_step1(void); |
| 183 | extern void m3_core_step2(void); |
| 184 | extern void m3_core_terminate(void); |
| 185 | |
| 186 | /* Real-time Model object */ |
| 187 | extern RT_MODEL_m3_core_T *const m3_core_M; |
| 188 | |
| 189 | /*- |
| 190 | * The generated code includes comments that allow you to trace directly |
| 191 | * back to the appropriate location in the model. The basic format |
| 192 | * is <system>/block_name, where system is the system number (uniquely |
| 193 | * assigned by Simulink) and block_name is the name of the block. |
| 194 | * |
| 195 | * Use the MATLAB hilite_system command to trace the generated code back |
| 196 | * to the model. For example, |
| 197 | * |
| 198 | * hilite_system('<S3>') - opens system 3 |
| 199 | * hilite_system('<S3>/Kp') - opens and selects block Kp which resides in S3 |
| 200 | * |
| 201 | * Here is the system hierarchy for this model |
| 202 | * |
| 203 | * '<Root>' : 'm3_core' |
| 204 | * '<S1>' : 'm3_core/LED BLink ' |
| 205 | */ |
| 206 | #endif /* RTW_HEADER_m3_core_h_ */ |
| 207 | |
| 208 | /* |
| 209 | * File trailer for generated code. |
| 210 | * |
| 211 | * [EOF] |
| 212 | */ |
| 213 | |