solettaproject / soletta

Soletta Project is a framework for making IoT devices. With Soletta Project's libraries developers can easily write software for devices that control actuators/sensors and communicate using standard technologies. It enables adding smartness even on the smallest edge devices.
http://solettaproject.org
Apache License 2.0
227 stars 109 forks source link

iio: support oversampling_ratio configuration in iio node #2330

Open laykuanloon opened 7 years ago

laykuanloon commented 7 years ago

@peijiajames

BMP280 iio driver contains "oversampling_ratio", can support the configuration from iio node ? For e.g: by setting "oversampling_ration" in json file.


What: /sys/bus/iio/devices/iio:deviceX/in_magn_x_oversampling_ratio What: /sys/bus/iio/devices/iio:deviceX/in_magn_y_oversampling_ratio What: /sys/bus/iio/devices/iio:deviceX/in_magn_z_oversampling_ratio KernelVersion: 4.2 Contact: linux-iio@vger.kernel.org Description: Hardware applied number of measurements for acquiring one data point. The HW will do [_name]_oversampling_ratio measurements and return the average value as output data. Each value resulted from [_name]_oversampling_ratio measurements is considered as one sample for [_name]_sampling_frequency.

@elvinongbl FYI

joyceooi295 commented 7 years ago

@edersondisouza @ceolin @bdilly @barbieri Please help

peijiajames commented 7 years ago

@guchaojie is working on this already. @guchaojie please comment with the implementation.

guchaojie commented 7 years ago

@joyceooi295 We would add this attribute into json file for user to set in iio node just like other attribute support method

yongli3 commented 7 years ago

@laykuanloon @peijiajames @guchaojie Based on kernel commit id 62979904b0037430ecc7d8b682f684adced1340f. It seems to me that only kernel 4.8+ supports this "oversampling" feature for BMP280