To view the Code Configurator, press the blue ‘MCC’ button on the toolbar.
Project resources panel – shows all of the existing things being setup by the code configurator.
Adding a new peripheral to code configurator
In the ‘Device Resources’ panel double click the peripheral to all.
A page for it opens and it is added to the ‘Project Resources’ panel.
Generating The Code
‘Project Resources’ panel > ‘Generate’ button.
If you get a “Configuration has warnings” message you can see them in the ‘Notifications [MCC]’ panel of the output window.
Once generated, when you view your project files you will have:
Has the main() function with calls to the necessary initialise code it has generated.
If you have your own main() function then rename it to say ap_main() and call it from here.
MCC Generated Files
These folders will have been added to your ‘Source Files’ and ‘Header Files’ folders. In here you will find all the code the code configurator has created as well as example functions you can call to use the peripherals you’ve setup.
Include the header files you want to use