Modules Representation in Header Files

A dedicated header file is available for each PIC device. If the target device is specified in the project settings, the MPLAB® XC8 Compiler will automatically include the correct header file if the device file is included as shown below:

#include <xc.h>

All of the required register macro definitions can be found in the header file along with bit masks, bit field masks, bit positions and union definitions for the registers. The macros and struct definitions which are already defined in the device specific header file can be used instead of using a register's address.

This is useful for devices that contain the same module and where the header file definitions for that module are identical.