Matlab model of simplefoc controller

Thank you @Paul for the support but the aim of the simulink porting is different. I would like to simulate the SimpleFOC implementation to tune the parameters and to verify the match with the inverter with the software I will flash later (Model-in-the-Loop testing).

Regarding the Simulink implementation I tried with S-Functions or Simulink c++ import wizard, but I’m not able to deal with the “Arduino.h” inclusion in every source file.
Would you like to give me some suggestions on how to extract the logic functions from the hardware-dependend operations?

Thank you in advance.
Alberto