3.2 Understanding MPLAB Harmony v3 PLIB Generated Code

The following files and folders are generated in the MPLAB Harmony v3 project:

  • peripheral: Source and header files of all the peripherals used in the project are listed inside the peripheral folder. Usually there will be one .c and one .h PLIB file per peripheral instance. Some of the peripherals and their files are always added by default in the project, such as gpio, clock, evic.
  • definitions.h: This file is similar to the system_definitions.h file of MPLAB Harmony v2. It Includes all the header files required for the application.
  • toolchain_specifics.h: This file has a few macros defined, which are specific to toolchain.
  • device.h: This file includes the headers, which have definitions specific to the selected device, such as xc.h.
  • exceptions.c: This file is same as the system_exceptions.c file of MPLAB Harmony v2. It defines the exception handler for the application.
  • initialization.c: This file is same as the system_init.c file of MPLAB Harmony v2. It initializes all the MPLAB Harmony modules used in the application.
  • interrupts.c: This file is same as the system_interrupt.c file of MPLAB Harmony v2. It contains definitions of all the interrupt service routines used in the application.
  • stdio/xc32_monitor.c: A new feature is added in MPLAB Harmony v3 to support the printf and scanf functions of the standard C library. When the STDIO module (listed in Tools in the Device Resources window) is used, the function definitions inside this file get updated by the MCC to make the printf and scanf functions work.
  • main.c: This file is same as in MPLAB Harmony v2. However, in MPLAB Harmony v2 it is recommended to develop the application in app.c. In a MPLAB Harmony v3 PLIB only project, it is recommended to do it in main.c. MPLAB Harmony v3 driver-based applications are still recommended to be developed in app.c.