⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ad5.c

📁 cap口例程
💻 C
字号:
//
//      TMDX ALPHA RELEASE
//      Intended for product evaluation purposes
//
//###########################################################################
//
// FILE:	DSP28_Example.c
//
// TITLE:	DSP28 CPU_Timer example program.
//
//###########################################################################
//
//  Ver | dd mmm yyyy | Who  | Description of changes
// =====|=============|======|===============================================
//  0.55| 06 May 2002 | S.S. | EzDSP Alpha Release
//  0.57| 27 May 2002 | L.H. | No change
//###########################################################################

// Step 0.  Include required header files
         // DSP28_Device.h: device specific definitions #include statements for
         // all of the peripheral .h definition files.
         // DSP28_Example.h is specific for the given example.  

#include "DSP28_Device.h"

extern  unsigned int a1[128];
extern  unsigned int a2;
volatile Uint16 *count=(volatile Uint16 *)0x9FFF;
float   b[128];

// Prototype statements for functions found within this file.
interrupt void ad(void);

// Step 7. Insert all local Interrupt Service Routines (ISRs) and functions here:	
	// If local ISRs are used, reassign vector addresses in vector table as
    // shown in Step 5

interrupt void ad(void)
{
	IFR=0x0000;
	PieCtrl.PIEACK.all=0xFFFF;
    GpioDataRegs.GPATOGGLE.bit.GPIOA0=1;      

    *count=AdcRegs.ADCRESULT8>>4;
    a1[a2]=(*count);
    b[a2]=((float)a1[a2]/4095*3.0);
    a2++;
  // Reinitialize for next ADC sequence
//  AdcRegs.ADCTRL2.bit.RST_SEQ1 = 1;         // Reset SEQ1
//	AdcRegs.ADCTRL2.bit.RST_SEQ2 = 1;
	AdcRegs.ADCST.bit.INT_SEQ1_CLR=1;
	EINT;
}

//===========================================================================
// No more.
//===========================================================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -