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…
![Right-click on folder Header File and add a subfolder click_routines by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add.png?rev=1.1)
Figure 1
Click on the Add Folder… button.
![Click on the Add Folder button](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add2.png?rev=1.1)
Figure 2
Select the click_routines folder and select Files of type: as Header Files.
![Select the click_routines folder and select Files of type: as Header Files](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add3.png?rev=1.1)
Figure 3
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add4.png?rev=1.1)
Figure 4
The Weather Click example header files get added to your project.
![The Weather Click example header files is added to your project](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/weather_click_source.png?rev=1.1)
Figure 5
In the project explorer, right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders….
![Right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add.png?rev=1.1)
Figure 6
Click on the Add Folder button.
![Click on the Add Folder button](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add2.png?rev=1.1)
Figure 7
Select the click_routines folder and select Files of type: as Source Files.
![Select the click_routines folder and select Files of type: as Source Files](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add3.png?rev=1.1)
Figure 8
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add4.png?rev=1.1)
Figure 9
The Weather Click example source files get added to your project.
![The Weather Click example source files is added to your project](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/weather_click_header.png?rev=1.1)
Figure 10
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….
![Right-click on folder Header Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add.png?rev=1.1)
Figure 11
Click on the Add Folder… button.
![Click on the Add Folder button](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add2.png?rev=1.1)
Figure 12
Select the fan folder and select Files of type: as Header Files.
![Select the fan folder and select Files of type: as Header Files](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/fan_file_header_add.png?rev=1.1)
Figure 13
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add4.png?rev=1.1)
Figure 14
The Fan Click example header files get added to your project.
![The Fan Click example header files is added to your project](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/fan_click_header.png?rev=1.1)
Figure 15
In the project explorer, right-click on folder Source Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders….
![Right-click on folder Source Files/click_routines and add a subfolder fan by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add.png?rev=1.1)
Figure 16
Click on the Add Folder… button.
![Click on the Add Folder button.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add2.png?rev=1.1)
Figure 17
Select the fan folder and select Files of type: as Source Files.
![Select the fan folder and select Files of type: as Source Files](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/fan_file_source_add.png?rev=1.1)
Figure 18
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add4.png?rev=1.1)
Figure 19
The Fan Click example source files get added to your project.
![The Fan Click example source files is added to your project.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/fan_click_source.png?rev=1.1)
Figure 20
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….
![Right-click on folder Header Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add.png?rev=1.1)
Figure 21
Click on the Add Folder… button.
![Click on the Add Folder button.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add2.png?rev=1.1)
Figure 22
Select the eink_bundle folder and select Files of type: as Header Files.
![Select the eink_bundle folder and select Files of type: as Header Files.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/eink_file_header_add.png?rev=1.1)
Figure 23
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add4.png?rev=1.1)
Figure 24
The eink_bundle Click example header files get added to your project.
![The eink_bundle Click example header files is added to your project.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/eink_click_header.png?rev=1.1)
Figure 25
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….
![Right-click on folder Source Files/click_routines and add a subfolder eink_bundle by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add.png?rev=1.1)
Figure 26
Click on the Add Folder… button.
![Click on the Add Folder button.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add2.png?rev=1.1)
Figure 27
Select the eink_bundle folder and select Files of type: as Source Files.
![Select the eink_bundle folder and select Files of type: as Source Files.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/eink_file_source_add.png?rev=1.1)
Figure 28
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add4.png?rev=1.1)
Figure 29
The eink_bundle Click example source files get added to your project.
![The eink_bundle Click example source files get added to your project.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/eink_click_source.png?rev=1.1)
Figure 30
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….
![Right-click on folder Header Files and add a subfolder ble by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add.png?rev=1.1)
Figure 31
Click on the Add Folder… button.
![Click on the Add Folder button.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add2.png?rev=1.1)
Figure 32
Select the ble folder from src/ble and select Files of type: as Header Files.
![Select the ble folder from src/ble and select Files of type: as Header Files.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/ble_header3.png?rev=1.1)
Figure 33
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/header_add4.png?rev=1.1)
Figure 34
The ble example header files get added to your project.
![The ble example header files is added to your project.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/ble_header.png?rev=1.1)
Figure 35
In the project explorer, right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders….
![Right-click on folder Source Files and add a subfolder click_routines by selecting Add Existing Items from Folders](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add.png?rev=1.1)
Figure 36
Click on the Add Folder… button.
![Click on the Add Folder button.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add2.png?rev=1.1)
Figure 37
Select the ble folder and select Files of type: as Source Files.
![Select the ble folder and select Files of type: as Source Files](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/ble_source3.png?rev=1.1)
Figure 38
Click on the Add button to add the selected folder.
![Click on the Add button to add the selected folder](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/source_add4.png?rev=1.1)
Figure 39
The ble example source files get added to your project.
![The ble example source files is added to your project.](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/ble_source.png?rev=1.1)
Figure 40
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
![Open the file click_interface.h copy the Click routine interfaces/resources Macro Declarations](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/macro4.png?rev=1.1)
Figure 41
Paste click_interface.h in the folder firmware/src/click_routines under your application project.
![And paste the click_interface.h in the folder firmware/src/click_routines under your application project](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/macro5.png?rev=1.1)
Figure 42
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
![open the file click_interface.h copy the Click routine interfaces resources Macro Declarations](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/macro1.png?rev=1.1)
Figure 43
Paste click_interface.h in the folder firmware/src/click_routines under your application project
![Paste in the click_interface.h in the folder firmware/src/click_routines under your application project](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/macro2.png?rev=1.1)
Figure 44
- 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.
![In the click_interface.h, map the generic Fan Click APIs to SERCOM0](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/macro7.png?rev=1.1)
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.
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.
![In the click_interface.h, map the generic eINK Click APIs to SERCOM1](/xwiki/bin/download/software-tools/harmony/archive/rapid-prototyping-with-32-bit-mcu-based-cnano/rapid-prototyping-with-32-bit-mcu-based-cnano-step6/WebHome/macro3.png?rev=1.1)
Figure 47