发 帖  
原厂入驻New
[问答] CC1350 ADCBU求助
182 CC1350
分享
cc1350使用adcbuf例程进行多通道采集,只能读取到一路数据,提问ti论坛,告知要使用不同的samplebuf并且要停掉一路channel,启用一路,每台听懂,有大佬告知么,我将我的代码贴到下方,具体该如何操作
    UART_Params uartParams;
    ADCBuf_Handle adcBuf;
    ADCBuf_Params adcBufParams;
    ADCBuf_Conversion continuousConversion[4];
    /* Call driver init functions */
    ADCBuf_init();
    UART_init();
    /* Create a UART with data processing off. */
    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.writeMode = UART_MODE_CALLBACK;
    uartParams.writeCallback = uartCallback;
    uartParams.baudRate = 115200;
    uart = UART_open(Board_UART0, &uartParams);
    /* Set up an ADCBuf peripheral in ADCBuf_RECURRENCE_MODE_CONTINUOUS */
    ADCBuf_Params_init(&adcBufParams);
    adcBufParams.callbackFxn = adcBufCallback;
    adcBufParams.recurrenceMode = ADCBuf_RECURRENCE_MODE_CONTINUOUS;
    adcBufParams.returnMode = ADCBuf_RETURN_MODE_CALLBACK;
    adcBufParams.samplingFrequency = 200;
    adcBuf = ADCBuf_open(Board_ADCBUF0, &adcBufParams);
    /* Configure the conversion struct */
    continuousConversion[0].arg = NULL;
    continuousConversion[0].adcChannel = 2;
    continuousConversion[0].sampleBuffer = sampleBufferOne;
    continuousConversion[0].sampleBufferTwo = sampleBufferTwo;
    continuousConversion[0].samplesRequestedCount = ADCBUFFERSIZE/4;
    continuousConversion[1].arg = NULL;
    continuousConversion[1].adcChannel = 3;
    continuousConversion[1].sampleBuffer = sampleBufferOne2;
    continuousConversion[1].sampleBufferTwo = sampleBufferTwo2;
    continuousConversion[1].samplesRequestedCount = ADCBUFFERSIZE/4;

    continuousConversion[2].arg = NULL;
    continuousConversion[2].adcChannel = 4;
    continuousConversion[2].sampleBuffer = sampleBufferOne3;
    continuousConversion[2].sampleBufferTwo = sampleBufferTwo3;
    continuousConversion[2].samplesRequestedCount = ADCBUFFERSIZE/4;

    continuousConversion[3].arg = NULL;
    continuousConversion[3].adcChannel = 5;
    continuousConversion[3].sampleBuffer = sampleBufferOne4;
    continuousConversion[3].sampleBufferTwo = sampleBufferTwo4;
    continuousConversion[3].samplesRequestedCount = ADCBUFFERSIZE/4;

    IF (adcBuf == NULL){
        /* ADCBuf faiLED to open. */
        while(1);
    }
    /* Start converting. */
    if (ADCBuf_convert(adcBuf, continuousConversion, 4) !=
        ADCBuf_STATUS_SUCCESS) {
        /* Did not start conversion process correctly. */
        while(1);
    }


0
2020-7-29 13:02:46   评论 分享淘帖 邀请回答

撰写答案

你正在撰写答案

如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。

高级模式
您需要登录后才可以回帖 登录 | 注册

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容图片侵权或者其他问题,请联系本站作侵删。 侵权投诉
我要提问
关闭

站长推荐 上一条 /7 下一条

快速回复 返回顶部 返回列表