I2C Library Description


The I2C Library is a C interface library that may be used on the DS80C400. It provides a simple interface to allow communication with I2C devices using any two port pins on the CPU. The library also allows the use of SCL flow control.
The library defaults to using no clock delay (as fast as the CPU can clock), no SCL flow control, and SDA=P3.4 SCL=P3.5. If these settings do not match the user application, they may be modified. Three items may be tuned to the specific end user application, and all are defined in tini_i2c.h.

1. Modify I2C_SCL and I2C_SDA to the desired port pins
2. If SCL flow control is required, modify the define to read:
      #define I2C_ENABLE_SCL_WAIT_FOR_SLOW_SLAVES 1
3. Set the desired delay between SCL/SDA edges by modifying the the define I2C_DELAY_LOOP_COUNT to a value between 0 and 32767.

Once the settings are made, the library must be rebuilt in order for the settings to take effect.


I2C Library Sample Applications

The I2C sample application uses all available library functions to write and read a DS1672 Real Time Clock.

Download


Back to C Library Project Homepage