Hi @Maciek ,
We don't have an example with C Caller or C function that calls the SDK API C functions. I've tried to build one but with no success, yet. I'm still working on how to integrate the SDK structures/defines like 'GPIO_Type' into the model so that these blocks recognized them. I am talking also with Mathworks team, and I hope they can shed some light into this. When I will have a working example I will let you know.
Till then, what I usually do when I want to call a specific SDK function in my model is to use the Custom Code library blocks:
nxa11767_1-1634299912088.png
If I need to add something in initialize phase I use the System Initialize block and for actions happening on each step System Outputs.
And I just add there the code I want to call:
nxa11767_2-1634300020385.png
The GPIO9 will be recognized since is defined in the MIMXRT1170_cm7.h included in the SDK driver header files. You might need to add in the Hardware settings-> Code generation -> Custom code the specific driver header include for the peripheral you use and the C source of the driver if the model file does not contain at least a block for that peripheral (in this case the include is already added in the block tcl file and C source added to build path).
Also, for the variable inputs/outputs of the function I'm calling, I add in the model data memory storages with the same name and declared as volatile or extern so that it keeps the name I'm giving in the model.
For structures data types for eg that are declared in the SDK headers, you can import them as Simulink Bus into the workspace and define data storage memory with this imported type.
I hope this helps,
Alexandra