Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > 2c51d8eb79f8810ada971ee8c30ce1e5 > files > 279

kernel-doc-2.6.32-71.14.1.el6.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="Linux Device Drivers" /><link rel="up" href="index.html" title="Linux Device Drivers" /><link rel="prev" href="re729.html" title="input_ff_create_memless" /><link rel="next" href="re730.html" title="struct spi_device" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re729.html">Prev</a>&#160;</td><th width="60%" align="center">&#160;</th><td width="20%" align="right">&#160;<a accesskey="n" href="re730.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)"><div class="titlepage"><div><div><h2 class="title"><a id="spi"></a>Chapter&#160;9.&#160;Serial Peripheral Interface (SPI)</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="refentrytitle"><a href="re730.html"><span>struct spi_device</span></a></span><span class="refpurpose"> &#8212; 
  Master side proxy for an SPI slave device
 </span></dt><dt><span class="refentrytitle"><a href="re731.html"><span>struct spi_driver</span></a></span><span class="refpurpose"> &#8212; 
     Host side <span class="quote">&#8220;<span class="quote">protocol</span>&#8221;</span> driver
 </span></dt><dt><span class="refentrytitle"><a href="re732.html"><span>spi_unregister_driver</span></a></span><span class="refpurpose"> &#8212; 
     reverse effect of spi_register_driver
 </span></dt><dt><span class="refentrytitle"><a href="re733.html"><span>struct spi_master</span></a></span><span class="refpurpose"> &#8212; 
     interface to SPI master controller
 </span></dt><dt><span class="refentrytitle"><a href="re734.html"><span>struct spi_transfer</span></a></span><span class="refpurpose"> &#8212; 
     a read/write buffer pair
 </span></dt><dt><span class="refentrytitle"><a href="re735.html"><span>struct spi_message</span></a></span><span class="refpurpose"> &#8212; 
     one multi-segment SPI transaction
 </span></dt><dt><span class="refentrytitle"><a href="re736.html"><span>spi_write</span></a></span><span class="refpurpose"> &#8212; 
     SPI synchronous write
 </span></dt><dt><span class="refentrytitle"><a href="re737.html"><span>spi_read</span></a></span><span class="refpurpose"> &#8212; 
     SPI synchronous read
 </span></dt><dt><span class="refentrytitle"><a href="re738.html"><span>spi_w8r8</span></a></span><span class="refpurpose"> &#8212; 
     SPI synchronous 8 bit write followed by 8 bit read
 </span></dt><dt><span class="refentrytitle"><a href="re739.html"><span>spi_w8r16</span></a></span><span class="refpurpose"> &#8212; 
     SPI synchronous 8 bit write followed by 16 bit read
 </span></dt><dt><span class="refentrytitle"><a href="re740.html"><span>struct spi_board_info</span></a></span><span class="refpurpose"> &#8212; 
     board-specific template for a SPI device
 </span></dt><dt><span class="refentrytitle"><a href="re741.html"><span>spi_register_board_info</span></a></span><span class="refpurpose"> &#8212; 
  register SPI devices for a given board
 </span></dt><dt><span class="refentrytitle"><a href="re742.html"><span>spi_register_driver</span></a></span><span class="refpurpose"> &#8212; 
  register a SPI driver
 </span></dt><dt><span class="refentrytitle"><a href="re743.html"><span>spi_alloc_device</span></a></span><span class="refpurpose"> &#8212; 
     Allocate a new SPI device
 </span></dt><dt><span class="refentrytitle"><a href="re744.html"><span>spi_add_device</span></a></span><span class="refpurpose"> &#8212; 
     Add spi_device allocated with spi_alloc_device
 </span></dt><dt><span class="refentrytitle"><a href="re745.html"><span>spi_new_device</span></a></span><span class="refpurpose"> &#8212; 
     instantiate one new SPI device
 </span></dt><dt><span class="refentrytitle"><a href="re746.html"><span>spi_alloc_master</span></a></span><span class="refpurpose"> &#8212; 
     allocate SPI master controller
 </span></dt><dt><span class="refentrytitle"><a href="re747.html"><span>spi_register_master</span></a></span><span class="refpurpose"> &#8212; 
     register SPI master controller
 </span></dt><dt><span class="refentrytitle"><a href="re748.html"><span>spi_unregister_master</span></a></span><span class="refpurpose"> &#8212; 
     unregister SPI master controller
 </span></dt><dt><span class="refentrytitle"><a href="re749.html"><span>spi_busnum_to_master</span></a></span><span class="refpurpose"> &#8212; 
     look up master associated with bus_num
 </span></dt><dt><span class="refentrytitle"><a href="re750.html"><span>spi_setup</span></a></span><span class="refpurpose"> &#8212; 
     setup SPI mode and clock rate
 </span></dt><dt><span class="refentrytitle"><a href="re751.html"><span>spi_async</span></a></span><span class="refpurpose"> &#8212; 
     asynchronous SPI transfer
 </span></dt><dt><span class="refentrytitle"><a href="re752.html"><span>spi_sync</span></a></span><span class="refpurpose"> &#8212; 
     blocking/synchronous SPI data transfers
 </span></dt><dt><span class="refentrytitle"><a href="re753.html"><span>spi_write_then_read</span></a></span><span class="refpurpose"> &#8212; 
     SPI synchronous write followed by read
 </span></dt></dl></div><p>
	SPI is the "Serial Peripheral Interface", widely used with
	embedded systems because it is a simple and efficient
	interface:  basically a multiplexed shift register.
	Its three signal wires hold a clock (SCK, often in the range
	of 1-20 MHz), a "Master Out, Slave In" (MOSI) data line, and
	a "Master In, Slave Out" (MISO) data line.
	SPI is a full duplex protocol; for each bit shifted out the
	MOSI line (one per clock) another is shifted in on the MISO line.
	Those bits are assembled into words of various sizes on the
	way to and from system memory.
	An additional chipselect line is usually active-low (nCS);
	four signals are normally used for each peripheral, plus
	sometimes an interrupt.
  </p><p>
	The SPI bus facilities listed here provide a generalized
	interface to declare SPI busses and devices, manage them
	according to the standard Linux driver model, and perform
	input/output operations.
	At this time, only "master" side interfaces are supported,
	where Linux talks to SPI peripherals and does not implement
	such a peripheral itself.
	(Interfaces to support implementing SPI slaves would
	necessarily look different.)
  </p><p>
	The programming interface is structured around two kinds of driver,
	and two kinds of device.
	A "Controller Driver" abstracts the controller hardware, which may
	be as simple as a set of GPIO pins or as complex as a pair of FIFOs
	connected to dual DMA engines on the other side of the SPI shift
	register (maximizing throughput).  Such drivers bridge between
	whatever bus they sit on (often the platform bus) and SPI, and
	expose the SPI side of their device as a
	<span class="structname">struct spi_master</span>.
	SPI devices are children of that master, represented as a
	<span class="structname">struct spi_device</span> and manufactured from
	<span class="structname">struct spi_board_info</span> descriptors which
	are usually provided by board-specific initialization code.
	A <span class="structname">struct spi_driver</span> is called a
	"Protocol Driver", and is bound to a spi_device using normal
	driver model calls.
  </p><p>
	The I/O model is a set of queued messages.  Protocol drivers
	submit one or more <span class="structname">struct spi_message</span>
	objects, which are processed and completed asynchronously.
	(There are synchronous wrappers, however.)  Messages are
	built from one or more <span class="structname">struct spi_transfer</span>
	objects, each of which wraps a full duplex SPI transfer.
	A variety of protocol tweaking options are needed, because
	different chips adopt very different policies for how they
	use the bits transferred with SPI.
  </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re729.html">Prev</a>&#160;</td><td width="20%" align="center">&#160;</td><td width="40%" align="right">&#160;<a accesskey="n" href="re730.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>input_ff_create_memless</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span>struct spi_device</span></td></tr></table></div></body></html>