[ADC]Linux ADC驱动

ADC

TI adc user guide: http://processors.wiki.ti.com/index.php/Linux_Core_ADC_Users_Guide

问题

  • 在tools/iio/generic_buffer.c中open的设备并不是/sys/bus/iio/devices/iio:device0,当然程序中length/enable的一些操作路径都是/sys/bus/iio/devices/....而是/dev/iio:devicex 在SBCC板子的/dev下好像并没有发现这个设备。
  • 且如果把generic_buffer.c作为应用测试程序,那么main里用到的write_sysfs_int接口在应用层是否可用?理论上是可以的,因为该函数的调用是在main中,不在应用层这个main就没有意义了. write_sysfs_int是User层的API:http://www.bozhiyue.com/anroid/wenzhang/2016/0809/349146.html

在adc驱动中iio_info这个结构体很重要,其中的成员变量:.read_raw = &at91_adc_read_raw应该就是暴露的接口

Beaglebone使用c/c++编程示例:http://derekmolloy.ie/beaglebone/setting-up-eclipse-on-the-beaglebone-for-c-development/

原文地址:https://www.cnblogs.com/aaronLinux/p/6664994.html