This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How can I know which header/c file to include into a project

Hi there,

I am new to the nRF world and I might be asking a very stupid question with obvious answer but I couldn't find any hint from the Infocenter nor the Tutorials, therefore, I really appreciate if you could shed some light here.

I am using gcc arm on Mac, and am able to compile and run a few projects of my own without any issue at all (thanks NoridcSemi for allowing developers their own freedom of choice of development platforms and such a great SDK, exactly why I have left TI's CC26xx).

However, one thing I keep struggling hard is the way to find the proper include files and the .c files required for a particular function or MACRO.

I have browsed many answers to those asking similar, though more specific questions, those answers are very direct - for this function, you need to include this header and that c file, never mentioning how these header/.c files were identified in the first place.

Say, for example, if I am to add the capacitive sensor feature to my project, I read up the SDK Common Libraries -> Capacitive sensor support where it detailed the Data Structures | Macros | Typedefs | Functions of the module, however, there is no mentioning of any .h or .c I need to include into the project. How do I know if I need to include some other headers for the marco NRF_DRV_COMP_CONF_DEFAULT_CONFIG()? Occasionally, for a certain typedef, I could find the information to the header file but it seems not generally available.

Right now, I have to do a manual diff from some of the existing examples but this should not be the case, and it is also error prone and time consuming.

So, how can I know what to include?

Thanks and Regards,
Ed

Parents
  • Probably there is no document since it would be large and have many versions. The SDK seems to change its structure often. The SDK seems to have some spurious includes, not really needed. The build system could be improved (CMake?). C/C++ is mind-numbingly stupid (Rust?). But so far, I prefer the Nordic total package over the many alternatives.

Reply
  • Probably there is no document since it would be large and have many versions. The SDK seems to change its structure often. The SDK seems to have some spurious includes, not really needed. The build system could be improved (CMake?). C/C++ is mind-numbingly stupid (Rust?). But so far, I prefer the Nordic total package over the many alternatives.

Children
No Data
Related