/* Configures one or more pin(s) or a PIO controller as inputs. Optionally, the corresponding internal pull-up(s) and glitch filter(s) can be enabled.  */
static void PIO_SetInput(AT91S_PIO *pio, unsigned int mask, unsigned char enablePullUp, unsigned char enableFilter)
/* Configures one or more pin(s) or a PIO controller as inputs. Optionally, the corresponding internal pull-up(s) and glitch filter(s) can be enabled.  */
static void PIO_SetInput(AT91S_PIO *pio, unsigned int mask, unsigned char enablePullUp, unsigned char enableFilter)
{
    WRITE(pio, PIO_IDR, mask);
    if (enablePullUp) {
        WRITE(pio, PIO_PPUER, mask);
    }
    else {
        WRITE(pio, PIO_PPUDR, mask);
    }
    if (enableFilter) {
        WRITE(pio, PIO_IFER, mask);
    }
    else {
        WRITE(pio, PIO_IFDR, mask);
    }
    WRITE(pio, PIO_ODR, mask);
    WRITE(pio, PIO_PER, mask);
}