我按照以下连接的例程,基于Project_zero做了一个ADCBUF的demo
file:///home/rose/ti/simplelink_cc13x2_26x2_sdk_4_20_01_04/docs/tidrivers/doxygen/html/_a_d_c_buf_8h.html
// Import ADCBuf Driver definitions #include <ti/drivers/ADCBuf.h> // Define name for ADCBuf channel index #define PIEZOMETER_OUT0 // Create buffer for samples #define ADCBUFFERSIZE10 uint16_t buffer[ADCBUFFERSIZE]; uint32_t microvoltBuffer[ADCBUFFERSIZE]; // One time init of ADCBuf driver ADCBuf_Handle adcBuf; void blower_adc_init() {ADCBuf_init();// Initialize optional ADCBuf parametersADCBuf_Params params;ADCBuf_Params_init(¶ms);params.returnMode = ADCBuf_RETURN_MODE_BLOCKING;params.recurrenceMode = ADCBuf_RECURRENCE_MODE_ONE_SHOT;// Open ADCBuf driveradcBuf = ADCBuf_open(0, ¶ms);// Setup conversion structureADCBuf_Conversion conversion = {0};conversion.samplesRequestedCount = ADCBUFFERSIZE;conversion.sampleBuffer = buffer;conversion.adcChannel = PIEZOMETER_OUT;// Start ADCBuf conversionADCBuf_convert(adcBuf, &conversion, 1);// Adjust raw ADC values and convert them to microvoltsADCBuf_adjustRawValues(adcBuf, buffer, ADCBUFFERSIZE, PIEZOMETER_OUT);ADCBuf_convertAdjustedToMicroVolts(adcBuf, PIEZOMETER_OUT, buffer,microvoltBuffer, ADCBUFFERSIZE);// Close ADCBuf driverADCBuf_close(adcBuf); }
他总是会出错:
unresolved symbol ADCBuf_config, first referenced in /home/rose/ti/simplelink_cc13x2_26x2_sdk_4_20_01_04/source/ti/drivers/lib/drivers_cc26x2.aem4f<ADCBuf.oem4f>
unresolved symbol ADCBuf_count, first referenced in /home/rose/ti/simplelink_cc13x2_26x2_sdk_4_20_01_04/source/ti/drivers/lib/drivers_cc26x2.aem4f<ADCBuf.oem4f>
但我不明白这错误从何而来,我只是基于Project_zero基础上添加了上述代码而已
Kevin Qiu1:
显示配置不对,ADCbuf参考下这个例程:C:\ti\simplelink_cc13x2_26x2_sdk_4_20_00_35\examples\rtos\CC26X2R1_LAUNCHXL\drivers\adcbufcontinuous
user6359397:
回复 Kevin Qiu1:
不是例程的问题,我的配置是没有问题的,我已经验证过它能正常运行,由于项目的出发点是Project_zero,所以很疑惑为什么在Project_zero上无法运行
Kevin Qiu1:
回复 user6359397:
我说的配置是你移植的问题,移植正确都可以正常运行,你需要参考例程将ADCbuf移植到Project_zero中