This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] ADS1015-Q1:ADS1015 -创建缓冲器时出现 Linux/libiio 问题

Guru**** 2516170 points
Other Parts Discussed in Thread: ADS1015

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/data-converters-group/data-converters/f/data-converters-forum/917114/ads1015-q1-ads1015---linux-libiio-issue-while-creating-buffer

器件型号:ADS1015-Q1
主题中讨论的其他器件:ADS1015

您好!

使用 libiio 读取 ADS1015时遇到问题。

我可以访问上下文和器件。 我甚至可以启用所需的通道、但当我运行函数来创建缓冲区   ICO_DEVICE_CREATE 缓冲区时 、我始终得到一个空值。

它显示 errno 22:  参数无效

我使用此函数(ICO_CHANNEL_IS_SCAN_ELEMENT)来确保通道具有缓冲能力。

IIO_INFO 输出:  

IIO:device2:ADS1015
找到9个通道:
voltage0-voltage1:(输入,索引:0,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:比例值:3.000000000
属性1:原始值:0
属性2:SAMPLING_FREQUENCY 值:128
voltage0-voltage3:(输入,索引:1,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:原始值:0
属性1:比例值:3.000000000
属性2:SAMPLING_FREQUENCY 值:128
voltage1-voltage3:(输入,索引:2,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:原始值:0
属性1:比例值:3.000000000
属性2:SAMPLING_FREQUENCY 值:128
voltage2-voltage3:(输入,索引:3,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:比例值:3.000000000
属性1:原始值:0
属性2:SAMPLING_FREQUENCY 值:128
voltage0:(输入,索引:4,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:比例值:2.000000000
属性1:原始值:0
属性2:SAMPLING_FREQUENCY 值:3300
voltage1:(输入,索引:5,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:SAMPLING_FREQUENCY 值:3300
属性1:比例值:2.000000000
属性2:原始值:0
voltage2:(输入,索引:6,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:比例值:2.000000000
属性1:SAMPLING_FREQUENCY 值:3300
属性2:原始值:0
voltage3:(输入,索引:7,格式:LE:s-12/16->4)
找到3个通道特定属性:
属性0:比例值:2.000000000
属性1:原始值:0
属性2:SAMPLING_FREQUENCY 值:3300
时间戳:(输入,索引:8,格式:LE:s-64/64->0)

代码:  

NT main (){

struct iop_context* ctx = iop_create_local_context ();
if (!ctx){
log (error)<<"No context found";
return;
}

struct IIO_device * dev = IIO_context_find_device (ctx、deviceName.c_str ());
if (!




struct IIO_device *=

0);if (not found);instructure I return = 4);if (not channel_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_int_ i++){
voltage[i]= ICO_DEVICE_GET_CHANNEL (dev、i+4);
log (info)<<" Channel found:"<< ICO_CHANNEL_GET_id (voltage[i]);
}

if (!voltage[0]|||int voltage [1]||!chine_voltage[2]|| voltage[3](voltage[3]);<





I sple return)

<!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! i++){
if (io_channel_is_scan_element (voltage[i])}{
io_channel_enable (voltage[i]);
if (io_channel_is_enabled (voltage[i])) log (info)<< Channel enable:"<< io_channel_get_id (voltage [i]);if (volt_sample_sage





)<

context、device_sample_sample_sage =<_device_sample_sumptc)<"< context、device_s/simumplime_se_se_se_se_se_se_s/simumplimumb <"<"<?se_se_se_se_se_se_se_s/simumplimumplimumple_se_se_s/simumplimumb (<"

如果(!buffer){
log (error)<< Error creating buffer "<< errno;
delete[] voltage;
return;
}

} 

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    豪尔赫、


    很抱歉、我们没有专业知识来支持您的问题。

    虽然我们可以在网站上添加 Linux 驱动程序的链接、但我们没有创建该驱动程序本身。 请与 Linux 社区联系、了解他们是否可以帮助解决此无效参数错误。


    吴约瑟