wpilib18/java/current/javadoc/edu/wpi/first/wpilibj/SPI.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_144) on Sat Oct 28 05:22:53 EDT 2017 -->
<title>SPI (Documentation - Release API)</title>
<meta name="date" content="2017-10-28">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="SPI (Documentation - Release API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../edu/wpi/first/wpilibj/SpeedControllerGroup.html" title="class in edu.wpi.first.wpilibj"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../edu/wpi/first/wpilibj/SPI.Port.html" title="enum in edu.wpi.first.wpilibj"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?edu/wpi/first/wpilibj/SPI.html" target="_top">Frames</a></li>
<li><a href="SPI.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li><a href="#fields.inherited.from.class.edu.wpi.first.wpilibj.SensorBase">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">edu.wpi.first.wpilibj</div>
<h2 title="Class SPI" class="title">Class SPI</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../edu/wpi/first/wpilibj/SensorBase.html" title="class in edu.wpi.first.wpilibj">edu.wpi.first.wpilibj.SensorBase</a></li>
<li>
<ul class="inheritance">
<li>edu.wpi.first.wpilibj.SPI</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="typeNameLabel">SPI</span>
extends <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html" title="class in edu.wpi.first.wpilibj">SensorBase</a></pre>
<div class="block">Represents a SPI bus port.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class </code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.Port.html" title="enum in edu.wpi.first.wpilibj">SPI.Port</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.edu.wpi.first.wpilibj.SensorBase">
<!-- -->
</a>
<h3>Fields inherited from class edu.wpi.first.wpilibj.<a href="../../../../edu/wpi/first/wpilibj/SensorBase.html" title="class in edu.wpi.first.wpilibj">SensorBase</a></h3>
<code><a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kAnalogInputChannels">kAnalogInputChannels</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kAnalogOutputChannels">kAnalogOutputChannels</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kDigitalChannels">kDigitalChannels</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kPCMModules">kPCMModules</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kPDPChannels">kPDPChannels</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kPDPModules">kPDPModules</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kPwmChannels">kPwmChannels</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kRelayChannels">kRelayChannels</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kSolenoidChannels">kSolenoidChannels</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#kSystemClockTicksPerMicrosecond">kSystemClockTicksPerMicrosecond</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#SPI-edu.wpi.first.wpilibj.SPI.Port-">SPI</a></span>(<a href="../../../../edu/wpi/first/wpilibj/SPI.Port.html" title="enum in edu.wpi.first.wpilibj">SPI.Port</a> port)</code>
<div class="block">Constructor.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#free--">free</a></span>()</code>
<div class="block">Free the resources used by this object.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#freeAccumulator--">freeAccumulator</a></span>()</code>
<div class="block">Frees the accumulator.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#getAccumulatorAverage--">getAccumulatorAverage</a></span>()</code>
<div class="block">Read the average of the accumulated value.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#getAccumulatorCount--">getAccumulatorCount</a></span>()</code>
<div class="block">Read the number of accumulated values.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#getAccumulatorLastValue--">getAccumulatorLastValue</a></span>()</code>
<div class="block">Read the last value read by the accumulator engine.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#getAccumulatorOutput-edu.wpi.first.wpilibj.AccumulatorResult-">getAccumulatorOutput</a></span>(<a href="../../../../edu/wpi/first/wpilibj/AccumulatorResult.html" title="class in edu.wpi.first.wpilibj">AccumulatorResult</a> result)</code>
<div class="block">Read the accumulated value and the number of accumulated values atomically.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#getAccumulatorValue--">getAccumulatorValue</a></span>()</code>
<div class="block">Read the accumulated value.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#initAccumulator-double-int-int-int-int-int-int-boolean-boolean-">initAccumulator</a></span>(double period,
int cmd,
int xferSize,
int validMask,
int validValue,
int dataShift,
int dataSize,
boolean isSigned,
boolean bigEndian)</code>
<div class="block">Initialize the accumulator.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#read-boolean-byte:A-int-">read</a></span>(boolean initiate,
byte[] dataReceived,
int size)</code>
<div class="block">Read a word from the receive FIFO.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#read-boolean-java.nio.ByteBuffer-int-">read</a></span>(boolean initiate,
java.nio.ByteBuffer dataReceived,
int size)</code>
<div class="block">Read a word from the receive FIFO.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#resetAccumulator--">resetAccumulator</a></span>()</code>
<div class="block">Resets the accumulator to zero.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setAccumulatorCenter-int-">setAccumulatorCenter</a></span>(int center)</code>
<div class="block">Set the center value of the accumulator.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setAccumulatorDeadband-int-">setAccumulatorDeadband</a></span>(int deadband)</code>
<div class="block">Set the accumulator's deadband.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setChipSelectActiveHigh--">setChipSelectActiveHigh</a></span>()</code>
<div class="block">Configure the chip select line to be active high.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setChipSelectActiveLow--">setChipSelectActiveLow</a></span>()</code>
<div class="block">Configure the chip select line to be active low.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setClockActiveHigh--">setClockActiveHigh</a></span>()</code>
<div class="block">Configure the clock output line to be active high.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setClockActiveLow--">setClockActiveLow</a></span>()</code>
<div class="block">Configure the clock output line to be active low.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setClockRate-int-">setClockRate</a></span>(int hz)</code>
<div class="block">Configure the rate of the generated clock signal.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setLSBFirst--">setLSBFirst</a></span>()</code>
<div class="block">Configure the order that bits are sent and received on the wire to be least significant bit
first.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setMSBFirst--">setMSBFirst</a></span>()</code>
<div class="block">Configure the order that bits are sent and received on the wire to be most significant bit
first.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setSampleDataOnFalling--">setSampleDataOnFalling</a></span>()</code>
<div class="block">Configure that the data is stable on the falling edge and the data changes on the rising edge.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#setSampleDataOnRising--">setSampleDataOnRising</a></span>()</code>
<div class="block">Configure that the data is stable on the rising edge and the data changes on the falling edge.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#transaction-byte:A-byte:A-int-">transaction</a></span>(byte[] dataToSend,
byte[] dataReceived,
int size)</code>
<div class="block">Perform a simultaneous read/write transaction with the device.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#transaction-java.nio.ByteBuffer-java.nio.ByteBuffer-int-">transaction</a></span>(java.nio.ByteBuffer dataToSend,
java.nio.ByteBuffer dataReceived,
int size)</code>
<div class="block">Perform a simultaneous read/write transaction with the device.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#write-byte:A-int-">write</a></span>(byte[] dataToSend,
int size)</code>
<div class="block">Write data to the slave device.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../edu/wpi/first/wpilibj/SPI.html#write-java.nio.ByteBuffer-int-">write</a></span>(java.nio.ByteBuffer dataToSend,
int size)</code>
<div class="block">Write data to the slave device.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.edu.wpi.first.wpilibj.SensorBase">
<!-- -->
</a>
<h3>Methods inherited from class edu.wpi.first.wpilibj.<a href="../../../../edu/wpi/first/wpilibj/SensorBase.html" title="class in edu.wpi.first.wpilibj">SensorBase</a></h3>
<code><a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkAnalogInputChannel-int-">checkAnalogInputChannel</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkAnalogOutputChannel-int-">checkAnalogOutputChannel</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkDigitalChannel-int-">checkDigitalChannel</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkPDPChannel-int-">checkPDPChannel</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkPDPModule-int-">checkPDPModule</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkPWMChannel-int-">checkPWMChannel</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkRelayChannel-int-">checkRelayChannel</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkSolenoidChannel-int-">checkSolenoidChannel</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#checkSolenoidModule-int-">checkSolenoidModule</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#getDefaultSolenoidModule--">getDefaultSolenoidModule</a>, <a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#setDefaultSolenoidModule-int-">setDefaultSolenoidModule</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="SPI-edu.wpi.first.wpilibj.SPI.Port-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>SPI</h4>
<pre>public SPI(<a href="../../../../edu/wpi/first/wpilibj/SPI.Port.html" title="enum in edu.wpi.first.wpilibj">SPI.Port</a> port)</pre>
<div class="block">Constructor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>port</code> - the physical SPI port</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="free--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>free</h4>
<pre>public void free()</pre>
<div class="block">Free the resources used by this object.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="../../../../edu/wpi/first/wpilibj/SensorBase.html#free--">free</a></code> in class <code><a href="../../../../edu/wpi/first/wpilibj/SensorBase.html" title="class in edu.wpi.first.wpilibj">SensorBase</a></code></dd>
</dl>
</li>
</ul>
<a name="setClockRate-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setClockRate</h4>
<pre>public final void setClockRate(int hz)</pre>
<div class="block">Configure the rate of the generated clock signal. The default value is 500,000 Hz. The maximum
value is 4,000,000 Hz.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>hz</code> - The clock rate in Hertz.</dd>
</dl>
</li>
</ul>
<a name="setMSBFirst--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMSBFirst</h4>
<pre>public final void setMSBFirst()</pre>
<div class="block">Configure the order that bits are sent and received on the wire to be most significant bit
first.</div>
</li>
</ul>
<a name="setLSBFirst--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setLSBFirst</h4>
<pre>public final void setLSBFirst()</pre>
<div class="block">Configure the order that bits are sent and received on the wire to be least significant bit
first.</div>
</li>
</ul>
<a name="setClockActiveLow--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setClockActiveLow</h4>
<pre>public final void setClockActiveLow()</pre>
<div class="block">Configure the clock output line to be active low. This is sometimes called clock polarity high
or clock idle high.</div>
</li>
</ul>
<a name="setClockActiveHigh--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setClockActiveHigh</h4>
<pre>public final void setClockActiveHigh()</pre>
<div class="block">Configure the clock output line to be active high. This is sometimes called clock polarity low
or clock idle low.</div>
</li>
</ul>
<a name="setSampleDataOnFalling--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSampleDataOnFalling</h4>
<pre>public final void setSampleDataOnFalling()</pre>
<div class="block">Configure that the data is stable on the falling edge and the data changes on the rising edge.</div>
</li>
</ul>
<a name="setSampleDataOnRising--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setSampleDataOnRising</h4>
<pre>public final void setSampleDataOnRising()</pre>
<div class="block">Configure that the data is stable on the rising edge and the data changes on the falling edge.</div>
</li>
</ul>
<a name="setChipSelectActiveHigh--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setChipSelectActiveHigh</h4>
<pre>public final void setChipSelectActiveHigh()</pre>
<div class="block">Configure the chip select line to be active high.</div>
</li>
</ul>
<a name="setChipSelectActiveLow--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setChipSelectActiveLow</h4>
<pre>public final void setChipSelectActiveLow()</pre>
<div class="block">Configure the chip select line to be active low.</div>
</li>
</ul>
<a name="write-byte:A-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public int write(byte[] dataToSend,
int size)</pre>
<div class="block">Write data to the slave device. Blocks until there is space in the output FIFO.
<p>If not running in output only mode, also saves the data received on the MISO input during
the transfer into the receive FIFO.</div>
</li>
</ul>
<a name="write-java.nio.ByteBuffer-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public int write(java.nio.ByteBuffer dataToSend,
int size)</pre>
<div class="block">Write data to the slave device. Blocks until there is space in the output FIFO.
<p>If not running in output only mode, also saves the data received on the MISO input during
the transfer into the receive FIFO.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dataToSend</code> - The buffer containing the data to send. Must be created using
ByteBuffer.allocateDirect().</dd>
</dl>
</li>
</ul>
<a name="read-boolean-byte:A-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public int read(boolean initiate,
byte[] dataReceived,
int size)</pre>
<div class="block">Read a word from the receive FIFO.
<p>Waits for the current transfer to complete if the receive FIFO is empty.
<p>If the receive FIFO is empty, there is no active transfer, and initiate is false, errors.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initiate</code> - If true, this function pushes "0" into the transmit buffer and initiates a
transfer. If false, this function assumes that data is already in the receive
FIFO from a previous write.</dd>
</dl>
</li>
</ul>
<a name="read-boolean-java.nio.ByteBuffer-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>read</h4>
<pre>public int read(boolean initiate,
java.nio.ByteBuffer dataReceived,
int size)</pre>
<div class="block">Read a word from the receive FIFO.
<p>Waits for the current transfer to complete if the receive FIFO is empty.
<p>If the receive FIFO is empty, there is no active transfer, and initiate is false, errors.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initiate</code> - If true, this function pushes "0" into the transmit buffer and initiates
a transfer. If false, this function assumes that data is already in the
receive FIFO from a previous write.</dd>
<dd><code>dataReceived</code> - The buffer to be filled with the received data. Must be created using
ByteBuffer.allocateDirect().</dd>
<dd><code>size</code> - The length of the transaction, in bytes</dd>
</dl>
</li>
</ul>
<a name="transaction-byte:A-byte:A-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transaction</h4>
<pre>public int transaction(byte[] dataToSend,
byte[] dataReceived,
int size)</pre>
<div class="block">Perform a simultaneous read/write transaction with the device.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dataToSend</code> - The data to be written out to the device</dd>
<dd><code>dataReceived</code> - Buffer to receive data from the device</dd>
<dd><code>size</code> - The length of the transaction, in bytes</dd>
</dl>
</li>
</ul>
<a name="transaction-java.nio.ByteBuffer-java.nio.ByteBuffer-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transaction</h4>
<pre>public int transaction(java.nio.ByteBuffer dataToSend,
java.nio.ByteBuffer dataReceived,
int size)</pre>
<div class="block">Perform a simultaneous read/write transaction with the device.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>dataToSend</code> - The data to be written out to the device. Must be created using
ByteBuffer.allocateDirect().</dd>
<dd><code>dataReceived</code> - Buffer to receive data from the device. Must be created using
ByteBuffer.allocateDirect().</dd>
<dd><code>size</code> - The length of the transaction, in bytes</dd>
</dl>
</li>
</ul>
<a name="initAccumulator-double-int-int-int-int-int-int-boolean-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>initAccumulator</h4>
<pre>public void initAccumulator(double period,
int cmd,
int xferSize,
int validMask,
int validValue,
int dataShift,
int dataSize,
boolean isSigned,
boolean bigEndian)</pre>
<div class="block">Initialize the accumulator.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>period</code> - Time between reads</dd>
<dd><code>cmd</code> - SPI command to send to request data</dd>
<dd><code>xferSize</code> - SPI transfer size, in bytes</dd>
<dd><code>validMask</code> - Mask to apply to received data for validity checking</dd>
<dd><code>validValue</code> - After validMask is applied, required matching value for validity checking</dd>
<dd><code>dataShift</code> - Bit shift to apply to received data to get actual data value</dd>
<dd><code>dataSize</code> - Size (in bits) of data field</dd>
<dd><code>isSigned</code> - Is data field signed?</dd>
<dd><code>bigEndian</code> - Is device big endian?</dd>
</dl>
</li>
</ul>
<a name="freeAccumulator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>freeAccumulator</h4>
<pre>public void freeAccumulator()</pre>
<div class="block">Frees the accumulator.</div>
</li>
</ul>
<a name="resetAccumulator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>resetAccumulator</h4>
<pre>public void resetAccumulator()</pre>
<div class="block">Resets the accumulator to zero.</div>
</li>
</ul>
<a name="setAccumulatorCenter-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAccumulatorCenter</h4>
<pre>public void setAccumulatorCenter(int center)</pre>
<div class="block">Set the center value of the accumulator.
<p>The center value is subtracted from each value before it is added to the accumulator. This
is used for the center value of devices like gyros and accelerometers to make integration work
and to take the device offset into account when integrating.</div>
</li>
</ul>
<a name="setAccumulatorDeadband-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAccumulatorDeadband</h4>
<pre>public void setAccumulatorDeadband(int deadband)</pre>
<div class="block">Set the accumulator's deadband.</div>
</li>
</ul>
<a name="getAccumulatorLastValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAccumulatorLastValue</h4>
<pre>public int getAccumulatorLastValue()</pre>
<div class="block">Read the last value read by the accumulator engine.</div>
</li>
</ul>
<a name="getAccumulatorValue--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAccumulatorValue</h4>
<pre>public long getAccumulatorValue()</pre>
<div class="block">Read the accumulated value.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The 64-bit value accumulated since the last Reset().</dd>
</dl>
</li>
</ul>
<a name="getAccumulatorCount--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAccumulatorCount</h4>
<pre>public int getAccumulatorCount()</pre>
<div class="block">Read the number of accumulated values.
<p>Read the count of the accumulated values since the accumulator was last Reset().</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The number of times samples from the channel were accumulated.</dd>
</dl>
</li>
</ul>
<a name="getAccumulatorAverage--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAccumulatorAverage</h4>
<pre>public double getAccumulatorAverage()</pre>
<div class="block">Read the average of the accumulated value.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The accumulated average value (value / count).</dd>
</dl>
</li>
</ul>
<a name="getAccumulatorOutput-edu.wpi.first.wpilibj.AccumulatorResult-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getAccumulatorOutput</h4>
<pre>public void getAccumulatorOutput(<a href="../../../../edu/wpi/first/wpilibj/AccumulatorResult.html" title="class in edu.wpi.first.wpilibj">AccumulatorResult</a> result)</pre>
<div class="block">Read the accumulated value and the number of accumulated values atomically.
<p>This function reads the value and count atomically. This can be used for averaging.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>result</code> - AccumulatorResult object to store the results in.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../edu/wpi/first/wpilibj/SpeedControllerGroup.html" title="class in edu.wpi.first.wpilibj"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../edu/wpi/first/wpilibj/SPI.Port.html" title="enum in edu.wpi.first.wpilibj"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?edu/wpi/first/wpilibj/SPI.html" target="_top">Frames</a></li>
<li><a href="SPI.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li><a href="#nested.class.summary">Nested</a> | </li>
<li><a href="#fields.inherited.from.class.edu.wpi.first.wpilibj.SensorBase">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>