Hi,
The LPC55ss ADC support command chain, each command register includes the ADC channel, and Next Command bit field which point to next command.
In the first command, you can define the ADC channel, in the next command bit field, you can set up the chained command index. In the chained command, you can define the second ADC channel and secondly chained next-command. In the secondly-chained command register, you can define the third ADC analog channel, if this is the last channel, set the third-chained next-command bits as 0, which means chaining ends up.
The following is the command chain, hope it can help you.
lpadc_conv_command_config_t mLpadcCommandConfigStruct0,mLpadcCommandConfigStruct1,mLpadcCommandConfigStruct2;
LPADC_GetDefaultConvCommandConfig(&mLpadcCommandConfigStruct0);
mLpadcCommandConfigStruct0.channelNumber = DEMO_LPADC_USER_CHANNEL; //adc channel0
mLpadcCommandConfigStruct0.chainedNextCommandNumber=DEMO_LPADC_USER_CMDID2;
LPADC_SetConvCommandConfig(DEMO_LPADC_BASE, DEMO_LPADC_USER_CMDID1, &mLpadcCommandConfigStruct0);
///////////////Rong added another adc channel
LPADC_GetDefaultConvCommandConfig(&mLpadcCommandConfigStruct1);
mLpadcCommandConfigStruct1.channelNumber = DEMO_LPADC_USER_CHANNEL+1; //DEMO_LPADC_USER_CHANNEL+1=1, adc channel1
mLpadcCommandConfigStruct1.chainedNextCommandNumber=DEMO_LPADC_USER_CMDID3;
LPADC_SetConvCommandConfig(DEMO_LPADC_BASE, DEMO_LPADC_USER_CMDID2, &mLpadcCommandConfigStruct1);
LPADC_GetDefaultConvCommandConfig(&mLpadcCommandConfigStruct2);
mLpadcCommandConfigStruct2.channelNumber = DEMO_LPADC_USER_CHANNEL+2; //DEMO_LPADC_USER_CHANNEL+1=1, adc channel1
mLpadcCommandConfigStruct2.chainedNextCommandNumber=0;
LPADC_SetConvCommandConfig(DEMO_LPADC_BASE, DEMO_LPADC_USER_CMDID3, &mLpadcCommandConfigStruct2);
hope it can help you.
BR
XiangJun Rong