3.1.2 PDMIC I/O Pin Initialization

PIO pins PB26 and PB27, with their peripheral function D, will be assigned to the PDMIC interface. The code snippet given below will initialize the I/O pins accordingly.

/* Set PORTB mask register bit 26 */
PIOA->PIO_IO_GROUP[1].PIO_MSKR = (1u << 26);

/* Enable peripheral function D and set I/O pin as input */
PIOA->PIO_IO_GROUP[1].PIO_CFGR = PIO_CFGR_FUNC_PERIPH_D | PIO_CFGR_DIR_INPUT;

/* Set PORTB mask register bit 27 */
PIOA->PIO_IO_GROUP[1].PIO_MSKR = (1u << 27);

/* Enable peripheral function D and set I/O pin as output */    
PIOA->PIO_IO_GROUP[1].PIO_CFGR = PIO_CFGR_FUNC_PERIPH_D | PIO_CFGR_DIR_OUTPUT;