modelica-3rdparty / Modelica_DeviceDrivers

Free library for interfacing hardware drivers to Modelica models. There is support for joysticks, keyboards, UDP, TCP/IP, LCM, MQTT, shared memory, AD/DA converters, serial port and other devices.
BSD 3-Clause "New" or "Revised" License
77 stars 31 forks source link

Add libiio support #366

Open m-kormann opened 1 year ago

m-kormann commented 1 year ago

Industrial I/O (https://wiki.analog.com/software/linux/docs/iio/iio) is a protocol to communicate with integrated devices.

This implementation allows to read sensor data from IIO devices locally or over network.

bernhard-thiele commented 1 year ago

@m-kormann Thanks for offering this PR!

I have no experience with IIO and I will need to get my head around it first. Next days are pretty filled up, so please bear with me if it takes some time.

Seems IIO does similar things like Comedi. From the example, I understand that IIO can be used out-of-the-box on Pinephone and Raspberry Pi. Maybe you could drop a few lines about your motivation for using IIO and how it is positioned to Comedi?

m-kormann commented 1 year ago

You are very welcome!

This example emerged from personal interest when I found that the data of the phone's gyroscope can be sent over network. This opens a lot of applications to real-time models.

From my understanding, Comedi is an interface to measurement with the help of certain hardware (even Soundcards) to measure voltages. It is restricted to the list of drivers available for the certain measurement hardware.

IIO is a layer above the I2C-Bus, which communicates with I/O hardware. As many arduino expansion boards (i.e. gyroscopes, magnetometers, proximity sensors) use I2C, a lot of devices, drivers and usage examples are available in the communities.

tbeu commented 1 year ago

@bernhard-thiele Did you find some time for evaluation?

Bump.

bernhard-thiele commented 1 year ago

@bernhard-thiele Did you find some time for evaluation?

No, I only had a superficial view on it. I think it would be cool, but since there was no pressing need to get it in and I have no experience with it, I procrastinated it. My first impression (now some time ago) was that there would be some work needed before it is "feature complete and ready". Unfortunately, at the moment there is not really time for me to work on it, so I'm not sure how to handle it.