17.8.1.3.2 Workflow
- Write packet to slave.
The module will try to send the packet TIMEOUT number of times or until it is successfully sent.while
(i2c_master_write_packet_wait(&i2c_master_instance, &packet) !=
STATUS_OK) {
/* Increment timeout counter and check if timed out. */
if
(timeout++ == TIMEOUT) {
break
;
}
}
- Read packet from slave.
The module will try to read the packet TIMEOUT number of times or until it is successfully read.packet.data = read_buffer;
while
(i2c_master_read_packet_wait(&i2c_master_instance, &packet) !=
STATUS_OK) {
/* Increment timeout counter and check if timed out. */
if
(timeout++ == TIMEOUT) {
break
;
}
}