4.3. Example header files and device driver files

The example software uses header files that are based on the Cortex Microcontroller Software Interface Standard (CMSIS). The example software includes the following types of files:

Note

You must update to the latest version of the CMSIS-Core files when preparing your own CMSIS software packages. See ARM CMSIS-Core.

Table 4.3 shows the generic Cortex-M0 processor support files.

Table 4.3. Generic Cortex-M0 processor support files

FilenameDescriptions

core_cm0.h

CMSIS 3.0 compatible header file for processor peripheral registers definitions.
core_cmInstr.hCMSIS 3.0 compatible header file for accessing special instructions.
core_cmFunc.hCMSIS 3.0 compatible header file for accessing special registers.
system_CMSDK_CM0.hCMSIS 3.0 compatible header file for system functions.
system_CMSDK_CM0.cCMSIS 3.0 compatible program file for system functions.

Table 4.4 shows the device-specific header files. These files contain changes specific to the FPGA and are located in the fpga_testbench/software/CMSIS directory.

Table 4.4. Device-specific header files

FilenameDescriptions

CMSDK_CM0.h

CMSIS compatible device header file including register definitions.

Table 4.5 shows the device-specific startup codes. These files contain changes specific to the FPGA and are located in the fpga_testbench/software/CMSIS directory.

Table 4.5. Device-specific startup codes

FilenameDescriptions

ARM/startup_CMSDK_CM0.s

CMSIS compatible startup code for ARM DS-5 or Keil MDK

GCC/startup_CMSDK_CM0.s

CMSIS compatible startup code for ARM GCC

Table 4.6 shows the device-specific example device drivers.

Table 4.6. Device-specific example device drivers

FilenameDescriptions
CMSDK_driver.hHeader file for including driver code
CMSDK_driver.cDriver code implementation

To use these header files, you only have to include the device-specific header file CMSDK_CM0.h. This file imports all the required header files. Because some of the shared program files in the software/common directory also support different types of processor, these programs include the following header code:

#ifdef CORTEX_M0#include "CMSDK_CM0.h"#endif

The makefile in directory fpga_testbench/fpga/testcodes/<testname> contains the USER_DEFINE variable that defines the C preprocessing directive CORTEX_M0. This ensures that the simulation uses the correct version of the header file.

Copyright © 2015-2016 ARM. All rights reserved.ARM DUI 0934B
Non-ConfidentialID062017