SIM_INTERFACE(i2c_device) {
int (*set_state)(conf_object_t *device, i2c_device_state_t state,
uint8 address);
uint8 (*read_data)(conf_object_t *device);
void (*write_data)(conf_object_t *device, uint8 value);
};
#define I2C_DEVICE_INTERFACE "i2c_device"
The i2c_device interface is implemented by I2C
devices. The set_state function is used to change the
state of the I2C device. The I2C device accepts the state change by
returning 0. The I2C device must accept calls to
read_data when its state is
I2C_slave_transmit and calls to
write_data when its state is
I2C_slave_receive. See the description for the
i2c_bus interface for more information how to use
this interface.