4.1 Using MPLAB Harmony v3 Drivers
MPLAB Harmony v3 drivers are part of the MPLAB Harmony Core Service and can be used by
downloading (cloning) the core
repository from the MPLAB Harmony GitHub page as described in the Tools and
Installation section. Users need to follow these steps to configure and use
the MPLAB Harmony v3 drivers:
- As described in the MCC section
previously, all MPLAB Harmony v3 resources, including drivers, are listed in the
Device Resources section as shown in the following figure. To add a driver
component, click on the add component icon.
Figure 4-1. Device Resources - MPLAB Harmony v3 drivers have dependencies that must be satisfied as described in the MCC section above. These dependencies are usually satisfied by the PLIB or System Service components. All the dependencies must be satisfied.
- Configure (in the Configuration
Options) all the components which are used to satisfy the dependency. For example,
the USART driver will have a dependency on the UART PLIB, hence the UART PLIB must
be configured.Note: In MPLAB Harmony (both MPLAB Harmony v2 and MPLAB Harmony v3), the driver corresponding to the UART and USART is named as USART driver.
- Drivers can have multiple instances.
There are few configuration options which are common for all the instances, where
few are instance specific. The driver configuration steps are as follows:
- Configure common options in
the Configuration Options by clicking on the upper portion of the USART
Driver box on the Project Graph as shown in the following figure:
Figure 4-2. Driver Common Configuration - By default, drivers have one instance (instance number 0). The number of instances can be increased by clicking on the '+' sign and can be reduced by clicking on the '-' sign.
- Configure instance-specific options by clicking on the respective Instance
box on the Project Graph, as shown below:
Figure 4-3. Instance-Specific Configuration - Once the configuration is complete, generate the code and start using the driver APIs to develop the application.
- Configure common options in
the Configuration Options by clicking on the upper portion of the USART
Driver box on the Project Graph as shown in the following figure: