📄 f2407adc.h
字号:
/* ==================================================================================
File name: F2407ADC.H
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:
-------------------------------------------------------------------------------------
6-1-2007 Release Rev 3.00
---------------------------------------------------------------------------------- */
#ifndef __F2407ADC_H__
#define __F2407ADC_H__
#include <F2407BMSK.H>
#ifndef NULL
#define NULL 0
#endif
/*-----------------------------------------------------------------------------
Define the structure of the ADCGEN
-----------------------------------------------------------------------------*/
typedef struct {
int Ch1Gain; /* Gain control for channel 1[Q13] */
int Ch2Gain; /* Gain control for channel 2[Q13] */
int Ch3Gain; /* Gain control for channel 3[Q13] */
int Ch4Gain; /* Gain control for channel 4[Q13] */
int Ch1Out; /* Conversion result for channel 1[Q15]*/
int Ch2Out; /* Conversion result for channel 2[Q15]*/
int Ch3Out; /* Conversion result for channel 3[Q15]*/
int Ch4Out; /* Conversion result for channel 4[Q15]*/
unsigned int ChSelect; /* ADC channel select variable[Q0] */
void (*init)(); /* Initialization func pointer */
void (*read)(); /* 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, \
0x6d7b, \
(void (*)(int))F2407_ADC_Init, \
(void (*)(int))F2407_ADC_Read \
}
#define ADCVALS_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_Read(ADCVALS_handle);
#endif /*__F2407_ADC_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -