191 lines
7.5 KiB
C
191 lines
7.5 KiB
C
/*
|
|
* File: Model_actuator.h
|
|
*
|
|
* Code generated for Simulink model 'Model_actuator'.
|
|
*
|
|
* Model version : 1.541
|
|
* Simulink Coder version : 24.1 (R2024a) 19-Nov-2023
|
|
* C/C++ source code generated on : Fri Dec 19 16:49:11 2025
|
|
*
|
|
* Target selection: ert.tlc
|
|
* Embedded hardware selection: ARM Compatible->ARM Cortex-M
|
|
* Emulation hardware selection:
|
|
* Differs from embedded hardware (MATLAB Host)
|
|
* Code generation objectives: Unspecified
|
|
* Validation result: Not run
|
|
*/
|
|
|
|
#ifndef Model_actuator_h_
|
|
#define Model_actuator_h_
|
|
#ifndef Model_actuator_COMMON_INCLUDES_
|
|
#define Model_actuator_COMMON_INCLUDES_
|
|
#include <stdbool.h>
|
|
#include <stdint.h>
|
|
#include <stdio.h>
|
|
#endif /* Model_actuator_COMMON_INCLUDES_ */
|
|
|
|
#include "Model_actuator_types.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
|
|
|
|
/* user code (top of header file) */
|
|
#include <stdio.h>
|
|
|
|
/* Block signals (default storage) */
|
|
typedef struct {
|
|
int8_t Merge; /* '<Root>/Merge' */
|
|
} B;
|
|
|
|
/* Block states (default storage) for system '<Root>' */
|
|
typedef struct {
|
|
uint16_t Min_position_Ch0[9]; /* '<Root>/Data Store Memory12' */
|
|
uint16_t Max_position_Ch0[9]; /* '<Root>/Data Store Memory13' */
|
|
uint16_t pos_loc[9]; /* '<Root>/Data Store Memory4' */
|
|
int8_t UnitDelay_DSTATE; /* '<Root>/Unit Delay' */
|
|
int8_t stepSig; /* '<Root>/Data Store Memory' */
|
|
uint8_t mode_loc[9]; /* '<Root>/Data Store Memory1' */
|
|
uint8_t com_loc[9]; /* '<Root>/Data Store Memory2' */
|
|
uint8_t busAdr_loc[9]; /* '<Root>/Data Store Memory3' */
|
|
uint8_t stall_set_loc[9]; /* '<Root>/Data Store Memory5' */
|
|
uint8_t lnoise_set_loc[9]; /* '<Root>/Data Store Memory6' */
|
|
uint8_t autos_set_loc[9]; /* '<Root>/Data Store Memory7' */
|
|
uint8_t speed_set_loc[9]; /* '<Root>/Data Store Memory8' */
|
|
uint8_t coils_stop_set_loc[9]; /* '<Root>/Data Store Memory9' */
|
|
} DW;
|
|
|
|
/* External inputs (root inport signals with default storage) */
|
|
typedef struct {
|
|
uint16_t in_CPOS_ALL_Ch0[9]; /* '<Root>/in_CPOS_ALL_Ch0' */
|
|
uint8_t in_Act_Emrf_Slave_Ch0[9]; /* '<Root>/in_Act_Emrf_Slave_Ch0' */
|
|
uint8_t in_Mode_Slave_Ch0[9]; /* '<Root>/in_Mode_Slave_Ch0' */
|
|
uint8_t in_Act_Err1_Supply_Ch0[9]; /* '<Root>/in_Act_Err1_Supply_Ch0' */
|
|
uint8_t in_Act_Err2_Communication_Ch0[9];
|
|
/* '<Root>/in_Act_Err2_Communication_Ch0' */
|
|
uint8_t in_Act_Err3_Temperature_Ch0[9];
|
|
/* '<Root>/in_Act_Err3_Temperature_Ch0' */
|
|
uint8_t in_Act_Err4_Permanent_Electrical_Ch0[9];
|
|
/* '<Root>/in_Act_Err4_Permanent_Electrical_Ch0' */
|
|
uint8_t in_Act_Stall_Slave_Ch0[9]; /* '<Root>/in_Act_Stall_Slave_Ch0' */
|
|
uint8_t in_Act_Reset_Ch0[9]; /* '<Root>/in_Act_Reset_Ch0' */
|
|
uint8_t in_Busy_Ch0; /* '<Root>/in_Busy_Ch0' */
|
|
uint8_t in_Error_Connect_Ch0; /* '<Root>/in_Error_Connect_Ch0' */
|
|
} ExtU;
|
|
|
|
/* External outputs (root outports fed by signals with default storage) */
|
|
typedef struct {
|
|
ActuatorCmdBus Out1; /* '<Root>/Out1' */
|
|
} ExtY;
|
|
|
|
/* Real-time Model Data Structure */
|
|
struct tag_RTM {
|
|
const char * volatile errorStatus;
|
|
};
|
|
|
|
/* Block signals (default storage) */
|
|
extern B rtB;
|
|
|
|
/* Block states (default storage) */
|
|
extern DW rtDW;
|
|
|
|
/* External inputs (root inport signals with default storage) */
|
|
extern ExtU rtU;
|
|
|
|
/* External outputs (root outports fed by signals with default storage) */
|
|
extern ExtY rtY;
|
|
|
|
/*
|
|
* Exported States
|
|
*
|
|
* Note: Exported states are block states with an exported global
|
|
* storage class designation. Code generation will declare the memory for these
|
|
* states and exports their symbols.
|
|
*
|
|
*/
|
|
extern ActuatorCmdBus controllerData; /* '<Root>/Data Store Memory15' */
|
|
|
|
/* Model entry point functions */
|
|
extern void Model_actuator_initialize(void);
|
|
extern void Model_actuator_step(void);
|
|
extern void Model_actuator_terminate(void);
|
|
|
|
/* Real-time Model object */
|
|
extern RT_MODEL *const rtM;
|
|
|
|
/*-
|
|
* These blocks were eliminated from the model due to optimizations:
|
|
*
|
|
* Block '<S7>/Display1' : Unused code path elimination
|
|
* Block '<S7>/Display2' : Unused code path elimination
|
|
* Block '<S7>/Display3' : Unused code path elimination
|
|
* Block '<S12>/Display3' : Unused code path elimination
|
|
*/
|
|
|
|
/*-
|
|
* 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>' : 'Model_actuator'
|
|
* '<S1>' : 'Model_actuator/Check Stall Max'
|
|
* '<S2>' : 'Model_actuator/Check Stall Min'
|
|
* '<S3>' : 'Model_actuator/Finish case'
|
|
* '<S4>' : 'Model_actuator/Homing'
|
|
* '<S5>' : 'Model_actuator/Homing1'
|
|
* '<S6>' : 'Model_actuator/Initial CPOS Max'
|
|
* '<S7>' : 'Model_actuator/Initial CPOS Min'
|
|
* '<S8>' : 'Model_actuator/Move to position Max'
|
|
* '<S9>' : 'Model_actuator/Move to position Min'
|
|
* '<S10>' : 'Model_actuator/Normal Mode'
|
|
* '<S11>' : 'Model_actuator/Start case'
|
|
* '<S12>' : 'Model_actuator/Stop Mode'
|
|
* '<S13>' : 'Model_actuator/Check Stall Max/Check Stall Max'
|
|
* '<S14>' : 'Model_actuator/Check Stall Max/If Action Subsystem2'
|
|
* '<S15>' : 'Model_actuator/Check Stall Max/If Action Subsystem3'
|
|
* '<S16>' : 'Model_actuator/Check Stall Min/Check Stall Min'
|
|
* '<S17>' : 'Model_actuator/Check Stall Min/If Action Subsystem2'
|
|
* '<S18>' : 'Model_actuator/Check Stall Min/If Action Subsystem3'
|
|
* '<S19>' : 'Model_actuator/Homing/MAX POSITION'
|
|
* '<S20>' : 'Model_actuator/Homing/MIN POSITION'
|
|
* '<S21>' : 'Model_actuator/Initial CPOS Max/If Action Subsystem2'
|
|
* '<S22>' : 'Model_actuator/Initial CPOS Max/If Action Subsystem3'
|
|
* '<S23>' : 'Model_actuator/Initial CPOS Max/Initial CPOS Max'
|
|
* '<S24>' : 'Model_actuator/Initial CPOS Min/If Action Subsystem'
|
|
* '<S25>' : 'Model_actuator/Initial CPOS Min/If Action Subsystem3'
|
|
* '<S26>' : 'Model_actuator/Initial CPOS Min/Initial CPOS Min'
|
|
* '<S27>' : 'Model_actuator/Move to position Max/If Action Subsystem2'
|
|
* '<S28>' : 'Model_actuator/Move to position Max/If Action Subsystem3'
|
|
* '<S29>' : 'Model_actuator/Move to position Max/Move to position Max'
|
|
* '<S30>' : 'Model_actuator/Move to position Min/If Action Subsystem2'
|
|
* '<S31>' : 'Model_actuator/Move to position Min/If Action Subsystem3'
|
|
* '<S32>' : 'Model_actuator/Move to position Min/Move to position Min'
|
|
* '<S33>' : 'Model_actuator/Normal Mode/If Action Subsystem2'
|
|
* '<S34>' : 'Model_actuator/Normal Mode/If Action Subsystem3'
|
|
* '<S35>' : 'Model_actuator/Normal Mode/Normal Mode'
|
|
* '<S36>' : 'Model_actuator/Stop Mode/If Action Subsystem2'
|
|
* '<S37>' : 'Model_actuator/Stop Mode/If Action Subsystem3'
|
|
* '<S38>' : 'Model_actuator/Stop Mode/stop mode'
|
|
*/
|
|
#endif /* Model_actuator_h_ */
|
|
|
|
/*
|
|
* File trailer for generated code.
|
|
*
|
|
* [EOF]
|
|
*/
|