www.pudn.com > DDS485.rar > datapickup.c
#include <REG932.H>
#include <define.h>
#include <Stdio.h>
#include <Intrins.h>
//-----***-根据命令提取数据并保存到数据发送缓冲区-***-----//
//-----***-DeviceAdd===>IIC的器件地址(数据存储器=0xa0,RTC=0x60,Lm75=0x90)
//-----***-ByteAdd=====>IIC的字节地址
//-----***-*value======>数组的指针
//-----***-DataLend====>数据长度
void CmdPick(unsigned char DeviceAdd,unsigned char ByteAdd,unsigned char *value,unsigned char DataLend)
{
unsigned char i;
for(i=12;i<DataLend+12;i++)
{
if(DeviceAdd==0)
{
InceptBuf[i]=*value;
value++;
}
else
{
InceptBuf[i]=rbyteiic(DeviceAdd,ByteAdd);
ByteAdd++;
}
}
InceptBuf[9]=DataLend+2;
SendStrFg=1;
}