/* Configures one or more pin(s) of a PIO controller as outputs, with the given default value. Optionally, the multi-drive feature can be enabled on the pin(s).  */
static void PIO_SetOutput(AT91S_PIO *pio, unsigned int mask, unsigned char defaultValue, unsigned char enableMultiDrive, unsigned char enablePullUp)
/* Configures one or more pin(s) of a PIO controller as outputs, with the given default value. Optionally, the multi-drive feature can be enabled on the pin(s).  */
static void PIO_SetOutput(AT91S_PIO *pio, unsigned int mask, unsigned char defaultValue, unsigned char enableMultiDrive, unsigned char enablePullUp)
{
    pio->PIO_IDR = mask;
    if (enablePullUp) {
        pio->PIO_PPUER = mask;
    }
    else {
        pio->PIO_PPUDR = mask;
    }
    if (enableMultiDrive) {
        pio->PIO_MDER = mask;
    }
    else {
        pio->PIO_MDDR = mask;
    }
    if (defaultValue) {
        pio->PIO_SODR = mask;
    }
    else {
        pio->PIO_CODR = mask;
    }
    pio->PIO_OER = mask;
    pio->PIO_PER = mask;
}