数字电源库在应用的时候,其中有个文件DAC_Cnf.c 文件涉及到了DACCTL变量,
extern volatile struct COMP_REGS *Comp[];
extern volatile struct EPWM_REGS *ePWM[];
void DacDrvCnf(int16 n, int16 DACval, int16 DACsrc, int16 RAMPsrc, int16 Slope_initial)
{
EALLOW;
(*Comp[n]).COMPCTL.bit.COMPDACEN = 1; // Power up Comparator locally
(*Comp[n]).COMPCTL.bit.COMPSOURCE = 0; // Connect the inverting input to internal DAC
(*Comp[n]).DACVAL.bit.DACVAL = (DACval>>5); // Set DAC output - Input is Q15 - Convert to Q10
(*Comp[n]).DACCTL.bit.DACSOURCE = DACsrc; // 0 - DACVAL; 1 - Internal ramp for slope compensation
if (DACsrc == 1) // Following lines of code are used when internal slope compensation is used
{
(*Comp[n]).COMPCTL.bit.QUALSEL = 5; // Comparator output must be active for 4 consecutive clocks before resetting the RAMP
(*Comp[n]).DACCTL.bit.RAMPSOURCE = RAMPsrc; // 0 - PMW1; 1 - PWM2,...so on
(*Comp[n]).RAMPDECVAL_SHDW = Slope_initial;
(*ePWM[RAMPsrc+1]).HRPCTL.bit.PWMSYNCSEL = 1; // PWM SYNC generated at CTR = ZRO for synchronizing internal ramp
(*Comp[n]).COMPCTL.bit.CMPINV = 0; // Comparator Output passed
}
EDIS;
}
但是它在DSP2802x_Comp.h头文件中并没有该定义,
struct COM_REGS{
union COMPCTL_REG COMPCTL;
Unit16 rsvd1;
union COMPSTS_REG COMPSTS;
Unit16 rsvd2[3];
union DACVAL_REG DACVAL;
Unit16 rsvd4[10];运行程序ccs一直报错,no field,求解,谢谢