Library retriece current module type


I had a question about the libraries for T20 and iMX6.
After testing I noticed that if I used the common header files (eg gpio.h, spi.h) redirected to the specific platform it was run on at runtime (gpio_teg.h, spi_imx6.h etc).

Also the tests worked on both modules, except for the SPI.
On the T20 I have to initialize op SPI4 and on iMX6 on SPI1.

Is there a way I could retrieve the specific module at runtime using the libraries, so I can choose the correct SPI?

Kind Regards,

Thank you for the report. We are aware of the incompatibility of the ports. We may will fix this in one of the next releases of the libs. Please check the roadmap in case you upgrade the libraries, so you may have to update the SPI numbers in your code.

For now, you can use the the GetProcessorInfo function to get the current module you are running on. This one returns you a struct PROCESSOR_INFO that contains the szProcessorName. You find further details in the libraries CHM help file in the Lib package.

I temporarily fixed it by retrieving the product id.

Thanks for the info!

Kind Regards,