This library provides routines for i2c operations.
The library first includes i2cp which contains the IO pin assignment. A local copy of this file can be adapted to accomodate a different IO pin assignment.
The following basic i2c routines are provided which can be used to construct i2c transactions:
procedure i2c_put_start procedure i2c_put_put_read_address( byte in a ) procedure i2c_put_write_address( byte in a ) procedure i2c_put_ack procedure i2c_put_nack procedure i2c_wait_ack procedure i2c_put_byte( byte in d ) procedure i2c_get_byte( byte out d ) procedure i2c_put_stop procedure i2c_put_nack_stop
These routines are not needed when the i2c transaction routines or chip-specific routines are used.
The following i2c transactions are provided:
procedure_i2c_read_1( byte in a, byte out d ) procedure i2c_write_1( byte in a, byte in d ) procedure i2c_read_2( byte in a, byte out d1, byte out d2 ) procedure i2c_write_2( byte in a, byte in d1, byte in d2 )