};typedefstructi2c_slavei2c_slave;/* Master to slave. */typedefint(*i2c_send_cb)(i2c_slave*s,uint8_tdata);/* Slave to master. */typedefint(*i2c_recv_cb)(i2c_slave*s);/* Notify the slave of a bus state change. */typedefvoid(*i2c_event_cb)(i2c_slave*s,enumi2c_eventevent);structi2c_slave{/* Callbacks to be set by the device. */i2c_event_cbevent;i2c_recv_cbrecv;i2c_send_cbsend;/* Remaining fields for internal use by the I2C code. */intaddress;void*next;};typedefstructi2c_busi2c_bus;i2c_bus*i2c_init_bus(void);i2c_slave*i2c_slave_init(i2c_bus*bus,intaddress,intsize);voidi2c_set_slave_address(i2c_slave*dev,intaddress);inti2c_bus_busy(i2c_bus*bus);inti2c_start_transfer(i2c_bus*bus,intaddress,intrecv);voidi2c_end_transfer(i2c_bus*bus);voidi2c_nack(i2c_bus*bus);inti2c_send(i2c_bus*bus,uint8_tdata);inti2c_recv(i2c_bus*bus);