# Code Interface Report for PMSM_Controller

### Table of Contents

- Entry-Point Functions
- Inports
- Outports
- Interface Parameters
- Data Stores

### Entry-Point Functions

Function: PMSM_Controller_initialize

Prototype | void PMSM_Controller_initialize(RT_MODEL *const rtM)
Description | Initialization entry point of generated code
Timing | Must be called exactly once

Arguments

# | Name | Data Type | Description
--- | --- | --- | ---
1 | rtM | RT_MODEL *const | RTModel

Return value | None
Header file | PMSM_Controller.h

Function: PMSM_Controller_step

Prototype | void PMSM_Controller_step(RT_MODEL *const rtM)
Description | Output entry point of generated code
Timing | Must be called periodically, every 5e-05 seconds

Arguments

# | Name | Data Type | Description
--- | --- | --- | ---
1 | rtM | RT_MODEL *const | RTModel

Return value | None
Header file | PMSM_Controller.h

### Inports

[-]

Block Name | Code Identifier | Data Type | Scaling | Dimension
--- | --- | --- | --- | ---
<S3>/adc_Phase | Defined externally | int16_T |  | [3]
<S3>/hall_abc | Defined externally | uint8_T |  | [3]
<S3>/spd_Target | Defined externally | int32_T | sfix32_En4 | 1
<S3>/idq_Target | Defined externally | int16_T | sfix16_En5 | 1
<S3>/vdq_Target | Defined externally | int16_T | sfix16_En5 | [2]
<S3>/idq_Limit | Defined externally | int16_T | sfix16_En5 | 1
<S3>/b_motEna | Defined externally | boolean_T |  | 1
<S3>/b_cruiseEna | Defined externally | boolean_T |  | 1
<S3>/n_ctrlMod | Defined externally | uint8_T |  | 1
<S3>/iDC_Limit | Defined externally | int16_T | sfix16_En5 | 1
<S3>/spd_Limit | Defined externally | int32_T | sfix32_En4 | 1
<S3>/vDC | Defined externally | int16_T | sfix16_En5 | 1
<S3>/sys_ticks | Defined externally | uint32_T |  | 1
<S3>/set_Angle | Defined externally | int16_T | sfix16_En4 | 1

### Outports

[-]

Block Name | Code Identifier | Data Type | Scaling | Dimension
--- | --- | --- | --- | ---
<S3>/n_Duty | Defined externally | int16_T |  | [3]
<S3>/n_Sector | Defined externally | uint8_T |  | 1
<S3>/n_MotError | Defined externally | uint8_T |  | 1
<S3>/f_Vdq | Defined externally | int16_T | sfix16_En5 | [2]
<S3>/f_Idq | Defined externally | int16_T | sfix16_En5 | [2]
<S3>/f_MotAngle | Defined externally | int16_T | sfix16_En4 | 1
<S3>/f_MotRPM | Defined externally | int32_T | sfix32_En4 | 1
<S3>/n_hallStat | Defined externally | uint8_T |  | 1
<S3>/n_FocMode | Defined externally | uint8_T |  | 1
<S3>/b_advCtrl | Defined externally | boolean_T |  | 1

### Interface Parameters

[-]

Parameter Source | Code Identifier | Data Type | Scaling | Dimension
--- | --- | --- | --- | ---
cf_Fw_Kb | rtP.cf_Fw_Kb | int16_T | sfix16_En10 | 1
cf_Fw_Ki | rtP.cf_Fw_Ki | int16_T | sfix16_En10 | 1
cf_idKp | rtP.cf_idKp | int16_T | sfix16_En10 | 1
cf_iqKp | rtP.cf_iqKp | int16_T | sfix16_En10 | 1
cf_nKp | rtP.cf_nKp | int16_T | sfix16_En10 | 1
V_modulation | rtP.V_modulation | int16_T | sfix16_En14 | 1
cf_idKb | rtP.cf_idKb | int16_T | sfix16_En14 | 1
cf_idKi | rtP.cf_idKi | int16_T | sfix16_En14 | 1
cf_iqKb | rtP.cf_iqKb | int16_T | sfix16_En14 | 1
cf_iqKi | rtP.cf_iqKi | int16_T | sfix16_En14 | 1
cf_nKb | rtP.cf_nKb | int16_T | sfix16_En14 | 1
cf_nKi | rtP.cf_nKi | int16_T | sfix16_En14 | 1
f_adc_curr_ceof | rtP.f_adc_curr_ceof | int16_T | sfix16_En14 | 1
cf_lastIqGain | rtP.cf_lastIqGain | int16_T | sfix16_En15 | 1
i_hall_offset | rtP.i_hall_offset | int16_T | sfix16_En4 | 1
i_dqMax | rtP.i_dqMax | int16_T | sfix16_En5 | 1
id_fieldWeakMax | rtP.id_fieldWeakMax | int16_T | sfix16_En5 | 1
dz_OpenStepVol | rtP.dz_OpenStepVol | int16_T | sfix16_En7 | 1
f_lpf_idq | rtP.f_lpf_idq | uint16_T | ufix16_En16 | 1
f_lpf_vdq | rtP.f_lpf_vdq | uint16_T | ufix16_En16 | 1
i_pwm_count | rtP.i_pwm_count | uint16_T |  | 1
n_polePairs | rtP.n_polePairs | uint8_T |  | 1

### Data Stores

No data stores in the model; note that this report lists only data stores with non-auto storage class and global data stores