/* Configures one or more pin(s) of a PIO controller as being controlled by peripheral A. Optionally, the corresponding internal pull-up(s) can be enabled.  */
static void PIO_SetPeripheralA(AT91S_PIO *pio, unsigned int mask, unsigned char enablePullUp)
/* Configures one or more pin(s) of a PIO controller as being controlled by peripheral A. Optionally, the corresponding internal pull-up(s) can be enabled.  */
static void PIO_SetPeripheralA(AT91S_PIO *pio, unsigned int mask, unsigned char enablePullUp)
{
    WRITE(pio, PIO_IDR, mask);
    if (enablePullUp) {
        WRITE(pio, PIO_PPUER, mask);
    }
    else {
        WRITE(pio, PIO_PPUDR, mask);
    }
    WRITE(pio, PIO_ASR, mask);
    WRITE(pio, PIO_PDR, mask);
}