1

在为具有 LED 电流调节器的接近和光度传感半导体实现 linux 内核驱动程序时,允许针对环境光干扰调整距离测量的有效性,希望支持 read_raw/write_raw 方法以能够获取/设置电流调节器值。通道类型设置为IIO_PROXIMITY现在。定义 LED 电流的适当方法是什么:通过通道信息枚举申请此类设置?可用的选择是:

enum iio_chan_info_enum {
    IIO_CHAN_INFO_RAW = 0,
    IIO_CHAN_INFO_PROCESSED,
    IIO_CHAN_INFO_SCALE,
    IIO_CHAN_INFO_OFFSET,
    IIO_CHAN_INFO_CALIBSCALE,
    IIO_CHAN_INFO_CALIBBIAS,
    IIO_CHAN_INFO_PEAK,
    IIO_CHAN_INFO_PEAK_SCALE,
    IIO_CHAN_INFO_QUADRATURE_CORRECTION_RAW,
    IIO_CHAN_INFO_AVERAGE_RAW,
    IIO_CHAN_INFO_LOW_PASS_FILTER_3DB_FREQUENCY,
    IIO_CHAN_INFO_HIGH_PASS_FILTER_3DB_FREQUENCY,
    IIO_CHAN_INFO_SAMP_FREQ,
    IIO_CHAN_INFO_FREQUENCY,
    IIO_CHAN_INFO_PHASE,
    IIO_CHAN_INFO_HARDWAREGAIN,
    IIO_CHAN_INFO_HYSTERESIS,
    IIO_CHAN_INFO_INT_TIME,
    IIO_CHAN_INFO_ENABLE,
    IIO_CHAN_INFO_CALIBHEIGHT,
    IIO_CHAN_INFO_CALIBWEIGHT,
    IIO_CHAN_INFO_DEBOUNCE_COUNT,
    IIO_CHAN_INFO_DEBOUNCE_TIME,
    IIO_CHAN_INFO_CALIBEMISSIVITY,
    IIO_CHAN_INFO_OVERSAMPLING_RATIO,
};

IIO_CHAN_INFO_HARDWAREGAIN一个吗?或者最好从以下选项中定义一个单独的 LED 电流通道类型:

enum iio_chan_type { IIO_VOLTAGE, IIO_CURRENT, IIO_POWER, IIO_ACCEL, IIO_ANGL_VEL, IIO_MAGN, IIO_LIGHT, IIO_INTENSITY, IIO_PROXIMITY, IIO_TEMP, IIO_INCLI, IIO_ROT, IIO_ANGL, IIO_TIMESTAMP, IIO_CAPACITANCE, IIO_ALTVOLTAGE, IIO_CCT, IIO_PRESSURE, IIO_HUMIDITYRELATIVE, IIO_ACTIVITY, IIO_STEPS, IIO_ENERGY, IIO_DISTANCE, IIO_VELOCITY, IIO_CONCENTRATION, IIO_RESISTANCE, }; 同时使用IIO_CURRENT一个类型然后使用IIO_CHAN_INFO_RAW信息?

4

0 回答 0