Use Specific Function for Board with New Library (TdxAllLibraries) in C++

I’m using a Tegra T30 Board. When I’m using the new library (TdxAllLibraries) in C++ do I need to use the specific Teg… functions or generic ones?

For example for ADC do I use:

#include "adc_teg.h" 

Or should I use

#include "adc.h"  

It is basically up to you what you want to go for:

If you use the generic version, you are module independent. On the other side, there is a slight performance draw back as there are some more operations done until you are in the module specific function. I would suggest you to use the generic approach.

One other reason we implemented the module specific versions is that we also can use them in the OS layer.

Thank you for the clarification.

Additional question: Is the hardware determined during initialization and later on, when reading ADC values, only one switch case is used? Or is the hardware identified during every read operation?

The query which module your running on is only done once per library and then it is cached. So basically it is only a switch statement and reading this cached variable. Should not add to much of an overhead.