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
Содержание C2000 Piccolo LaunchPad
Страница 74: ...Interrupts 4 18 C2000 Microcontroller Workshop Reset and Interrupts ...
Страница 100: ...Lab 5 System Initialization 5 26 C2000 Microcontroller Workshop System Initialization ...
Страница 126: ...Lab 6 Analog to Digital Converter 6 26 C2000 Microcontroller Workshop Analog to Digital Converter ...
Страница 218: ...Lab 8 IQmath FIR Filter 8 42 C2000 Microcontroller Workshop Numerical Concepts ...
Страница 236: ...Lab 9 Servicing the ADC with DMA 9 18 C2000 Microcontroller Workshop Direct Memory Access Controller ...
Страница 260: ...Lab 10 CLA Floating Point FIR Filter 10 24 C2000 Microcontroller Workshop Control Law Accelerator ...
Страница 331: ...C2000 Microcontroller Workshop Appendix A Experimenter s Kit A 1 Appendix A Experimenter s Kit ...
Страница 334: ...F28069 controlCARD A 4 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 ...
Страница 336: ...F28035 controlCARD A 6 C2000 Microcontroller Workshop Appendix A Experimenter s Kit SW2 SW3 ...
Страница 338: ...F28335 controlCARD A 8 C2000 Microcontroller Workshop Appendix A Experimenter s Kit LD1 LD2 LD3 SW1 ...