/* 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)
{
    WRITE(pio, PIO_IDR, mask);
    if (enablePullUp) {
        WRITE(pio, PIO_PPUER, mask);
    }
    else {
        WRITE(pio, PIO_PPUDR, mask);
    }
    if (enableMultiDrive) {
        WRITE(pio, PIO_MDER, mask);
    }
    else {
        WRITE(pio, PIO_MDDR, mask);
    }
    if (defaultValue) {
        WRITE(pio, PIO_SODR, mask);
    }
    else {
        WRITE(pio, PIO_CODR, mask);
    }
    WRITE(pio, PIO_OER, mask);
    WRITE(pio, PIO_PER, mask);
}