sub_bb_i2c_config

Top  Previous  Next
Got to SUB-20 page

Synopsis

int sub_bb_i2c_config( sub_handle hndl, int mode, int stretch_ms )

 

Configure SUB-20 Bit-bang I2C Masters module. Configuration is common for all Bit-bang I2C channels.

Parameters

mode - Bit-bang I2C Master mode. One of the following flags:

BB_I2C_FAST_P

Fast Plus mode 1000KHz

BB_I2C_FAST

Fast mode 400KHz

BB_I2C_STD

Standard mode 100KHz

 

stretch_ms - Clock stretching timeout up to 4194ms. Clock stretching feature is available in Fast and Standard modes. If SCL line is hold LOW by I2C slave device longer than stretch_ms timeout, Bit-bang I2C function will fail and I2C Status will be set to 0xE0.  

Return Value

On success function returns 0. Otherwise error code.

Compatibility

FW version

0.2.6 or grater

Library version

0.1.12.16 or grater