= send_data<<1;
}
}
}
/**********************************************************************
*电流有效值采集函数
*********************************************************************
unsigned int get_IRMS(unsigned char cs5460_command)
{
unsigned char buf_I[3];
unsigned char j;
float IRMS;
unsigned int II_RMS_INT;
float G=1.0/2.0,temp=0.0;
Wait_DRDY_High();
cs5460_READ(cs5460_command);
buf_I[0] = rec_data[0];
buf_I[1] = rec_data[1];
buf_I[2] = rec_data[2];
Write_DRDY_LOW();
for(j=0;j<8;j++)
{
if(buf_I[0]&0x80)
temp+=G;
G=G/2.0;
buf_I[0]<<=1;
}
IRMS = 0.0464*((float)buf_I[0])-0.0114;
II_RMS_INT=(unsigned int)(IRMS*1000.0);
// IRMS = 11.9402*temp+0.0586;
return(II_RMS_INT);
} */
/***************************************************************
*电压有效值采集函数
**************************************************************
float get_VRMS(unsigned char cs5460_command)
{
unsigned char buf_U[3];
unsigned char j;
float VRMS;
float G=1.0/2.0,temp=0.0;
Wait_DRDY_High();
cs5460_READ(cs5460_c