[Tinyos-2-commits] CVS: tinyos-2.x/tos/interfaces I2CPacket.nc,
1.1.2.4, 1.1.2.5
Philip Buonadonna
philipb at users.sourceforge.net
Thu Jun 1 18:04:48 PDT 2006
Update of /cvsroot/tinyos/tinyos-2.x/tos/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv15074/interfaces
Modified Files:
Tag: tinyos-2_0_devel-BRANCH
I2CPacket.nc
Log Message:
- Added type to interface to determine address size.
- Remove 10BIT_ADDR flag.
- Modified names of other flags.
Index: I2CPacket.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/interfaces/Attic/I2CPacket.nc,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -C2 -d -r1.1.2.4 -r1.1.2.5
*** I2CPacket.nc 26 May 2006 00:39:55 -0000 1.1.2.4
--- I2CPacket.nc 2 Jun 2006 01:04:44 -0000 1.1.2.5
***************
*** 28,63 ****
* and provides for multiple repeated STARTs and multiple reads/writes
* within the same START transaction.
*
* @author Joe Polastre
* @author Phil Buonadonna <pbuonadonna at archrock.com>
* Revision: $Revision$
*/
! interface I2CPacket {
/**
* Perform an I2C read operation
*
- * @param addr The slave device address
- * @param length Length, in bytes, to be read
- * @param data A point to a data buffer to read into
* @param flags Flags that may be logical ORed and defined by:
! * START_FLAG - The START condition is transmitted at the beginning
* of the packet if set.
! * STOP_FLAG - The STOP condition is transmitted at the end of the
* packet if set.
! * ACK_END_FLAG - ACK the last byte if set. Otherwise NACK last byte. This
* flag cannot be used with the STOP_FLAG.
! * ADDR10_FLAG - Slave device address is 10-bit if set. 7-bit if not set.
*
* @return SUCCESS if bus available and request accepted.
*/
! async command error_t read(uint16_t addr, uint8_t length, uint8_t* data, i2c_flags_t flags);
/**
* Perform an I2C write operation
*
- * @param addr The slave device address
- * @param length Length, in bytes, to be read
- * @param data A point to a data buffer to read into
* @param flags Flags that may be logical ORed and defined by:
* START_FLAG - The START condition is transmitted at the beginning
--- 28,69 ----
* and provides for multiple repeated STARTs and multiple reads/writes
* within the same START transaction.
+ * The interface is typed according to the address size supported by
+ * the master hardware. Masters capable of supporting extended (10-bit)
+ * I2C addressing MUST export both types. Applications should use the
+ * smallest address size to ensure best portability.
+ *
+ * @param addr_size A type indicating the slave address size. Supported
+ * values are TI2CExtdAddr (for 10-bit addressing) and TI2CBasicAddr (7-bit
+ * addressing).
*
* @author Joe Polastre
* @author Phil Buonadonna <pbuonadonna at archrock.com>
+ * @author Jonathan Hui <jhui at archrock.com>
+ * @author Phil Levis <pal at cs.stanford.edu>
* Revision: $Revision$
*/
! interface I2CPacket<addr_size> {
/**
* Perform an I2C read operation
*
* @param flags Flags that may be logical ORed and defined by:
! * I2C_START - The START condition is transmitted at the beginning
* of the packet if set.
! * I2C_STOP - The STOP condition is transmitted at the end of the
* packet if set.
! * I2C_ACK_END - ACK the last byte if set. Otherwise NACK last byte. This
* flag cannot be used with the STOP_FLAG.
! * @param addr The slave device address. Only used if I2C_START is set.
! * @param length Length, in bytes, to be read
! * @param data A point to a data buffer to read into
*
* @return SUCCESS if bus available and request accepted.
*/
! async command error_t read(i2c_flags_t flags, uint16_t addr, uint8_t length, uint8_t* data);
/**
* Perform an I2C write operation
*
* @param flags Flags that may be logical ORed and defined by:
* START_FLAG - The START condition is transmitted at the beginning
***************
*** 65,73 ****
* STOP_FLAG - The STOP condition is transmitted at the end of the
* packet if set.
! * ADDR10_FLAG - Slave device address is 10-bit if set. 7-bit if not set.
*
* @return SUCCESS if bus available and request accepted.
*/
! async command error_t write(uint16_t addr, uint8_t length, uint8_t* data, i2c_flags_t flags);
/**
--- 71,81 ----
* STOP_FLAG - The STOP condition is transmitted at the end of the
* packet if set.
! * @param addr The slave device address. Only used if I2C_START is set.
! * @param length Length, in bytes, to be read
! * @param data A point to a data buffer to read into
*
* @return SUCCESS if bus available and request accepted.
*/
! async command error_t write(i2c_flags_t flags, uint16_t addr, uint8_t length, uint8_t* data);
/**
***************
*** 79,83 ****
* @param success SUCCESS if transfer completed without error.
*/
! async event void readDone(uint16_t addr, uint8_t length, uint8_t* data, error_t success);
/**
--- 87,91 ----
* @param success SUCCESS if transfer completed without error.
*/
! async event void readDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data);
/**
***************
*** 89,92 ****
* @param success SUCCESS if transfer completed without error.
*/
! async event void writeDone(uint16_t addr, uint8_t length, uint8_t* data, error_t success);
}
--- 97,100 ----
* @param success SUCCESS if transfer completed without error.
*/
! async event void writeDone(error_t error, uint16_t addr, uint8_t length, uint8_t* data);
}
More information about the Tinyos-2-commits
mailing list