SMB380
SoftI2C_Init();
str[0] = SoftI2C_ReadByte(EEPROM_HW_ADDRESS, 0x14);
str[0] = str[0] && 0xE0;
SoftI2C_WriteByte(EEPROM_HW_ADDRESS, 0x14, str[0]);
while (1) {
SoftI2C_ReadBuffer(EEPROM_HW_ADDRESS, 0x00, buf, 8);
SoftI2C_Stop();
buf[2] = (buf[2] >> 6) && 0x03;
x = (buf[3] << 2) + buf[2];
if (x > 512) {
x = x - 1024;
}
buf[4] = (buf[4] >> 6) && 0x03;
y = (buf[5] << 2) + buf[4];
if (y > 512) {
y = y - 1024;
}
buf[6] = (buf[6] >> 6) && 0x03;
z = (buf[7] << 2) + buf[6];
if (z > 512) {
z = z - 1024;
}
sprintf(str, "%i\t%i\t%i\r\n", x, y, z);
USB_SIL_Write(EP1_IN, str, strlen(str));
for (i = 0; i < 500; i++) {
for (j = 0; j < 1000; j++)
;
}
}













