In this section, the project folder structure and file descriptions of an example Atmel START/ASF4 project are described. By clicking the VIEW CODE tab, at the top of the project, the folder structure, as well as the generated code based on the current configuration, can easily be previewed. This will be the same as the one generated in the Export Project screen, once the imported into an IDE. For example, the figure below shows the project structure from both the VIEW CODE preview, as well as the Atmel Studio 7 solution explorer.
The config folder contains one *_config.h for each hpl-device configured by Atmel START. The files in the config folder are used by the HPL layer to configure the functionality the user entered in Atmel START. The files use the CMSIS wizard annotation format.
The examples folder contains examples of using the drivers and is useful to see how to use the ASF4 drivers.
The root folder contains the following files:
atmel_start.c – Code for initializing MCU, drivers, and middleware in the project
atmel_start.h – API for initializing MCU, drivers, and middleware in the project
atmel_start_pins.h – Pin MUX mappings as made by the user inside START
driver_init.c – Code for initializing drivers
driver_init.h – API for initializing drivers
main.c – Main application, initializing the selected peripherals
A full expanded project directory for a simple generated project for the SAM D21 with a single USART is available in ASF4 Project Folder Structure - Full.
In the following sections, more details are given about Root Level Files, Pin Configuration, Examples Folder, and Config Folder. Then System Initialization walks through the start-up sequence of an ASF4 project.