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

How to include existing header files to main.c?

Hello.

I want to integrate UART and SPI ,I am using SDK15.2. The problem here is i am not able to add app_uart.h to main.c(spi).

My question here is how to add it to main,c? 

I am using Keil uVision.

Thanks in Advance. 

Parents
  • i am not able to add app_uart.h to main.c

    What, exactly, do you mean by that?

    What have you tried?

    What was the result?

    My question here is how to add it to main,c? 

    The simple answer is:

    #include "app_uart.h"
    

    In addition, as  said, you will have to correctly configure your Include Paths so that the compiler knows where to find the file.

    The documentation for your particular IDE will tell you how to do this.

    All of the above is completely standard and would be the same for any 'C' project - it is not specific to Nordic.

    In addition to the above, many of the Nordic headers rely on settings in the sdk_config.h file to "enable" them - so you will also need to have these settings correct.

    BTW - how to post source code:

Reply
  • i am not able to add app_uart.h to main.c

    What, exactly, do you mean by that?

    What have you tried?

    What was the result?

    My question here is how to add it to main,c? 

    The simple answer is:

    #include "app_uart.h"
    

    In addition, as  said, you will have to correctly configure your Include Paths so that the compiler knows where to find the file.

    The documentation for your particular IDE will tell you how to do this.

    All of the above is completely standard and would be the same for any 'C' project - it is not specific to Nordic.

    In addition to the above, many of the Nordic headers rely on settings in the sdk_config.h file to "enable" them - so you will also need to have these settings correct.

    BTW - how to post source code:

Children
Related