Rapid prototyping with 32-bit MCU-based Curiosity Nano Evaluation Kit using MPLAB Harmony v3 Software Framework: Step 6
This demo application requires adding Click board functionality for the following three Click boards. Click the links below to download the examples for the Click boards.
Add Weather Click Board Routine
Unzip the downloaded ZIP file weather.zip.
From the unzipped folder weather/firmware/src, copy the folder click_routines to the folder firmware/src under your application project.
In the project explorer, right-click on folder Header File and add a subfolder click_routines by selecting Add Existing Items from Folders…
Click on the Add Folder… button.
Select the click_routines folder and select Files of type: as Header Files.
Click on the Add button to add the selected folder.
The Weather Click example header files get added to your project.
In the project explorer, right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders….
Click on the Add Folder button.
Select the click_routines folder and select Files of type: as Source Files.
Click on the Add button to add the selected folder.
The Weather Click example source files get added to your project.
Add Fan Click Board Routine
Unzip the downloaded ZIP file fan.zip.
From the unzipped folder fan/firmware/src/click_routines, copy the folder fan to the folder firmware/src/click_routines under your application project.
In the project explorer, right-click on folder Header Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders….
Click on the Add Folder… button.
Select the fan folder and select Files of type: as Header Files.
Click on the Add button to add the selected folder.
The Fan Click example header files get added to your project.
In the project explorer, right-click on folder Source Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders….
Click on the Add Folder… button.
Select the fan folder and select Files of type: as Source Files.
Click on the Add button to add the selected folder.
The Fan Click example source files get added to your project.
Add eINK Bundle Click Board Routine
Unzip the downloaded ZIP file eink_bundle.zip.
From the unzipped folder fan/firmware/src/click_routines, copy the folder eink_bundle to the folder firmware/src/click_routines under your application project.
In the project explorer, right-click on folder Header Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders….
Click on the Add Folder… button.
Select the eink_bundle folder and select Files of type: as Header Files.
Click on the Add button to add the selected folder.
The eink_bundle Click example header files get added to your project.
In the project explorer, right-click on folder Source Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders….
Click on the Add Folder… button.
Select the eink_bundle folder and select Files of type: as Source Files.
Click on the Add button to add the selected folder.
The eink_bundle Click example source files get added to your project.
Add BLE Source Files
From the unzipped folder /pic32cmmc_smart_appliance_control/dev_files/pic32cm_mc00_cnano, copy the folder ble to the folder firmware/src/ under your application project
In the project explorer, right-click on folder Header Files and add a subfolder ble by selecting Add Existing Items from Folders….
Click on the Add Folder… button.
Select the ble folder from src/ble and select Files of type: as Header Files.
Click on the Add button to add the selected folder.
The ble example header files get added to your project.
In the project explorer, right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders….
Click on the Add Folder… button.
Select the ble folder and select Files of type: as Source Files.
Click on the Add button to add the selected folder.
The ble example source files get added to your project.
Map Generic Macros of Click Routines
From the unzipped folder fan/firmware/src/click_routines, open the file click_interface.h, and copy the Click routine interfaces/resources Macro Declarations as highlighted in Figure 41
Paste click_interface.h in the folder firmware/src/click_routines under your application project.
From the unzipped folder eink_bundle/firmware/src/click_routines, open the file click_interface.h copy the Click routine interfaces resources Macro Declarations as highlighted in Figure 43
Paste click_interface.h in the folder firmware/src/click_routines under your application project
- Map the generic macros used in the Weather Click, Fan Click, and eINK Click bundle routines to the Harmony PLIB APIs of the PIC32CM MC00 MCU based on where the Click boards are placed on the mikroBUS sockets on the Curiosity Nano Base for Click boards.
Fan Click API Mapping
- In this demo, the Fan Click board is placed on the mikroBUS socket #2, which corresponds to the SERCOM0 I2C peripheral to communicate with the Click board. In the click_interface.h, map the generic Fan Click APIs to SERCOM0 as shown in Figure 45.
Weather Click routine API Mapping.
- In this demo, the Weather Click board is placed on the mikroBUS socket #3, which corresponds to the SERCOM0 I2C peripheral to communicate with the Click board. In the click_interface.h, map the generic Weather APIs to SERCOM0 as shown in Figure 46.
eINK Bundle Click routine API Mapping
- In this demo, the eINK Click board is placed on the mikroBUS socket #1, which corresponds to the SERCOM1 SPI peripheral to communicate with the Click board. In the click_interface.h, map the generic eINK Click APIs to SERCOM1 as shown in Figure 47.