July 19, 2011
What is the function and use of m8c.h and PSoCAPI.h header files?
"M8c.h" file has all the register defines for the PSoC. So if you want to use or modify any register in your program, then you need to include it as it will contain the definition of all of them.
"PSoCAPI.h" header file contains all the header files of the user modules which you are using in the project. So instead of adding individual header file of the user module you can directly add "PSoCAPI.h".
In PSoC there are many user modules like LCD, TIMER, etc. To control them we have a set of instructions called API(Application Programming Interface). There are individual header file which contains the definition of these user module and the definition of these user modules will be there in the corresponding .asm file . The header file of a particular user module will contain the declaration of all the APIs of that user module.
For eg: If you are using LCD and Timer8 user module, then "PSoCAPI.h" will have the declaration of "LCD.h" and "Timer8.h".
"LCD.h" will have the declaration of the LCD user modules. LCD.asm will have the definition of the user modules APIs.
So whenever you are using any of the user module, it is convenient to add "PSoCAPI.h" instead of adding individual header files for different user modules.