EasyManuals Logo

Texas Instruments TMS320F2837 D Series Workshop Guide And Lab Manual

Texas Instruments TMS320F2837 D Series
324 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 #60 background imageLoading...
Page #60 background image
F2837xD C-Code Header Files
3 - 12 TMS320F2837xD Microcontroller Workshop - Peripherial Registers Header Files
Peripheral Structure .h files (1 of 2)
Contain bits field structure definitions for each peripheral register
F2837xD_epwm.h
#include “F2837xD_device.h"
Void InitAdc(void)
{
/* Stop time-base counter */
EPwm1Regs.TBCTL.bit.CTRMODE = 1;
/* configure the ADC register */
AdcRegs.ADCCTL1.all = 0x00E4;
};
Your C-source file (e.g., EPwm.c)
// EPWM Individual Register Bit Definitions:
struct TBCTL_BITS { // bits description
Uint16 CTRMODE:2; // 1:0 Counter Mode
Uint16 PHSEN:1; // 2 Phase Load Enable
Uint16 PRDLD:1; // 3 Active Period Load
Uint16 SYNCOSEL:2; // 5:4 Sync Output Select
Uint16 SWFSYNC:1; // 6 Software Force Sync Pulse
Uint16 HSPCLKDIV:3; // 9:7 High Speed TBCLK Pre-scaler
Uint16 CLKDIV:3; // 12:10 Time Base Clock Pre-scaler
Uint16 PHSDIR:1; // 13 Phase Direction Bit
Uint16 FREE_SOFT:2; // 15:14 Emulation Mode Bits
};
// Allow access to the bit fields or entire register:
union TBCTL_REG {
Uint16 all;
struct TBCTL_BITS bit;
};
// EPWM External References & Function Declarations:
extern volatile struct EPWM_REGS EPwm1Regs;
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
F2837xD_device.h
Main include file
Will include all other .h files
Include this file (directly or indirectly)
in each source file:
#include “F2837xD_device.h
F2837xD_adc.h
F2837xD_emif.h
F2837xD_mniintrupt.h
F2837xD_analogsubsys.h
F2837xD_epwm.h
F2837xD_output_xbar.h
F2837xD_can.h
F2837xD_epwm_xbar.h
F2837xD_piectrl.h
F2837xD_cla.h
F2837xD_eqep.h
F2837xD_pievect.h
F2837xD_cmpss.h
F2837xD_flash.h
F2837xD_sci.h
F2837xD_cputimer.h
F2837xD_gpio.h
F2837xD_sdfm.h
F2837xD_dac.h
F2837xD_i2c.h
F2837xD_spi.h
F2837xD_dcsm.h
F2837xD_input_xbar.h
F2837xD_sysctrl.h
F2837xD_device.h
F2837xD_ipc.h
F2837xD_upp.h
F2837xD_dma.h
F2837xD_mcbsp.h
F2837xD_xbar.h
F2837xD_ecap.h
F2837xD_memconfig.h
F2837xD_xint.h
The header file package contains a .h file for each peripheral in the device. The
F2837xD_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 TMS320F2837 D Series

Questions and Answers:

Question and Answer IconNeed help?

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

Texas Instruments TMS320F2837 D Series Specifications

General IconGeneral
BrandTexas Instruments
ModelTMS320F2837 D Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals