| .. | .. |
|---|
| 2 | 2 | Core elements |
|---|
| 3 | 3 | ============= |
|---|
| 4 | 4 | |
|---|
| 5 | | -The Industrial I/O core offers a unified framework for writing drivers for |
|---|
| 6 | | -many different types of embedded sensors. a standard interface to user space |
|---|
| 5 | +The Industrial I/O core offers both a unified framework for writing drivers for |
|---|
| 6 | +many different types of embedded sensors and a standard interface to user space |
|---|
| 7 | 7 | applications manipulating sensors. The implementation can be found under |
|---|
| 8 | 8 | :file:`drivers/iio/industrialio-*` |
|---|
| 9 | 9 | |
|---|
| 10 | 10 | Industrial I/O Devices |
|---|
| 11 | 11 | ---------------------- |
|---|
| 12 | 12 | |
|---|
| 13 | | -* struct :c:type:`iio_dev` - industrial I/O device |
|---|
| 14 | | -* :c:func:`iio_device_alloc()` - alocate an :c:type:`iio_dev` from a driver |
|---|
| 15 | | -* :c:func:`iio_device_free()` - free an :c:type:`iio_dev` from a driver |
|---|
| 16 | | -* :c:func:`iio_device_register()` - register a device with the IIO subsystem |
|---|
| 17 | | -* :c:func:`iio_device_unregister()` - unregister a device from the IIO |
|---|
| 13 | +* struct iio_dev - industrial I/O device |
|---|
| 14 | +* iio_device_alloc() - allocate an :c:type:`iio_dev` from a driver |
|---|
| 15 | +* iio_device_free() - free an :c:type:`iio_dev` from a driver |
|---|
| 16 | +* iio_device_register() - register a device with the IIO subsystem |
|---|
| 17 | +* iio_device_unregister() - unregister a device from the IIO |
|---|
| 18 | 18 | subsystem |
|---|
| 19 | 19 | |
|---|
| 20 | 20 | An IIO device usually corresponds to a single hardware sensor and it |
|---|
| .. | .. |
|---|
| 34 | 34 | |
|---|
| 35 | 35 | At probe: |
|---|
| 36 | 36 | |
|---|
| 37 | | -1. Call :c:func:`iio_device_alloc()`, which allocates memory for an IIO device. |
|---|
| 37 | +1. Call iio_device_alloc(), which allocates memory for an IIO device. |
|---|
| 38 | 38 | 2. Initialize IIO device fields with driver specific information (e.g. |
|---|
| 39 | 39 | device name, device channels). |
|---|
| 40 | | -3. Call :c:func:`iio_device_register()`, this registers the device with the |
|---|
| 40 | +3. Call iio_device_register(), this registers the device with the |
|---|
| 41 | 41 | IIO core. After this call the device is ready to accept requests from user |
|---|
| 42 | 42 | space applications. |
|---|
| 43 | 43 | |
|---|
| 44 | 44 | At remove, we free the resources allocated in probe in reverse order: |
|---|
| 45 | 45 | |
|---|
| 46 | | -1. :c:func:`iio_device_unregister()`, unregister the device from the IIO core. |
|---|
| 47 | | -2. :c:func:`iio_device_free()`, free the memory allocated for the IIO device. |
|---|
| 46 | +1. iio_device_unregister(), unregister the device from the IIO core. |
|---|
| 47 | +2. iio_device_free(), free the memory allocated for the IIO device. |
|---|
| 48 | 48 | |
|---|
| 49 | 49 | IIO device sysfs interface |
|---|
| 50 | 50 | ========================== |
|---|
| .. | .. |
|---|
| 66 | 66 | IIO device channels |
|---|
| 67 | 67 | =================== |
|---|
| 68 | 68 | |
|---|
| 69 | | -struct :c:type:`iio_chan_spec` - specification of a single channel |
|---|
| 69 | +struct iio_chan_spec - specification of a single channel |
|---|
| 70 | 70 | |
|---|
| 71 | 71 | An IIO device channel is a representation of a data channel. An IIO device can |
|---|
| 72 | 72 | have one or multiple channels. For example: |
|---|
| .. | .. |
|---|
| 77 | 77 | * an accelerometer can have up to 3 channels representing acceleration on X, Y |
|---|
| 78 | 78 | and Z axes. |
|---|
| 79 | 79 | |
|---|
| 80 | | -An IIO channel is described by the struct :c:type:`iio_chan_spec`. |
|---|
| 80 | +An IIO channel is described by the struct iio_chan_spec. |
|---|
| 81 | 81 | A thermometer driver for the temperature sensor in the example above would |
|---|
| 82 | 82 | have to describe its channel as follows:: |
|---|
| 83 | 83 | |
|---|