1.1.2.4.2 DRV_I2C_Status Function

C

SYS_STATUS DRV_I2C_Status( const SYS_MODULE_OBJ object)

Summary

Gets the current status of the I2C driver module.

Description

This routine provides the current status of the I2C driver module.

Precondition

Function DRV_I2C_Initialize should have been called before calling this function.

Parameters

ParamDescription
objectDriver object handle, returned from the DRV_I2C_Initialize routine

Returns

SYS_STATUS_READY - Initialization has succeeded and the I2C is ready for additional operations.

SYS_STATUS_UNINITIALIZED - Indicates that the driver is not initialized.

Example

SYS_MODULE_OBJ object; // Returned from DRV_I2C_Initialize
SYS_STATUS i2cStatus;

i2cStatus = DRV_I2C_Status(object);

if (i2cStatus == SYS_STATUS_READY)
{
    // This means the driver can be opened using the
    // DRV_I2C_Open() function.
}

Remarks

A driver can be opened only when its status is SYS_STATUS_READY.