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

📄 f2407adc.h

📁 TI的digital motor control lib的源代码。了解TI的编程规范
💻 H
字号:
/* ==================================================================================
File name:        F2407ADC.H                     
                    
Originator:	Digital Control Systems Group
			Texas Instruments
Description:  
This file defines handy constants for object initializations and
contains prototypes for the functions inF2407ADC1.ASM andF2407ADC2.ASM
and has definitions of structs etc.
=====================================================================================
 History:
-------------------------------------------------------------------------------------
 9-15-2000	Release	Rev 1.0                                                  
---------------------------------------------------------------------------------- */

#ifndef __F2407_ADC_H__
#define __F2407_ADC_H__

#include "..\include\F2407BMSK.H"

#ifndef NULL
#define NULL 0
#endif

/*-----------------------------------------------------------------------------
Define the structure of the ADCGEN
-----------------------------------------------------------------------------*/

typedef struct {


   int c1_gain; /* Gain control for channel 1[Q13] */
   int c2_gain; /* Gain control for channel 2[Q13] */
   int c3_gain; /* Gain control for channel 3[Q13] */
   int c4_gain; /* Gain control for channel 4[Q13] */

   int c1_out;  /* Conversion result for channel 1[Q15]*/
   int c2_out;  /* Conversion result for channel 2[Q15]*/
   int c3_out;  /* Conversion result for channel 3[Q15]*/
   int c4_out;  /* Conversion result for channel 4[Q15]*/

   int a4_ch_sel; /* ADC channel select variable[Q0] */

   int (*init)();                           /* Initialization func pointer  */
   int (*update)();                         /* Update function              */
   } ADCVALS;

/*-----------------------------------------------------------------------------
Define a ADCVALS_handle
-----------------------------------------------------------------------------*/

typedef ADCVALS  *ADCVALS_handle;


/*------------------------------------------------------------------------------
Default Initializers for the F2407 ADCVALS Object
------------------------------------------------------------------------------*/

#define F2407_ADC_DEFAULTS { 0x1fff,  \
                            0x1fff,  \
                            0x1fff,  \
                            0x1fff,  \
                            0x0,     \
                            0x0,     \
                            0x0,     \
                            0x0,     \
                            0x3210,  \
                            (int (*)(int))F2407_ADC_Init,  \
                            (int (*)(int))F2407_ADC_Update \
                          }

#define ADC_DEFAULTS F2407_ADC_DEFAULTS

#define CALIBRATION_CONSTANT 0

#define ADCTRL1_INIT_STATE  ADC_SOFT_STOP_FLAG + ADC_SEQ_CASC + \
                            ADC_ACQ_PS_2 + ADC_CPS_1

#define ADCTRL2_INIT_STATE  ADC_INT_FLAG_SEQ1  + ADC_SOC_SEQ1 + \
                            ADC_INT_FLAG_SEQ2
   
/*----------------------------------------------------------------------------
 Function prototypes
 ----------------------------------------------------------------------------*/

void F2407_ADC_Init(ADCVALS_handle);
void F2407_ADC_Update(ADCVALS_handle);


#endif     /*__F2407_ADC_H__ */

⌨️ 快捷键说明

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