📄 f280xileg.h
字号:
/* ==================================================================================
File name: F280XILEG.H
Originator: Digital Control Systems Group
Texas Instruments
Description: This header file contains source for the F280X Two leg current measurement driver.
Target: TMS320F280x family
=====================================================================================
History:
-------------------------------------------------------------------------------------
04-15-2005 Version 3.20: Using DSP280x v. 1.10 or higher
------------------------------------------------------------------------------------*/
#ifndef __F280XILEG_H__
#define __F280XILEG_H__
#include "f280xbmsk.h"
/*-----------------------------------------------------------------------------
Define the structure of the ILEG2MEAS Object
-----------------------------------------------------------------------------*/
typedef struct { int16 ImeasAGain; // Parameter: gain for Ia (Q13)
int16 ImeasAOffset; // Parameter: offset for Ia (Q15)
int16 ImeasA; // Output: measured Ia (Q15)
int16 ImeasBGain; // Parameter: gain for Ib (Q13)
int16 ImeasBOffset; // Parameter: offset for Ib (Q15)
int16 ImeasB; // Output: measured Ib (Q15)
int16 ImeasC; // Output: computed Ic (Q15)
Uint16 ChSelect; // Parameter: ADC channel selection
void (*init)(); // Pointer to the init function
void (*read)(); // Pointer to the read function
} ILEG2MEAS;
typedef ILEG2MEAS *ILEG2MEAS_handle;
/*-----------------------------------------------------------------------------
Note 1 : It is necessary to call the init function to change the ADC
register settings, for the change in the channel setting for
Ch_sel setting changes to take effect.
The read function will not detect or act upon this change.
-----------------------------------------------------------------------------*/
// Default Initializer for the ILEG2MEAS Object
#define F280X_ILEG2_MEAS_DEFAULTS { 0x1FFF,0x0000,0x0000, \
0x1FFF,0x0000,0x0000, \
0x0000,0x0010, \
(void (*)(Uint32))F280X_ileg2_drv_init, \
(void (*)(Uint32))F280X_ileg2_drv_read \
}
#define ILEG2MEAS_DEFAULTS F280X_ILEG2_MEAS_DEFAULTS
#define ADCTRL1_INIT_STATE_ILEG2 ADC_SUS_MODE0 + ADC_ACQ_PS_16 + \
ADC_CPS_2 + ADC_SEQ_CASC
#define ADCTRL2_INIT_STATE_ILEG2 ADC_EPWM_SOCA_SEQ1
/*------------------------------------------------------------------------------
Prototypes for the functions in F280XILEG.C
------------------------------------------------------------------------------*/
void F280X_ileg2_drv_init(ILEG2MEAS *);
void F280X_ileg2_drv_read(ILEG2MEAS *);
#endif // __F280XILEG_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -