-
大小: 362KB文件類型: .rar金幣: 2下載: 1 次發布日期: 2021-06-10
- 語言: 其他
- 標簽: tms320f2802x??
資源簡介
tms320f2802x幾個例程
DSP2802x_MemCopy.c
DSP2802x_EPwm.c
DSP2802x_PieCtrl.c
DSP2802x_I2C.c
DSP2802x_SWPrioritizedDefaultIsr.c

代碼片段和文件信息
?//?TI?File?$Revision:?/main/3?$
//?Checkin?$Date:?November?6?2008???13:40:52?$
//###########################################################################
//
//?FILE: DSP2802x_Adc.c
//
//?title: DSP2802x?ADC?Initialization?&?Support?Functions.
//
//###########################################################################
//?$TI?Release:?2802x?Header?Files?V1.00?$
//?$Release?Date:?November?10?2008?$
//###########################################################################
#include?“DSP2802x_Device.h“?????//?DSP2802x?Headerfile?Include?File
#include?“DSP2802x_Examples.h“???//?DSP2802x?Examples?Include?File
#define?ADC_usDELAY??5000L
//---------------------------------------------------------------------------
//?InitAdc:
//---------------------------------------------------------------------------
//?This?function?initializes?ADC?to?a?known?state.
//
//?NOTE:?ADC?INIT?IS?DIFFERENT?ON?2802x?DEVICES?COMPARED?TO?OTHER?28X?DEVICES
//
void?InitAdc(void)
{
????extern?void?DSP28x_usDelay(Uint32?Count);
????//?*IMPORTANT*
//?The?Device_cal?function?which?copies?the?ADC?calibration?values?from?TI?reserved
//?OTP?into?the?ADCREFSEL?and?ADCOFFTRIM?registers?occurs?automatically?in?the
//?Boot?ROM.?If?the?boot?ROM?code?is?bypassed?during?the?debug?process?the
//?following?function?MUST?be?called?for?the?ADC?to?function?according
//?to?specification.?The?clocks?to?the?ADC?MUST?be?enabled?before?calling?this
//?function.
//?See?the?device?data?manual?and/or?the?ADC?Reference
//?Manual?for?more?information.
????EALLOW;
SysCtrlRegs.PCLKCR0.bit.ADCENCLK?=?1;
(*Device_cal)();
EDIS;
????//?To?powerup?the?ADC?the?ADCENCLK?bit?should?be?set?first?to?enable
????//?clocks?followed?by?powering?up?the?bandgap?reference?circuitry?and?ADC?core.
????//?Before?the?first?conversion?is?performed?a?5ms?delay?must?be?observed
//?after?power?up?to?give?all?analog?circuits?time?to?power?up?and?settle
????//?Please?note?that?for?the?delay?function?below?to?operate?correctly?the
//?CPU_RATE?define?statement?in?the?DSP2802x_Examples.h?file?must
//?contain?the?correct?CPU?clock?period?in?nanoseconds.
EALLOW;
AdcRegs.ADCCTL1.bit.ADCBGPWD??=?1; //?Power?ADC?BG
AdcRegs.ADCCTL1.bit.ADCREFPWD?=?1; //?Power?reference
AdcRegs.ADCCTL1.bit.ADCPWDN???=?1; //?Power?ADC
AdcRegs.ADCCTL1.bit.ADCENABLE?=?1; //?Enable?ADC
AdcRegs.ADCCTL1.bit.ADCREFSEL?=?0; //?Select?interal?BG
EDIS;
????DELAY_US(ADC_usDELAY);?????????//?Delay?before?converting?ADC?channels
}
void?InitAdcAio()
{
???EALLOW;
/*?Configure?ADC?pins?using?AIO?regs*/
//?This?specifies?which?of?the?possible?AIO?pins?will?be?Analog?input?pins.
//?NOTE:?AIO1357-9111315?are?analog?inputs?in?all?AIOMUX1?configurations.
//?Comment?out?other?unwanted?lines.
????GpioCtrlRegs.AIOMUX1.bit.AIO2?=?2;????//?Configure?AIO2?for?A2?(analog?input)?operation
????GpioCtrlRegs.AIOMUX1.bit.AIO4?=?2;????//?C
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????7668??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\source\DSP2802x_GlobalVariableDefs.c
?????文件??????15170??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_Adc.h
?????文件???????1159??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_BootVars.h
?????文件???????2922??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_Comp.h
?????文件???????5682??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_CpuTimers.h
?????文件???????2823??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_DevEmu.h
?????文件???????4741??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_Device.h
?????文件???????5671??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_ECap.h
?????文件??????22533??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_EPwm.h
?????文件??????13256??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_Gpio.h
?????文件???????7050??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_I2c.h
?????文件???????3150??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_NmiIntrupt.h
?????文件???????5884??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_PieCtrl.h
?????文件???????6269??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_PieVect.h
?????文件???????7858??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_Sci.h
?????文件???????6183??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_Spi.h
?????文件??????15522??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_SysCtrl.h
?????文件???????1888??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\include\DSP2802x_XIntrupt.h
?????文件???????4731??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\gel\DSP2802x_Peripheral.gel
?????文件???????5859??2008-11-10?11:09??03.?Examples?of?Program\DSP2802x_headers\cmd\DSP2802x_Headers_nonBIOS.cmd
?????文件???????3409??2009-01-05?16:27??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\cc_build_Debug.log
?????文件???????1237??2009-01-05?16:27??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Debug.lkf
?????文件???????7197??2008-12-31?14:55??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.c
?????文件???????8497??2009-01-12?10:11??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.paf2
?????文件???????2045??2009-01-12?10:04??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.pjt
?????文件???????6953??2009-01-12?10:11??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.sbl
?????文件???????3072??2009-01-05?16:27??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.CS_\FILE.CDX
?????文件???????1302??2009-01-05?16:27??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.CS_\FILE.DBF
?????文件???????2444??2009-01-05?16:27??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.CS_\FILE.FPT
?????文件?????186368??2009-01-05?16:27??03.?Examples?of?Program\DSP2802x_examples\gpio_toggle\Example_2802xGpioToggle.CS_\SYMBOL.CDX
............此處省略81個文件信息
- 上一篇:安全掃描報告模版
- 下一篇:flash中填空題的制作
評論
共有 條評論