I2C SPI USB CAN eSPI Cable Testing View All Videos Quick Start Guides Software Downloads App Notes White Papers User Manuals Knowledge Base Sales Support About Us
Products Blog Sales Support Contact Search
Support Question of the Week: Did You Know You Can Use Cheetah API Software to Integrate the Cheetah SPI Host Adapter with MATLAB?
Rena

I'm using the CheetahTM SPI Host Adapter as an SPI controller, and I need to control Cheetah with MATLAB.  I've tried modifying the h. files and then generate the .m files for MATLAB, but I can't get it to work - each data type "does not exist". Can you tell me the details of what I need to do to make this work?

Thanks for your question! We do not support MATLAB directly, but we provide the tools to use a Host Adapter and MATLAB together. We have a knowledge base article that should help you: How To Use Total Phase Products With MATLAB  - that article uses Aardvark as an example, but the methods can be used with other tools. We also provide Cheetah API Software, which includes code examples that can be used with MATLAB and customized as needed. Following is a summary of the directions. In this example, Python for 64-bit Windows is used. Many other programming languages and operating systems are also supported.

Based on the article How To Use Total Phase Products With MATLAB, following are guidelines to integrate the Cheetah SPI Host Adapter with MATLAB.

Cheetah Software API supports multiple software languages and can be modified for specific user requirements. Figure 1: Cheetah API Software

NOTE: These guidelines can be used with Aardvark adapters and Beagle protocol analyzers as well - just use the appropriate files for the tool.

  1. Download and run the latest version of the Total Phase USB Drivers Installer.
  2. Download and unzip the latest version of the Cheetah API software
  3. Go the c directory in the Cheetah API package.
  4. Modify the functions' names in cheetah.h file.

    • On the cheetah.h file, run a search and replace to rename all functions to have a "c_" prefix. This name modification ensures that the dll and h files match).
    • The Cheetah API functions are not exposed from cheetah.dll with the names listed in the user manual. The cheetah.c source file acts as a wrapper for the dll functions to the API functions which all have the prefix "c_". Those functions' names are exported public. cheetah.dll has functions called "c_aa_open" instead of "aa_open" as seen in cheetah.h.
  5. Run the Mathworks loadlibrary command.
  6. Call loadlibrary('cheetah.dll',['cheetah.h'],'mfilename','cheetah_matlab').

    • The Mathworks loadlibrary command takes c header file and creates m wrapper instead. This command creates a file called cheetah_matlab.m.
  7. Continue with the programming based on the system requirements.

For additional information, please refer to the Cheetah adapter API documentation and the MATLAB loadlibrary command in the MATLAB help site.

For more information about the Cheetah adapter, customizing your setup using software API and other Total Phase products, please refer to the following documents:

If you have other questions about our protocol analyzers or other Total Phase products, feel free to email us at sales@totalphase.com or submit a request for technical support.