F2806x C-Code Header Files
C2000 Microcontroller Workshop - Peripheral Registers Header Files 3 - 11
three steps needed to use the header files. The first step is to include this file directly or indirectly
in each source files.
Global Variable Definitions File
With F2806x_GlobalVariableDefs.c included in the project all the needed variable definitions are
globally defined.
Global Variable Definitions File
F2806x_GlobalVariableDefs.c
Declares a global instantiation of the structure
for each peripheral
Each structure is placed in its own section using
a DATA_SECTION pragma to allow linking to the
correct memory (see next slide)
Add this file to your CCS project:
F2806x_GlobalVariableDefs.c
#include "F2806x_Device.h"
…
#pragma DATA_SECTION(AdcRegs,"AdcRegsFile");
volatile struct ADC_REGS AdcRegs;
…
F2806x_GlobalVariableDefs.c
The global variable definition file declares a global instantiation of the structure for each
peripheral. Each structure is placed in its own section using a DATA_SECTION pragma to allow
linking to the correct memory. The second step for using the header files is to add
F2806x_GlobalVariableDefs.c file to your project.