unsigned char R_Data(unsigned char addr) { unsigned char rdata; DS_RST0; DS_SCL0; __no_operation(); DS_RST1; Write1Byte(addr); //???? rdata = Read1Byte(); //???? DS_SCL1; DS_RST0; return(rdata); }
/******************************************* 函数名称:R_Data 功 能:从某个寄存器读出一个字节数据 参 数:addr--寄存器地址 返回值 :读出的数据 ********************************************/ uchar R_Data(uchar addr) { uchar rdata; DS_RST0; DS_SCL0; _NOP(); DS_RST1; Write1Byte(addr); //写入地址 rdata = Read1Byte(); //读出数据 DS_SCL1; DS_RST0; return(rdata); }
void BurstReadRAM(unsigned char *ptr) { unsigned char i; DS_RST0; DS_SCL0; __no_operation(); DS_RST1; Write1Byte(0xff); for (i = 31; i > 0; i--) { *ptr++ = Read1Byte(); } DS_SCL1; DS_RST0; }