Esempio n. 1
0
/*
 * iicbus_read()
 *
 * Read a block of data from the slave previously started by
 * iicbus_read() call
 */
int 
iicbus_read(device_t bus, char *buf, int len, int *read, int last, int delay)
{
	struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
	
	/* a slave must have been started for reading */
	if (sc->started == 0 || (sc->strict != 0 && (sc->started & LSB) == 0))
		return (EINVAL);

	return (IICBUS_READ(device_get_parent(bus), buf, len, read, last, delay));
}
Esempio n. 2
0
/*
 * iicbus_read()
 *
 * Read a block of data from the slave previously started by
 * iicbus_read() call
 */
int 
iicbus_read(device_t bus, char *buf, int len, int *read, int last, int delay)
{
	struct iicbus_softc *sc = (struct iicbus_softc *)device_get_softc(bus);
	
	/* a slave must have been started with the appropriate address */
	if (!sc->started || !(sc->started & LSB))
		return (EINVAL);

	return (IICBUS_READ(device_get_parent(bus), buf, len, read, last, delay));
}