1<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>iio_triggered_buffer_setup</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Industrial I/O driver developer's guide"><link rel="up" href="iiotriggered_buffer.html#iiotrigbufsetup" title="IIO triggered buffer setup"><link rel="prev" href="iiotriggered_buffer.html" title="Industrial I/O triggered buffers"><link rel="next" href="API-iio-triggered-buffer-cleanup.html" title="iio_triggered_buffer_cleanup"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">iio_triggered_buffer_setup</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="iiotriggered_buffer.html">Prev</a> </td><th width="60%" align="center"> IIO triggered buffer setup</th><td width="20%" align="right"> <a accesskey="n" href="API-iio-triggered-buffer-cleanup.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-iio-triggered-buffer-setup"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>iio_triggered_buffer_setup — 
2  Setup triggered buffer and pollfunc
3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">int <b class="fsfunc">iio_triggered_buffer_setup </b>(</code></td><td><a class="link" href="API-struct-iio-dev.html" title="struct iio_dev">struct iio_dev</a> * <var class="pdparam">indio_dev</var>, </td></tr><tr><td> </td><td>irqreturn_t (*<var class="pdparam">h</var>)
4     <code>(</code>int irq, void *p<code>)</code>, </td></tr><tr><td> </td><td>irqreturn_t (*<var class="pdparam">thread</var>)
5     <code>(</code>int irq, void *p<code>)</code>, </td></tr><tr><td> </td><td><a class="link" href="API-struct-iio-buffer-setup-ops.html" title="struct iio_buffer_setup_ops">const struct iio_buffer_setup_ops</a> * <var class="pdparam">setup_ops</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id-1.4.6.3.2.5"></a><h2>Arguments</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term"><em class="parameter"><code>indio_dev</code></em></span></dt><dd><p>
6     IIO device structure
7    </p></dd><dt><span class="term"><em class="parameter"><code>h</code></em></span></dt><dd><p>
8     Function which will be used as pollfunc top half
9    </p></dd><dt><span class="term"><em class="parameter"><code>thread</code></em></span></dt><dd><p>
10     Function which will be used as pollfunc bottom half
11    </p></dd><dt><span class="term"><em class="parameter"><code>setup_ops</code></em></span></dt><dd><p>
12     Buffer setup functions to use for this device.
13     If NULL the default setup functions for triggered
14     buffers will be used.
15    </p></dd></dl></div></div><div class="refsect1"><a name="id-1.4.6.3.2.6"></a><h2>Description</h2><p>
16   This function combines some common tasks which will normally be performed
17   when setting up a triggered buffer. It will allocate the buffer and the
18   pollfunc.
19   </p><p>
20
21   Before calling this function the indio_dev structure should already be
22   completely initialized, but not yet registered. In practice this means that
23   this function should be called right before <code class="function"><a class="link" href="API-iio-device-register.html" title="iio_device_register">iio_device_register</a></code>.
24   </p><p>
25
26   To free the resources allocated by this function call
27   <code class="function"><a class="link" href="API-iio-triggered-buffer-cleanup.html" title="iio_triggered_buffer_cleanup">iio_triggered_buffer_cleanup</a></code>.
28</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="iiotriggered_buffer.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="iiotriggered_buffer.html#iiotrigbufsetup">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-iio-triggered-buffer-cleanup.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> Industrial I/O triggered buffers  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">iio_triggered_buffer_cleanup</span></td></tr></table></div></body></html>
29