Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The function I2C_ReadByte reads one byte from an i2c-device.

int I2C_ReadByte(      
  UCHAR uSlaveAddress, 
  UCHAR* pBuffer
); 
int i2c_GetByte(      
  UCHAR uSlaveAddress, 
  UCHAR* pBuffer
); 

Parameters

uSlaveAddress
Slave-Address of the i2c-device.

pBuffer
Buffer to receive the byte read.

Return Values

If the function succeeds, the return value is 0.

If the function fails, the return value is -1.

Remarks

Issues following sequence:

  1. Lock

  2. Start

  3. SlaveAddress with read-bit

  4. Read one byte

  5. Stop

  6. Unlock

This function calls I2C_Lock and I2C_Unlock to prevent multiple accesses to the i2c-bus. Don't lock access to i2c-bus prior to using this function!!

Requirements

OS Versions: Windows CE 4.2 and later.
Header: drvlib_app.h
Link Library: drvlib_app.lib

See Also

I2C_Read, I2C_ReadBurst, I2C_ReadBurstAll

  • No labels