17.8.1.3.2 Workflow

  1. Write packet to slave.
    while (i2c_master_write_packet_wait(&i2c_master_instance, &packet) !=
            STATUS_OK) {
        /* Increment timeout counter and check if timed out. */
        if (timeout++ == TIMEOUT) {
            break;
        }
    }
    
    The module will try to send the packet TIMEOUT number of times or until it is successfully sent.
  2. Read packet from slave.
    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;
        }
    }
    
    The module will try to read the packet TIMEOUT number of times or until it is successfully read.