— Data Receive with the PDC in Client Mode

The following procedure shows an example to transmit data with PDC where the number of characters to receive is known.

  1. Initialize the receive PDC (memory pointers, transfer size).
  2. Set the PDC RXTEN bit.
  3. Wait for the PDC ENDRX flag by using either the polling method or the ENDRX interrupt.
  4. Disable the PDC by setting the PDC RXTDIS bit.
  5. (Optional) Wait for the FLEX_TWI_SR.TXCOMP flag before disabling the peripheral clock if required.