/* Sends the contents of a data buffer a SSC peripheral, using the PDC. Returns true if the buffer has been queued for transmission; otherwise returns false.  */
unsigned char SSC_WriteBuffer(AT91S_SSC *ssc, void *buffer, unsigned int length)
/* Sends the contents of a data buffer a SSC peripheral, using the PDC. Returns true if the buffer has been queued for transmission; otherwise returns false.  */
unsigned char SSC_WriteBuffer(AT91S_SSC *ssc, void *buffer, unsigned int length)
{
    if (ssc->SSC_TCR == 0) {
        ssc->SSC_TPR = (unsigned int) buffer;
        ssc->SSC_TCR = length;
        ssc->SSC_PTCR = AT91C_PDC_TXTEN;
        return 1;
    }
    else if (ssc->SSC_TNCR == 0) {
        ssc->SSC_TNPR = (unsigned int) buffer;
        ssc->SSC_TNCR = length;
        return 1;
    }
    return 0;
}