SIM_INTERFACE(i2c_bridge) { void (*address_added)(conf_object_t *device, uint32 addr, uint32 mask); void (*address_removed)(conf_object_t *device, uint32 addr, uint32 mask); }; #define I2C_BRIDGE_INTERFACE "i2c_bridge"
This interface is implemented by any device that is registered in an I2C link with the register_bridge function. register_bridge will call address_added, possibly multiple times, to tell the bridge which slave addresses that are currently registered in the link. Until the bridge device disconnects from the link (using disconnect_device), the link will continuously call the functions address_added and address_removed whenever a slave device registers or unregisters from the link. In addition, when an i2c bridge is disconnected from a link, the address_removed function is called for all currently registered slave addresses.
The addr and mask parameters are
interpreted in the same way as in the function
register_slave_address in the i2c_link
interface.
The i2c_bridge
interface is mainly useful when
implementing bridges between I2C links: When a bridge forwards
traffic from one link to another, it needs the information provided
via this interface to correctly forward all relevant traffic
between the links, while avoiding to register twice to the same
address.