/* 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)
{
    pio->PIO_IDR = mask;
    if (enablePullUp) {
        pio->PIO_PPUER = mask;
    }
    else {
        pio->PIO_PPUDR = mask;
    }
    if (enableFilter) {
        pio->PIO_IFER = mask;
    }
    else {
        pio->PIO_IFDR = mask;
    }
    pio->PIO_ODR = mask;
    pio->PIO_PER = mask;
}