Tool/software: TI-RTOS
Hi friends,
I am trying to enable and read multiple adc channel through a single trigger. I was referring to the example provided with SDK "simplelink_msp432e4_sdk_2_40_00_11", adcbufmultichannel_MSP_EXP432E401Y_tirtos_ccs.
Kindly forward this query to respective forum if this is not the correct place.
I would like to know about the following queries
1. Should each channel which is configured should have separate Sample buffer or the same sample buffer for all ?
2. In the example the second channel doesnot have any sample buffer specified. Why so ?
3. Will there be multiple callback after reading ADC for each channel or it will be a single callback for every channel, when buffer is full ?
4. If it is a single callback for all channels together, how will i identify each channel data from "completedADCBuffer" (pointer) ?
Thanking everyone in advance for your guidance.
Code Snippet:
/* Configure the conversion struct for two channels on same sequencer */
continuousConversion[0].arg = NULL;
continuousConversion[0].adcChannel = Board_ADCBUF0CHANNEL0;
continuousConversion[0].sampleBuffer = sampleBufferOne;
continuousConversion[0].sampleBufferTwo = sampleBufferTwo;
continuousConversion[0].samplesRequestedCount = ADCBUFFERSIZE;
continuousConversion[1].arg = NULL;
continuousConversion[1].adcChannel = Board_ADCBUF0CHANNEL4;
continuousConversion[1].sampleBuffer = NULL;
continuousConversion[1].sampleBufferTwo = NULL;
continuousConversion[1].samplesRequestedCount = ADCBUFFERSIZE;
/***************** This is the callaback function ***********************************************/
void adcBufCallback(ADCBuf_Handle handle, ADCBuf_Conversion *conversion,
void *completedADCBuffer, uint32_t completedChannel) {
uint_fast16_t i;
uint16_t *completedBuffer = (uint16_t *) completedADCBuffer; //how to differentiate different channel data
for (i = 0; i < ADCBUFFERSIZE; i++) {
outputBuffer[i] = completedBuffer[i];
}
/* post adcbuf semaphore */
sem_post(&adcbufSem);
}
With regards
Dennis