32.5.3 Peripheral A or B or C or D Selection
The PIO Controller provides multiplexing of up to four peripheral functions on a single pin. The selection is performed by writing the PIO_ABCDSR0 and PIO_ABCDSR1.
For each pin:
- The corresponding bit at level zero in the PIO_ABCDSR0 and the corresponding bit at level zero in the PIO_ABCDSR1 means peripheral A is selected.
- The corresponding bit at level one in the PIO_ABCDSR0 and the corresponding bit at level zero in the PIO_ABCDSR1 means peripheral B is selected.
- The corresponding bit at level zero in the PIO_ABCDSR0 and the corresponding bit at level one in the PIO_ABCDSR1 means peripheral C is selected.
- The corresponding bit at level one in the PIO_ABCDSR0 and the corresponding bit at level one in the PIO_ABCDSR1 means peripheral D is selected.
Multiplexing of peripheral lines A, B, C and D only affects the output line. The peripheral input lines are always connected to the pin input, for additional information, refer to Figure 32-2. “Port n I/O Line Control Logic”.
Writing in the PIO_ABCDSR0 and PIO_ABCDSR1 manages the multiplexing regardless of the configuration of the pin. However, assignment of a pin to a peripheral function requires a write in the PIO_ABCDSR0 and PIO_ABCDSR1 in addition to a write in the PIO_PDR.
After reset, the PIO_ABCDSR0 and PIO_ABCDSR1 are zero, thus indicating that all the PIO lines are configured on peripheral A. However, peripheral A generally does not drive the pin as the PIO Controller resets in I/O Line mode.
If the software selects a peripheral A, B, C or D which does not exist for a pin, no alternate functions are enabled for this pin and the selection is taken into account. The PIO Controller does not carry out checks to prevent selection of a peripheral which does not exist.