34.8.5.2.1 Initialization

  1. Select I2C Host or Client mode by writing 0x4 (Client mode) or 0x5 (Host mode) to the Operating Mode bits in the CTRLA register (CTRLA.MODE).
  2. If desired, select the SDA Hold Time value in the CTRLA register (CTRLA.SDAHOLD).
  3. In Client mode, the minimum client setup time for the SDA can be selected in the SDA Setup Time bit group in the Control C register (CTRLC.SDASETUP).
  4. If desired, enable smart operation by setting the Smart Mode Enable bit in the CTRLB register (CTRLB.SMEN).
  5. If desired, enable SCL low time-out by setting the SCL Low Time-Out bit in the Control A register (CTRLA.LOWTOUT).
  6. In Host mode:
    1. Select the inactive bus time-out in the Inactive Time-Out bit group in the CTRLA register (CTRLA.INACTOUT).
    2. Write the Baud Rate register (BAUD) to generate the desired baud rate.
  7. In Client mode:
    1. Configure the address match configuration by writing the Address Mode value in the CTRLB register (CTRLB.AMODE).
    2. Set the Address and Address Mask value in the Address register (ADDR.ADDR and ADDR.ADDRMASK) according to the address configuration.