SunSPOT API V3.0


com.sun.spot.sensorboard.protocol
Interface II2C

All Known Implementing Classes:
AT91_I2C

public interface II2C

Interface I2C provides access to Inter-Integrated Circuit (I-squared-C) pins on the demo sensor board, allowing connection of an external device that conforms to the I2C protocol and the use of such an external device by a program runing on the SPOT.

Author:
jn151271

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)
           
 

Method Detail

start

void start()
           throws IOException
Generates the starting bit-sequence

Throws:
IOException

transmit

boolean transmit(byte d)
                 throws IOException
Parameters:
d - a byte to be transmitted
Returns:
true if an ack was received from the receiving slave device
Throws:
IOException

receive

byte receive(boolean ack)
             throws IOException
Parameters:
ack - indicates whether an ack is to be transmitted
Returns:
a single received byte
Throws:
IOException

stop

void stop()
          throws IOException
Generates the stopping bit-sequence

Throws:
IOException

isIdle

boolean isIdle()
               throws IOException
Check if the connection is idle

Returns:
true if idle
Throws:
IOException

SunSPOT API V3.0


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