/* Gets the captured data for a sample sequence. */
long ADCSequenceDataGet(unsigned long ulBase, unsigned long ulSequenceNum, unsigned long *pulBuffer)
/* Gets the captured data for a sample sequence. */
long ADCSequenceDataGet(unsigned long ulBase, unsigned long ulSequenceNum, unsigned long *pulBuffer)
{
    unsigned long ulCount;
    ASSERT((ulBase == ADC0_BASE) || (ulBase == ADC1_BASE));
    ASSERT(ulSequenceNum < 4);
    ulBase += ADC_SEQ + (ADC_SEQ_STEP * ulSequenceNum);
    ulCount = 0;
    while(!(HWREG(ulBase + ADC_SSFSTAT) & ADC_SSFSTAT0_EMPTY) && (ulCount < 8))
    {
        *pulBuffer++ = HWREG(ulBase + ADC_SSFIFO);
        ulCount++;
    }
    return(ulCount);
}