SunSPOT API V3.0


com.sun.spot.sensorboard.protocol
Class AT91_I2C

java.lang.Object
  extended by com.sun.spot.sensorboard.protocol.AT91_I2C
All Implemented Interfaces:
II2C

public class AT91_I2C
extends Object
implements II2C

Class implementing the Inter-Integrated Circuit (I-squared-C) protocol for the AT91

Author:
Syntropy

Constructor Summary
AT91_I2C(IAT91_PIO pio, int sdaPin, int sclPin)
          Constructor.
 
Method Summary
 boolean isIdle()
          Check if the connection is idle
 byte receive(boolean ack)
           
 void start()
          Generates the starting bit-sequence
 void stop()
          Generates the stopping bit-sequence
 boolean transmit(byte d)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AT91_I2C

public AT91_I2C(IAT91_PIO pio,
                int sdaPin,
                int sclPin)
         throws IOException
Constructor. Stores the POI and pins to be used.

Parameters:
pio - PIO interface
sdaPin - pin for the data signal
sclPin - pin for the clock signal
Throws:
IOException
Method Detail

start

public void start()
           throws IOException
Description copied from interface: II2C
Generates the starting bit-sequence

Specified by:
start in interface II2C
Throws:
IOException
See Also:
II2C.start()

stop

public void stop()
          throws IOException
Description copied from interface: II2C
Generates the stopping bit-sequence

Specified by:
stop in interface II2C
Throws:
IOException
See Also:
II2C.stop()

receive

public byte receive(boolean ack)
             throws IOException
Specified by:
receive in interface II2C
Parameters:
ack - indicates whether an ack is to be transmitted
Returns:
a single received byte
Throws:
IOException
See Also:
II2C.receive(boolean)

transmit

public boolean transmit(byte d)
                 throws IOException
Specified by:
transmit in interface II2C
Parameters:
d - a byte to be transmitted
Returns:
true if an ack was received from the receiving slave device
Throws:
IOException
See Also:
II2C.transmit(byte)

isIdle

public boolean isIdle()
               throws IOException
Description copied from interface: II2C
Check if the connection is idle

Specified by:
isIdle in interface II2C
Returns:
true if idle
Throws:
IOException

SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.