summaryrefslogtreecommitdiff
path: root/static/freebsd/man4/iic.4 3.html
diff options
context:
space:
mode:
Diffstat (limited to 'static/freebsd/man4/iic.4 3.html')
-rw-r--r--static/freebsd/man4/iic.4 3.html171
1 files changed, 0 insertions, 171 deletions
diff --git a/static/freebsd/man4/iic.4 3.html b/static/freebsd/man4/iic.4 3.html
deleted file mode 100644
index 97457fe9..00000000
--- a/static/freebsd/man4/iic.4 3.html
+++ /dev/null
@@ -1,171 +0,0 @@
-<table class="head">
- <tr>
- <td class="head-ltitle">IIC(4)</td>
- <td class="head-vol">Device Drivers Manual</td>
- <td class="head-rtitle">IIC(4)</td>
- </tr>
-</table>
-<div class="manual-text">
-<section class="Sh">
-<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1>
-<p class="Pp"><code class="Nm">iic</code> &#x2014; <span class="Nd">I2C generic
- I/O device driver</span></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1>
-<p class="Pp"><code class="Cd">device iic</code></p>
-<p class="Pp">
- <br/>
- <code class="In">#include
- &lt;<a class="In">dev/iicbus/iic.h</a>&gt;</code></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1>
-<p class="Pp">The <code class="Nm">iic</code> device driver provides generic I/O
- to any <a class="Xr">iicbus(4)</a> instance. In order to control I2C
- devices, use <span class="Pa">/dev/iic?</span> with the following
- ioctls:</p>
-<dl class="Bl-tag">
- <dt id="I2CSTART"><a class="permalink" href="#I2CSTART"><code class="Dv">I2CSTART</code></a></dt>
- <dd>(<var class="Vt">struct iiccmd</var>) Sends the start condition to the
- slave specified by the <var class="Va">slave</var> element to the bus. The
- <var class="Va">slave</var> element consists of a 7-bit address and a
- read/write bit (that is, a 7-bit address &lt;&lt; 1 | r/w). A read
- operation is initiated when the read/write bit is set, or a write
- operation when it is cleared. All other elements are ignored. If
- successful, the file descriptor receives exclusive ownership of the
- underlying iicbus instance.</dd>
- <dt id="I2CRPTSTART"><a class="permalink" href="#I2CRPTSTART"><code class="Dv">I2CRPTSTART</code></a></dt>
- <dd>(<var class="Vt">struct iiccmd</var>) Sends the repeated start condition
- to the slave specified by the <var class="Va">slave</var> element to the
- bus. The slave address should be specified as in
- <code class="Dv">I2CSTART</code>. All other elements are ignored.
- <code class="Dv">I2CSTART</code> must have previously been issued on the
- same file descriptor.</dd>
- <dt id="I2CSTOP"><a class="permalink" href="#I2CSTOP"><code class="Dv">I2CSTOP</code></a></dt>
- <dd>No argument is passed. Sends the stop condition to the bus. If
- <code class="Dv">I2CSTART</code> was previously issued on the file
- descriptor, the current transaction is terminated and exclusive ownership
- of the underlying iicbus instance is released. Otherwise, no action is
- performed.</dd>
- <dt id="I2CRSTCARD"><a class="permalink" href="#I2CRSTCARD"><code class="Dv">I2CRSTCARD</code></a></dt>
- <dd>(<var class="Vt">struct iiccmd</var>) Resets the bus. The argument is
- completely ignored. This command does not require
- <code class="Dv">I2CSTART</code> to have been previously issued on the
- file descriptor. If it was previously issued, exclusive ownership of the
- underlying iicbus instance is released.</dd>
- <dt id="I2CWRITE"><a class="permalink" href="#I2CWRITE"><code class="Dv">I2CWRITE</code></a></dt>
- <dd>(<var class="Vt">struct iiccmd</var>) Writes data to the
- <a class="Xr">iicbus(4)</a>. The bus must already be started by a previous
- <code class="Dv">I2CSTART</code> on the file descriptor. The
- <var class="Va">slave</var> element is ignored. The
- <var class="Va">count</var> element is the number of bytes to write. The
- <var class="Va">last</var> element is a boolean flag. It must be zero when
- additional read commands will follow, or non-zero if this is the last
- command. The <var class="Va">buf</var> element is a pointer to the data to
- write to the bus.</dd>
- <dt id="I2CREAD"><a class="permalink" href="#I2CREAD"><code class="Dv">I2CREAD</code></a></dt>
- <dd>(<var class="Vt">struct iiccmd</var>) Reads data from the
- <a class="Xr">iicbus(4)</a>. The bus must already be started by a previous
- <code class="Dv">I2CSTART</code> on the file descriptor. The
- <var class="Va">slave</var> element is ignored. The
- <var class="Va">count</var> element is the number of bytes to read. The
- <var class="Va">last</var> element is a boolean flag. It must be zero when
- additional read commands will follow, or non-zero if this is the last
- command. The <var class="Va">buf</var> element is a pointer to where to
- store the data read from the bus. Short reads on the bus produce undefined
- results.</dd>
- <dt id="I2CRDWR"><a class="permalink" href="#I2CRDWR"><code class="Dv">I2CRDWR</code></a></dt>
- <dd>(<var class="Vt">struct iic_rdwr_data</var>) Generic read/write interface.
- Allows for an arbitrary number of commands to be sent to an arbitrary
- number of devices on the bus. Any previous transaction started by
- <code class="Dv">I2CSTART</code> must be terminated by
- <code class="Dv">I2CSTOP</code> or <code class="Dv">I2CRSTCARD</code>
- before <code class="Dv">I2CRDWR</code> can be issued on the same file
- descriptor. A read transfer is specified if
- <code class="Dv">IIC_M_RD</code> is set in <var class="Va">flags</var>.
- Otherwise the transfer is a write transfer. The
- <var class="Va">slave</var> element specifies the 7-bit address with the
- read/write bit for the transfer. The read/write bit will be handled by the
- iicbus stack based on the specified transfer operation. The
- <var class="Va">len</var> element is the number of (<var class="Vt">struct
- iic_msg</var>) messages encoded on (<var class="Vt">struct
- iic_rdwr_data</var>). The <var class="Va">buf</var> element is a buffer
- for that data. This ioctl is intended to be Linux compatible.</dd>
- <dt id="I2CSADDR"><a class="permalink" href="#I2CSADDR"><code class="Dv">I2CSADDR</code></a></dt>
- <dd>(<var class="Vt">uint8_t</var>) Associate the specified address with the
- file descriptor for use by subsequent <a class="Xr">read(2)</a> or
- <a class="Xr">write(2)</a> calls. The argument is an 8-bit address (that
- is, a 7-bit address &lt;&lt; 1). The read/write bit in the
- least-significant position is ignored. Any subsequent read or write
- operation will set or clear that bit as needed.</dd>
-</dl>
-<p class="Pp">The following data structures are defined in
- <code class="In">&lt;<a class="In">dev/iicbus/iic.h</a>&gt;</code> and
- referenced above:</p>
-<div class="Bd Pp Bd-indent Li">
-<pre>struct iiccmd {
- u_char slave;
- int count;
- int last;
- char *buf;
-};
-
-/* Designed to be compatible with linux's struct i2c_msg */
-struct iic_msg
-{
- uint16_t slave;
- uint16_t flags;
-#define IIC_M_WR 0 /* Fake flag for write */
-#define IIC_M_RD 0x0001 /* read vs write */
-#define IIC_M_NOSTOP 0x0002 /* do not send a I2C stop after message */
-#define IIC_M_NOSTART 0x0004 /* do not send a I2C start before message */
- uint16_t len; /* msg length */
- uint8_t * buf;
-};
-
-struct iic_rdwr_data {
- struct iic_msg *msgs;
- uint32_t nmsgs;
-};</pre>
-</div>
-<p class="Pp">It is also possible to use <a class="Xr">read(2)</a> or
- <a class="Xr">write(2)</a>, in which case the I2C start/stop handshake is
- managed by <a class="Xr">iicbus(4)</a>. The address used for the read/write
- operation is the one passed to the most recent
- <code class="Dv">I2CSTART</code> <a class="Xr">ioctl(2)</a> or
- <code class="Dv">I2CSADDR</code> <a class="Xr">ioctl(2)</a> on the open
- <span class="Pa">/dev/iic?</span> file descriptor. Closing the file
- descriptor clears any addressing state established by a previous
- <code class="Dv">I2CSTART</code> or <code class="Dv">I2CSADDR</code>, stops
- any transaction established by a not-yet-terminated
- <code class="Dv">I2CSTART</code>, and releases iicbus ownership. Because
- addressing state is stored on a per-file-descriptor basis, it is permissible
- for multiple file descriptors to be simultaneously open on the same
- <span class="Pa">/dev/iic?</span> device. Concurrent transactions on those
- descriptors are synchronized by the exclusive-ownership requests issued to
- the underlying iicbus instance.</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE
- ALSO</a></h1>
-<p class="Pp"><a class="Xr">ioctl(2)</a>, <a class="Xr">read(2)</a>,
- <a class="Xr">write(2)</a>, <a class="Xr">iicbus(4)</a></p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1>
-<p class="Pp">The <code class="Nm">iic</code> manual page first appeared in
- <span class="Ux">FreeBSD 3.0</span>.</p>
-</section>
-<section class="Sh">
-<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1>
-<p class="Pp">This manual page was written by <span class="An">Nicolas
- Souchu</span> and <span class="An">M. Warner Losh</span>.</p>
-</section>
-</div>
-<table class="foot">
- <tr>
- <td class="foot-date">May 15, 2015</td>
- <td class="foot-os">FreeBSD 15.0</td>
- </tr>
-</table>