4.4.2 Synchronous and Asynchronous Model

Synchronous drivers are blocking in nature as compared to asynchronous drivers which are non-blocking in nature. Synchronous drivers are recommended to be used with RTOS, and asynchronous drivers are used in a bare-metal (Non-RTOS) environment. Although, Asynchronous drivers are recommended to be used in a Non-RTOS based application environment, they can be used in an RTOS-based application environment where the application must ensure certain tasks yield control to allow the appropriate running of relevant application tasks.

MPLAB Harmony v3 provides synchronous and asynchronous drivers, where MPLAB Harmony v2 provides only an asynchronous model of drivers. In MPLAB Harmony v3, this mode selection can be done in the configuration options by clicking on the upper half of the driver box in the project graph as shown in the following figure:

Figure 4-6. Configuring Driver Mode