How to call c2000 library functions with the S-Function builder?
5 views (last 30 days)
I need to communicate with a device via SPI which needs a special communications structure. For that I need to change some registers such us the transmit delay of the SPI.
To learn how to use the sfunctions. I start with something easier which is just to call the function GPIO_setPinConfig(). I included all the necessary headers but unfortunatly It gives me the following errors:
warning: implicit declaration of function 'GPIO_setPinConfig'
I don't know how to solve that.
Here is the code I wrote so far.
Pls, could you give some advice about how to get this external functions to work?
Thanks in advance. I am looking forward to your reply.
Benjamin Thompson on 29 Jul 2022
If you are using mex to compile this C code into a binary for Simulink to use as an S-Function block, you probably need to use the -l and -L switches to include an external C2000 library or object file or something like that. Type "help mex" to get more information. If this is not helpful please attach some sample files of your work.