Internet of Things Competition-Based on CC2530 Register Development-Basic Knowledge Learning

1. C language basic knowledge learning

  1. The role of the header file : the header file mainly includes the declaration of the function, the macro definition structure, etc., and the definition of the header file can be directly called, and it is not necessary to know how the functions are implemented. For example: #include <ioCC2530.h>, to call this header file can directly use the port number, CC2530 registers, basic keywords of C language, etc. (Generally, official header files use < > to call, custom header files use " " to call )
  2. The function of define macro definition:
  • Give a variable or a port an alias, for example, give an alias to the port corresponding to the LED and button SW1;
  • Macro defines functions with and without parameters for easy calling; (#define PRINT(Val) printf(#Val " = %d\n", Val) )
  • Conditional compilation , how to define this header file to perform corresponding operations
    such as &#x

Guess you like

Origin blog.csdn.net/a6662580/article/details/124613236