EasyManuals Logo
Home>Texas Instruments>Microcontrollers>C2000

Texas Instruments C2000 Workshop Guide And Lab Manual

Texas Instruments C2000
342 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #52 background imageLoading...
Page #52 background image
F2806x C-Code Header Files
3 - 10 C2000 Microcontroller Workshop - Peripheral Registers Header Files
Peripheral Structure .h files
(1 of 2)
Contain bits field structure definitions for each peripheral register
F2806x_Adc.h
#include “F2806x_Device.h"
Void InitAdc(void)
{
/* Reset the ADC module */
AdcRegs.ADCCTL1.bit.RESET = 1;
/* configure the ADC register */
AdcRegs.ADCCTL1.all = 0x00E4;
};
Your C-source file (e.g., Adc.c)
// ADC Individual Register Bit Definitions:
struct ADCCTL1_BITS { // bits description
Uint16 TEMPCONV:1; // 0 Temperature sensor connection
Uint16 VREFLOCONV:1; // 1 VSSA connection
Uint16 INTPULSEPOS:1; // 2 INT pulse generation control
Uint16 ADCREFSEL:1; // 3 Internal/external reference select
Uint16 rsvd1:1; // 4 reserved
Uint16 ADCREFPWD:1; // 5 Reference buffers powerdown
Uint16 ADCBGPWD:1; // 6 ADC bandgap powerdown
Uint16 ADCPWDN:1; // 7 ADC powerdown
Uint16 ADCBSYCHN:5; // 12:8 ADC busy on a channel
Uint16 ADCBSY:1; // 13 ADC busy signal
Uint16 ADCENABLE:1; // 14 ADC enable
Uint16 RESET:1; // 15 ADC master reset
};
// Allow access to the bit fields or entire register:
union ADCCTL1_REG {
Uint16 all;
struct ADCCTL1_BITS bit;
};
// ADC External References & Function Declarations:
extern volatile struct ADC_REGS AdcRegs;
Next, we will discuss the steps needed to use the header files with your project. The .h files
contain the bit field structure definitions for each peripheral register.
Peripheral Structure .h files
(2 of 2)
The header file package contains a .h file for
each peripheral in the device
F2806x_Device.h
Main include file
Will include all other .h files
Include this file (directly or indirectly)
in each source file:
#include “F2806x_Device.h”
F2806x_Adc.h F2806x_BootVars.h F2806x_Cla.h
F2806x_Comp.h F2806x_CpuTimers.h F2806x_DevEmu.h
F2806x_Device.h F2806x_Dma.h F2806x_ECan.h
F2806x_ECap.h F2806x_EPwm.h F2806x_EQep.h
F2806x_Gpio.h F2806x_I2c.h F2806x_Mcbsp.h
F2806x_NmiIntrupt.h F2806x_PieCtrl.h F2806x_PieVect.h
F2806x_Sci.h F2806x_Spi.h F2806x_SysCtrl.h
F2806x_Usb.h F2806x_XIntrupt.h
The header file package contains a .h file for each peripheral in the device. The
F2806x_Device.h file is the main include file. It will include all of the other .h files. There are

Table of Contents

Other manuals for Texas Instruments C2000

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments C2000 and is the answer not in the manual?

Texas Instruments C2000 Specifications

General IconGeneral
BrandTexas Instruments
ModelC2000
CategoryMicrocontrollers
LanguageEnglish

Related product manuals