do {
mcr_val = readl(mcr);
} while (!(mcr_val & MCR_DONE));
return (mcr_val & MCR_RD_DATA) ? 1 : 0;
}
/* * this is the low level routine to * reset the device on the One Wire interface * on the hardware
*/ static u8 sgi_w1_reset_bus(void *data)
{ struct sgi_w1_device *dev = data;
u8 ret;
writel(MCR_PACK(520, 65), dev->mcr);
ret = sgi_w1_wait(dev->mcr);
udelay(500); /* recovery time */ return ret;
}
/* * this is the low level routine to read/write a bit on the One Wire * interface on the hardware. It does write 0 if parameter bit is set * to 0, otherwise a write 1/read.
*/ static u8 sgi_w1_touch_bit(void *data, u8 bit)
{ struct sgi_w1_device *dev = data;
u8 ret;
if (bit)
writel(MCR_PACK(6, 13), dev->mcr); else
writel(MCR_PACK(80, 30), dev->mcr);
ret = sgi_w1_wait(dev->mcr); if (bit)
udelay(100); /* recovery */ return ret;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.