How Can I Best Update the Aardvark Software API to Promira Software API When I Need to Maintain Specific IP Addresses?

Question from the Customer:

I recently purchased the Promira Serial Platform to replace the Aardvark I2C/SPI Host Adapter. I am trying to “hand over” the Aardvark Software API code to the Promira Software API I2C/SPI Active code.

aardvark-250  Promira Serial Platform

At first, I tried using the Promira Aardvark Wrapper Software API to update the Aardvark I2C/SPI Host Adapter API code. The original code uses the aa_open call using port int (0-8) but with the Promira Serial Platform I ended up with a different port setting, such as port 1.5.2.6.

I then tried writing the Promira API version of my Aardvark communication library. To ensure proper conversion, I am trying to compare the options/constants that are input to some of the functions, such as:

aa_configure(aardvark_handle, AA_CONFIG_SPI_I2C);

How do I check what the corresponding constant is for the Promira platform? I checked the sample codes and found:

pm_configure(promiraUnit, PS_APP_CONFIG_SPI | PS_APP_CONFIG_I2C);

Is this a direct conversion of the function call? Is a mapping available between AA_CONFIG_SPI_I2C and PS_APP_CONFIG_I2C?

Response from Technical Support:

Thanks for your questions! We’ll show you what the configuration values are, but before we do that, we’ll give you a quick overview about the wrapper code and IP addresses.

 

Wrapper Software Translates the IP Address

The Promira Aardvark API Wrapper automatically translates the Promira's IP address to a port number that can be used to open a Promira handle. If the IP addresses that you specified must be used, it is correct to completely migrate from Aardvark Software API to Promira Software API, without using the wrapper software.

 

Aardvark API Enum Values

Here is an example of Aardvark API enum values, which are located in the file aa_pm.h. The Aardvark API configuration enum values are:


AA_CONFIG_GPIO_ONLY = 0x00,
AA_CONFIG_SPI_GPIO = 0x01,
AA_CONFIG_GPIO_I2C = 0x02,
AA_CONFIG_SPI_I2C = 0x03,
AA_CONFIG_QUAD_SPI = 0x04,
AA_CONFIG_QUERY = 0x80

 

For more information, please refer to Configuration, which is a subsection of API Documentation in the Aardvark I2C/SPI Host Adapter User Manual.

 

Promira API Enum Values

For the Promira platform, the configuration enum values are provided in the Promira API package promact_is.h. The Promira API configuration enum values are:


PS_APP_CONFIG_GPIO 0x00000000
PS_APP_CONFIG_SPI 0x00000001
PS_APP_CONFIG_I2C 0x00000010
PS_APP_CONFIG_QUERY -1

 

For more information, please refer to Configuration, which is a subsection of API Documentation in the Promira Serial Platform I2C/SPI Active User Manual.

Additional resources that you may find helpful include the following:

 We hope this answers your questions. If you have other questions about our software, host adapters or other Total Phase products, feel free to email us at sales@totalphase.com. You can also request a demo specific for your application.

Request a Demo