Files
ioiolib/IOIOLib/doc/ioio/lib/api/IOIO.html
2012-01-24 13:04:09 -05:00

1242 lines
72 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_29) on Mon Nov 28 00:50:34 PST 2011 -->
<TITLE>
IOIO
</TITLE>
<META NAME="date" CONTENT="2011-11-28">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="IOIO";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IOIO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../ioio/lib/api/IcspMaster.html" title="interface in ioio.lib.api"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../ioio/lib/api/IOIO.VersionType.html" title="enum in ioio.lib.api"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?ioio/lib/api/IOIO.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="IOIO.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
ioio.lib.api</FONT>
<BR>
Interface IOIO</H2>
<HR>
<DL>
<DT><PRE>public interface <B>IOIO</B></DL>
</PRE>
<P>
This interface provides control over all the IOIO board functions.
<p>
An instance of this interface is typically obtained by using the
<A HREF="../../../ioio/lib/api/IOIOFactory.html" title="class in ioio.lib.api"><CODE>IOIOFactory</CODE></A> class. Initially, a connection should be established, by
calling <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>. This method will block until the board is
connected an a connection has been established.
<p>
During the connection process, this library verifies that the IOIO firmware
is compatible with the required version. If not, <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>
will throw a <A HREF="../../../ioio/lib/api/exception/IncompatibilityException.html" title="class in ioio.lib.api.exception"><CODE>IncompatibilityException</CODE></A>, putting the <A HREF="../../../ioio/lib/api/IOIO.html" title="interface in ioio.lib.api"><CODE>IOIO</CODE></A>
instance in a "zombie" state: nothing could be done with it except calling
<A HREF="../../../ioio/lib/api/IOIO.html#disconnect()"><CODE>disconnect()</CODE></A>, or waiting for the physical connection to drop via
<A HREF="../../../ioio/lib/api/IOIO.html#waitForDisconnect()"><CODE>waitForDisconnect()</CODE></A>.
<p>
As soon as a connection is established, the IOIO can be used, typically, by
calling the openXXX() functions to obtain additional interfaces for
controlling specific function of the board.
<p>
Whenever a connection is lost as a result of physically disconnecting the
board or as a result of calling <A HREF="../../../ioio/lib/api/IOIO.html#disconnect()"><CODE>disconnect()</CODE></A>, this instance and all
the interfaces obtained from it become invalid, and will throw a
<A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception"><CODE>ConnectionLostException</CODE></A> on every operation. Once the connection is
lost, those instances cannot be recycled, but rather it is required to create
new ones and wait for a connection again.
<p>
Initially all pins are tri-stated (floating), and all functions are disabled.
Whenever a connection is lost or dropped, the board will immediately return
to the this initial state.
<p>
Typical usage:
<pre>
IOIO ioio = IOIOFactory.create();
try {
ioio.waitForConnect();
DigitalOutput out = ioio.openDigitalOutput(10);
out.write(true);
...
} catch (ConnectionLostException e) {
} catch (Exception e) {
ioio.disconnect();
} finally {
ioio.waitForDisconnect();
}
</pre>
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIOFactory.html#create()"><CODE>IOIOFactory.create()</CODE></A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.VersionType.html" title="enum in ioio.lib.api">IOIO.VersionType</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;A versioned component in the system.</TD>
</TR>
</TABLE>
&nbsp;<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#INVALID_PIN">INVALID_PIN</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An invalid pin number.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#LED_PIN">LED_PIN</A></B></CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The pin number used to designate the on-board 'stat' LED.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#disconnect()">disconnect</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Closes the connection to the board, or aborts a connection process
started with waitForConnect().</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#getImplVersion(ioio.lib.api.IOIO.VersionType)">getImplVersion</A></B>(<A HREF="../../../ioio/lib/api/IOIO.VersionType.html" title="enum in ioio.lib.api">IOIO.VersionType</A>&nbsp;v)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Query the implementation version of the system's components.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#hardReset()">hardReset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Equivalent to disconnecting and reconnecting the board power supply.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/AnalogInput.html" title="interface in ioio.lib.api">AnalogInput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openAnalogInput(int)">openAnalogInput</A></B>(int&nbsp;pin)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a pin for analog input.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/DigitalInput.html" title="interface in ioio.lib.api">DigitalInput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalInput(ioio.lib.api.DigitalInput.Spec)">openDigitalInput</A></B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;spec)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a pin for digital input.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/DigitalInput.html" title="interface in ioio.lib.api">DigitalInput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalInput(int)">openDigitalInput</A></B>(int&nbsp;pin)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for openDigitalInput(new DigitalInput.Spec(pin)).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/DigitalInput.html" title="interface in ioio.lib.api">DigitalInput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalInput(int, ioio.lib.api.DigitalInput.Spec.Mode)">openDigitalInput</A></B>(int&nbsp;pin,
<A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalInput.Spec.Mode</A>&nbsp;mode)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for openDigitalInput(new DigitalInput.Spec(pin, mode)).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)">openDigitalOutput</A></B>(<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;spec,
boolean&nbsp;startValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a pin for digital output.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalOutput(int)">openDigitalOutput</A></B>(int&nbsp;pin)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for openDigitalOutput(new DigitalOutput.Spec(pin), false).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalOutput(int, boolean)">openDigitalOutput</A></B>(int&nbsp;pin,
boolean&nbsp;startValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for openDigitalOutput(new DigitalOutput.Spec(pin), startValue).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalOutput(int, ioio.lib.api.DigitalOutput.Spec.Mode, boolean)">openDigitalOutput</A></B>(int&nbsp;pin,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalOutput.Spec.Mode</A>&nbsp;mode,
boolean&nbsp;startValue)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for openDigitalOutput(new DigitalOutput.Spec(pin, mode),
startValue).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/IcspMaster.html" title="interface in ioio.lib.api">IcspMaster</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openIcspMaster()">openIcspMaster</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open an ICSP channel, enabling Flash programming of an external PIC MCU,
and in particular, another IOIO board.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/PulseInput.html" title="interface in ioio.lib.api">PulseInput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openPulseInput(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.PulseInput.ClockRate, ioio.lib.api.PulseInput.PulseMode, boolean)">openPulseInput</A></B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;spec,
<A HREF="../../../ioio/lib/api/PulseInput.ClockRate.html" title="enum in ioio.lib.api">PulseInput.ClockRate</A>&nbsp;rate,
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A>&nbsp;mode,
boolean&nbsp;doublePrecision)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a pin for pulse input.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/PulseInput.html" title="interface in ioio.lib.api">PulseInput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openPulseInput(int, ioio.lib.api.PulseInput.PulseMode)">openPulseInput</A></B>(int&nbsp;pin,
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A>&nbsp;mode)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for openPulseInput(new DigitalInput.Spec(pin), rate, mode,
true), i.e.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/PwmOutput.html" title="interface in ioio.lib.api">PwmOutput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openPwmOutput(ioio.lib.api.DigitalOutput.Spec, int)">openPwmOutput</A></B>(<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;spec,
int&nbsp;freqHz)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a pin for PWM (Pulse-Width Modulation) output.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/PwmOutput.html" title="interface in ioio.lib.api">PwmOutput</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openPwmOutput(int, int)">openPwmOutput</A></B>(int&nbsp;pin,
int&nbsp;freqHz)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for openPwmOutput(new DigitalOutput.Spec(pin), freqHz).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/SpiMaster.html" title="interface in ioio.lib.api">SpiMaster</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config)">openSpiMaster</A></B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;miso,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;mosi,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;clk,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>[]&nbsp;slaveSelect,
<A HREF="../../../ioio/lib/api/SpiMaster.Config.html" title="class in ioio.lib.api">SpiMaster.Config</A>&nbsp;config)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a SPI master module, enabling communication with multiple
SPI-enabled slave modules.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/SpiMaster.html" title="interface in ioio.lib.api">SpiMaster</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openSpiMaster(int, int, int, int[], ioio.lib.api.SpiMaster.Rate)">openSpiMaster</A></B>(int&nbsp;miso,
int&nbsp;mosi,
int&nbsp;clk,
int[]&nbsp;slaveSelect,
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A>&nbsp;rate)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for {@link #openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config),
where the pins are all open with the default modes and default configuration values are used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/SpiMaster.html" title="interface in ioio.lib.api">SpiMaster</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openSpiMaster(int, int, int, int, ioio.lib.api.SpiMaster.Rate)">openSpiMaster</A></B>(int&nbsp;miso,
int&nbsp;mosi,
int&nbsp;clk,
int&nbsp;slaveSelect,
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A>&nbsp;rate)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for {@link #openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config),
where the MISO pins is opened with pull up, and the other pins are open
with the default modes and default configuration values are used.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/TwiMaster.html" title="interface in ioio.lib.api">TwiMaster</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openTwiMaster(int, ioio.lib.api.TwiMaster.Rate, boolean)">openTwiMaster</A></B>(int&nbsp;twiNum,
<A HREF="../../../ioio/lib/api/TwiMaster.Rate.html" title="enum in ioio.lib.api">TwiMaster.Rate</A>&nbsp;rate,
boolean&nbsp;smbus)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a TWI (Two-Wire Interface, such as I2C/SMBus) master module,
enabling communication with multiple TWI-enabled slave modules.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/Uart.html" title="interface in ioio.lib.api">Uart</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openUart(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, int, ioio.lib.api.Uart.Parity, ioio.lib.api.Uart.StopBits)">openUart</A></B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;rx,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;tx,
int&nbsp;baud,
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A>&nbsp;parity,
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A>&nbsp;stopbits)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Open a UART module, enabling a bulk transfer of byte buffers.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../ioio/lib/api/Uart.html" title="interface in ioio.lib.api">Uart</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#openUart(int, int, int, ioio.lib.api.Uart.Parity, ioio.lib.api.Uart.StopBits)">openUart</A></B>(int&nbsp;rx,
int&nbsp;tx,
int&nbsp;baud,
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A>&nbsp;parity,
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A>&nbsp;stopbits)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Shorthand for
<CODE>#openUart(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, int, Parity, StopBits)</CODE>
, where the input pins use their default specs.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#softReset()">softReset</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Resets the entire state (returning to initial state), without dropping
the connection.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()">waitForConnect</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Establishes connection with the IOIO board.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#waitForDisconnect()">waitForDisconnect</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Blocks until IOIO has been disconnected and all connection-related
resources have been freed, so that a new connection can be attempted.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="INVALID_PIN"><!-- --></A><H3>
INVALID_PIN</H3>
<PRE>
static final int <B>INVALID_PIN</B></PRE>
<DL>
<DD>An invalid pin number.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#ioio.lib.api.IOIO.INVALID_PIN">Constant Field Values</A></DL>
</DL>
<HR>
<A NAME="LED_PIN"><!-- --></A><H3>
LED_PIN</H3>
<PRE>
static final int <B>LED_PIN</B></PRE>
<DL>
<DD>The pin number used to designate the on-board 'stat' LED.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../constant-values.html#ioio.lib.api.IOIO.LED_PIN">Constant Field Values</A></DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="waitForConnect()"><!-- --></A><H3>
waitForConnect</H3>
<PRE>
void <B>waitForConnect</B>()
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A>,
<A HREF="../../../ioio/lib/api/exception/IncompatibilityException.html" title="class in ioio.lib.api.exception">IncompatibilityException</A></PRE>
<DL>
<DD>Establishes connection with the IOIO board.
<p>
This method is blocking until connection is established. This method can
be aborted by calling <A HREF="../../../ioio/lib/api/IOIO.html#disconnect()"><CODE>disconnect()</CODE></A>. In this case, it will throw
a <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception"><CODE>ConnectionLostException</CODE></A>.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - An error occurred during connection or disconnect() has been
called during connection. The instance state is disconnected.
<DD><CODE><A HREF="../../../ioio/lib/api/exception/IncompatibilityException.html" title="class in ioio.lib.api.exception">IncompatibilityException</A></CODE> - An incompatible board firmware of hardware has been detected.
The instance state is disconnected.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#disconnect()"><CODE>disconnect()</CODE></A>,
<A HREF="../../../ioio/lib/api/IOIO.html#waitForDisconnect()"><CODE>waitForDisconnect()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="disconnect()"><!-- --></A><H3>
disconnect</H3>
<PRE>
void <B>disconnect</B>()</PRE>
<DL>
<DD>Closes the connection to the board, or aborts a connection process
started with waitForConnect().
<p>
Once this method is called, this IOIO instance and all the instances
obtain from it become invalid and will throw an exception on every
operation.
<p>
This method is asynchronous, i.e. it returns immediately, but it is not
guaranteed that all connection-related resources has already been freed
and can be reused upon return. In cases when this is important, client
can call <A HREF="../../../ioio/lib/api/IOIO.html#waitForDisconnect()"><CODE>waitForDisconnect()</CODE></A>, which will block until all
resources have been freed.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="waitForDisconnect()"><!-- --></A><H3>
waitForDisconnect</H3>
<PRE>
void <B>waitForDisconnect</B>()
throws java.lang.InterruptedException</PRE>
<DL>
<DD>Blocks until IOIO has been disconnected and all connection-related
resources have been freed, so that a new connection can be attempted.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE>java.lang.InterruptedException</CODE> - When interrupt() has been called on this thread. This might
mean that an immediate attempt to create and connect a new
IOIO object might fail for resource contention.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#disconnect()"><CODE>disconnect()</CODE></A>,
<A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="softReset()"><!-- --></A><H3>
softReset</H3>
<PRE>
void <B>softReset</B>()
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Resets the entire state (returning to initial state), without dropping
the connection.
<p>
It is equivalent to calling <A HREF="../../../ioio/lib/api/Closeable.html#close()"><CODE>Closeable.close()</CODE></A> on every interface
obtained from this instance. A connection must have been established
prior to calling this method, by invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#hardReset()"><CODE>hardReset()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="hardReset()"><!-- --></A><H3>
hardReset</H3>
<PRE>
void <B>hardReset</B>()
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Equivalent to disconnecting and reconnecting the board power supply.
<p>
The connection will be dropped and not reestablished. Full boot sequence
will take place, so firmware upgrades can be performed. A connection must
have been established prior to calling this method, by invoking
<A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#softReset()"><CODE>softReset()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getImplVersion(ioio.lib.api.IOIO.VersionType)"><!-- --></A><H3>
getImplVersion</H3>
<PRE>
java.lang.String <B>getImplVersion</B>(<A HREF="../../../ioio/lib/api/IOIO.VersionType.html" title="enum in ioio.lib.api">IOIO.VersionType</A>&nbsp;v)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Query the implementation version of the system's components. The
implementation version uniquely identifies a hardware revision or a
software build. Returned version IDs are always 8-character long,
according to the IOIO versioning system: first 4 characters are the
version authority and last 4 characters are the revision.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>v</CODE> - The component whose version we query.
<DT><B>Returns:</B><DD>An 8-character implementation version ID.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.</DL>
</DD>
</DL>
<HR>
<A NAME="openDigitalInput(ioio.lib.api.DigitalInput.Spec)"><!-- --></A><H3>
openDigitalInput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/DigitalInput.html" title="interface in ioio.lib.api">DigitalInput</A> <B>openDigitalInput</B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;spec)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a pin for digital input.
<p>
A digital input pin can be used to read logic-level signals. The pin will
operate in this mode until close() is invoked on the returned interface.
It is illegal to open a pin that has already been opened and has not been
closed. A connection must have been established prior to calling this
method, by invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>spec</CODE> - Pin specification, consisting of the pin number, as labeled on
the board, and the mode, which determines whether the pin will
be floating, pull-up or pull-down. See
<A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalInput.Spec.Mode</CODE></A> for more information.
<DT><B>Returns:</B><DD>Interface of the assigned pin.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/DigitalInput.html" title="interface in ioio.lib.api"><CODE>DigitalInput</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openDigitalInput(int)"><!-- --></A><H3>
openDigitalInput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/DigitalInput.html" title="interface in ioio.lib.api">DigitalInput</A> <B>openDigitalInput</B>(int&nbsp;pin)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for openDigitalInput(new DigitalInput.Spec(pin)).
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalInput(ioio.lib.api.DigitalInput.Spec)"><CODE>openDigitalInput(ioio.lib.api.DigitalInput.Spec)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openDigitalInput(int, ioio.lib.api.DigitalInput.Spec.Mode)"><!-- --></A><H3>
openDigitalInput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/DigitalInput.html" title="interface in ioio.lib.api">DigitalInput</A> <B>openDigitalInput</B>(int&nbsp;pin,
<A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalInput.Spec.Mode</A>&nbsp;mode)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for openDigitalInput(new DigitalInput.Spec(pin, mode)).
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalInput(ioio.lib.api.DigitalInput.Spec)"><CODE>openDigitalInput(ioio.lib.api.DigitalInput.Spec)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)"><!-- --></A><H3>
openDigitalOutput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A> <B>openDigitalOutput</B>(<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;spec,
boolean&nbsp;startValue)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a pin for digital output.
<p>
A digital output pin can be used to generate logic-level signals. The pin
will operate in this mode until close() is invoked on the returned
interface. It is illegal to open a pin that has already been opened and
has not been closed. A connection must have been established prior to
calling this method, by invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>spec</CODE> - Pin specification, consisting of the pin number, as labeled on
the board, and the mode, which determines whether the pin will
be normal or open-drain. See <A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalOutput.Spec.Mode</CODE></A>
for more information.<DD><CODE>startValue</CODE> - The initial logic level this pin will generate as soon at it
is open.
<DT><B>Returns:</B><DD>Interface of the assigned pin.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api"><CODE>DigitalOutput</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openDigitalOutput(int, ioio.lib.api.DigitalOutput.Spec.Mode, boolean)"><!-- --></A><H3>
openDigitalOutput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A> <B>openDigitalOutput</B>(int&nbsp;pin,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalOutput.Spec.Mode</A>&nbsp;mode,
boolean&nbsp;startValue)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for openDigitalOutput(new DigitalOutput.Spec(pin, mode),
startValue).
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)"><CODE>openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openDigitalOutput(int, boolean)"><!-- --></A><H3>
openDigitalOutput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A> <B>openDigitalOutput</B>(int&nbsp;pin,
boolean&nbsp;startValue)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for openDigitalOutput(new DigitalOutput.Spec(pin), startValue).
Pin mode will be "normal" (as opposed to "open-drain".
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)"><CODE>openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openDigitalOutput(int)"><!-- --></A><H3>
openDigitalOutput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/DigitalOutput.html" title="interface in ioio.lib.api">DigitalOutput</A> <B>openDigitalOutput</B>(int&nbsp;pin)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for openDigitalOutput(new DigitalOutput.Spec(pin), false). Pin
mode will be "normal" (as opposed to "open-drain".
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)"><CODE>openDigitalOutput(ioio.lib.api.DigitalOutput.Spec, boolean)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openAnalogInput(int)"><!-- --></A><H3>
openAnalogInput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/AnalogInput.html" title="interface in ioio.lib.api">AnalogInput</A> <B>openAnalogInput</B>(int&nbsp;pin)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a pin for analog input.
<p>
An analog input pin can be used to measure voltage. Note that not every
pin can be used as an analog input. See board documentation for the legal
pins and permitted voltage range.
<p>
The pin will operate in this mode until close() is invoked on the
returned interface. It is illegal to open a pin that has already been
opened and has not been closed. A connection must have been established
prior to calling this method, by invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pin</CODE> - Pin number, as labeled on the board.
<DT><B>Returns:</B><DD>Interface of the assigned pin.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/AnalogInput.html" title="interface in ioio.lib.api"><CODE>AnalogInput</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openPwmOutput(ioio.lib.api.DigitalOutput.Spec, int)"><!-- --></A><H3>
openPwmOutput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/PwmOutput.html" title="interface in ioio.lib.api">PwmOutput</A> <B>openPwmOutput</B>(<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;spec,
int&nbsp;freqHz)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a pin for PWM (Pulse-Width Modulation) output.
<p>
A PWM pin produces a logic-level PWM signal. These signals are typically
used for simulating analog outputs for controlling the intensity of LEDs,
the rotation speed of motors, etc. They are also frequently used for
controlling hobby servo motors.
<p>
Note that not every pin can be used as PWM output. In addition, the total
number of concurrent PWM modules in use is limited. See board
documentation for the legal pins and limit on concurrent usage.
<p>
The pin will operate in this mode until close() is invoked on the
returned interface. It is illegal to open a pin that has already been
opened and has not been closed. A connection must have been established
prior to calling this method, by invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>spec</CODE> - Pin specification, consisting of the pin number, as labeled on
the board, and the mode, which determines whether the pin will
be normal or open-drain. See <A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalOutput.Spec.Mode</CODE></A>
for more information.<DD><CODE>freqHz</CODE> - PWM frequency, in Hertz.
<DT><B>Returns:</B><DD>Interface of the assigned pin.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.
<DD><CODE><A HREF="../../../ioio/lib/api/exception/OutOfResourceException.html" title="class in ioio.lib.api.exception">OutOfResourceException</A></CODE> - This is a runtime exception, so it is not necessary to catch
it if the client guarantees that the total number of
concurrent PWM resources is not exceeded.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/PwmOutput.html" title="interface in ioio.lib.api"><CODE>PwmOutput</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openPwmOutput(int, int)"><!-- --></A><H3>
openPwmOutput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/PwmOutput.html" title="interface in ioio.lib.api">PwmOutput</A> <B>openPwmOutput</B>(int&nbsp;pin,
int&nbsp;freqHz)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for openPwmOutput(new DigitalOutput.Spec(pin), freqHz).
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openPwmOutput(ioio.lib.api.DigitalOutput.Spec, int)"><CODE>openPwmOutput(ioio.lib.api.DigitalOutput.Spec, int)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openPulseInput(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.PulseInput.ClockRate, ioio.lib.api.PulseInput.PulseMode, boolean)"><!-- --></A><H3>
openPulseInput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/PulseInput.html" title="interface in ioio.lib.api">PulseInput</A> <B>openPulseInput</B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;spec,
<A HREF="../../../ioio/lib/api/PulseInput.ClockRate.html" title="enum in ioio.lib.api">PulseInput.ClockRate</A>&nbsp;rate,
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A>&nbsp;mode,
boolean&nbsp;doublePrecision)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a pin for pulse input.
<p>
The pulse input module is quite flexible. It enables several kinds of
timing measurements on a digital signal: pulse width measurement
(positive or negative pulse), and frequency of a periodic signal.
<p>
Note that not every pin can be used as pulse input. In addition, the
total number of concurrent pulse input modules in use is limited. See
board documentation for the legal pins and limit on concurrent usage.
<p>
The pin will operate in this mode until close() is invoked on the
returned interface. It is illegal to open a pin that has already been
opened and has not been closed. A connection must have been established
prior to calling this method, by invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>spec</CODE> - Pin specification, consisting of the pin number, as labeled on
the board, and the mode, which determines whether the pin will
be floating, pull-up or pull-down. See
<A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalInput.Spec.Mode</CODE></A> for more information.<DD><CODE>rate</CODE> - The clock rate to use for timing the signal. A faster clock
rate will result in better precision but will only be able to
measure narrow pulses / high frequencies.<DD><CODE>mode</CODE> - The mode in which to operate. Determines whether the module
will measure pulse durations or frequency.<DD><CODE>doublePrecision</CODE> - Whether to open a double-precision pulse input module. Double-
precision modules enable reading of much longer pulses and
lower frequencies with high accuracy than single precision
modules. However, their number is limited, so when possible,
and if the resources are all needed, use single-precision. For
more details on the exact spec of single- vs. double-
precision, see <A HREF="../../../ioio/lib/api/PulseInput.html" title="interface in ioio.lib.api"><CODE>PulseInput</CODE></A>.
<DT><B>Returns:</B><DD>An instance of the <A HREF="../../../ioio/lib/api/PulseInput.html" title="interface in ioio.lib.api"><CODE>PulseInput</CODE></A>, which can be used to
obtain the data.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.
<DD><CODE><A HREF="../../../ioio/lib/api/exception/OutOfResourceException.html" title="class in ioio.lib.api.exception">OutOfResourceException</A></CODE> - This is a runtime exception, so it is not necessary to catch
it if the client guarantees that the total number of
concurrent PWM resources is not exceeded.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/PulseInput.html" title="interface in ioio.lib.api"><CODE>PulseInput</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openPulseInput(int, ioio.lib.api.PulseInput.PulseMode)"><!-- --></A><H3>
openPulseInput</H3>
<PRE>
<A HREF="../../../ioio/lib/api/PulseInput.html" title="interface in ioio.lib.api">PulseInput</A> <B>openPulseInput</B>(int&nbsp;pin,
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A>&nbsp;mode)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for openPulseInput(new DigitalInput.Spec(pin), rate, mode,
true), i.e. opens a double-precision, 16MHz pulse input on the given pin
with the given mode.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><CODE>#openPulseInput(ioio.lib.api.DigitalInput.Spec,
ioio.lib.api.PulseInput.ClockRate, PulseMode, boolean)</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="openUart(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, int, ioio.lib.api.Uart.Parity, ioio.lib.api.Uart.StopBits)"><!-- --></A><H3>
openUart</H3>
<PRE>
<A HREF="../../../ioio/lib/api/Uart.html" title="interface in ioio.lib.api">Uart</A> <B>openUart</B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;rx,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;tx,
int&nbsp;baud,
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A>&nbsp;parity,
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A>&nbsp;stopbits)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a UART module, enabling a bulk transfer of byte buffers.
<p>
UART is a very common hardware communication protocol, enabling full-
duplex, asynchronous point-to-point data transfer. It typically serves
for opening consoles or as a basis for higher-level protocols, such as
MIDI RS-232, and RS-485.
<p>
Note that not every pin can be used for UART RX or TX. In addition, the
total number of concurrent UART modules in use is limited. See board
documentation for the legal pins and limit on concurrent usage.
<p>
The UART module will operate, and the pins will work in their respective
modes until close() is invoked on the returned interface. It is illegal
to use pins that have already been opened and has not been closed. A
connection must have been established prior to calling this method, by
invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>rx</CODE> - Pin specification for the RX pin, consisting of the pin
number, as labeled on the board, and the mode, which
determines whether the pin will be floating, pull-up or
pull-down. See <A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalInput.Spec.Mode</CODE></A> for more
information. null can be passed to designate that we do not
want RX input to this module.<DD><CODE>tx</CODE> - Pin specification for the TX pin, consisting of the pin
number, as labeled on the board, and the mode, which
determines whether the pin will be normal or open-drain. See
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalOutput.Spec.Mode</CODE></A> for more information. null can
be passed to designate that we do not want TX output to this
module.<DD><CODE>baud</CODE> - The clock frequency of the UART module in Hz.<DD><CODE>parity</CODE> - The parity mode, as in <A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api"><CODE>Uart.Parity</CODE></A>.<DD><CODE>stopbits</CODE> - Number of stop bits, as in <A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api"><CODE>Uart.StopBits</CODE></A>.
<DT><B>Returns:</B><DD>Interface of the assigned module.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.
<DD><CODE><A HREF="../../../ioio/lib/api/exception/OutOfResourceException.html" title="class in ioio.lib.api.exception">OutOfResourceException</A></CODE> - This is a runtime exception, so it is not necessary to catch
it if the client guarantees that the total number of
concurrent UART resources is not exceeded.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/Uart.html" title="interface in ioio.lib.api"><CODE>Uart</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openUart(int, int, int, ioio.lib.api.Uart.Parity, ioio.lib.api.Uart.StopBits)"><!-- --></A><H3>
openUart</H3>
<PRE>
<A HREF="../../../ioio/lib/api/Uart.html" title="interface in ioio.lib.api">Uart</A> <B>openUart</B>(int&nbsp;rx,
int&nbsp;tx,
int&nbsp;baud,
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A>&nbsp;parity,
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A>&nbsp;stopbits)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for
<CODE>#openUart(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, int, Parity, StopBits)</CODE>
, where the input pins use their default specs. <A HREF="../../../ioio/lib/api/IOIO.html#INVALID_PIN"><CODE>INVALID_PIN</CODE></A> can
be used on either pin if a TX- or RX-only UART is needed.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><CODE>#openUart(ioio.lib.api.DigitalInput.Spec,
ioio.lib.api.DigitalOutput.Spec, int, Parity, StopBits)</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config)"><!-- --></A><H3>
openSpiMaster</H3>
<PRE>
<A HREF="../../../ioio/lib/api/SpiMaster.html" title="interface in ioio.lib.api">SpiMaster</A> <B>openSpiMaster</B>(<A HREF="../../../ioio/lib/api/DigitalInput.Spec.html" title="class in ioio.lib.api">DigitalInput.Spec</A>&nbsp;miso,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;mosi,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>&nbsp;clk,
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>[]&nbsp;slaveSelect,
<A HREF="../../../ioio/lib/api/SpiMaster.Config.html" title="class in ioio.lib.api">SpiMaster.Config</A>&nbsp;config)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a SPI master module, enabling communication with multiple
SPI-enabled slave modules.
<p>
SPI is a common hardware communication protocol, enabling full-duplex,
synchronous point-to-multi-point data transfer. It requires MOSI, MISO
and CLK lines shared by all nodes, as well as a SS line per slave,
connected between this slave and a respective pin on the master. The MISO
line should operate in pull-up mode, using either the internal pull-up or
an external resistor.
<p>
Note that not every pin can be used for SPI MISO, MOSI or CLK. In
addition, the total number of concurrent SPI modules in use is limited.
See board documentation for the legal pins and limit on concurrent usage.
<p>
The SPI module will operate, and the pins will work in their respective
modes until close() is invoked on the returned interface. It is illegal
to use pins that have already been opened and has not been closed. A
connection must have been established prior to calling this method, by
invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>miso</CODE> - Pin specification for the MISO (Master In Slave Out) pin,
consisting of the pin number, as labeled on the board, and the
mode, which determines whether the pin will be floating,
pull-up or pull-down. See <A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalInput.Spec.Mode</CODE></A> for
more information.<DD><CODE>mosi</CODE> - Pin specification for the MOSI (Master Out Slave In) pin,
consisting of the pin number, as labeled on the board, and the
mode, which determines whether the pin will be normal or
open-drain. See <A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalOutput.Spec.Mode</CODE></A> for more
information.<DD><CODE>clk</CODE> - Pin specification for the CLK pin, consisting of the pin
number, as labeled on the board, and the mode, which
determines whether the pin will be normal or open-drain. See
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalOutput.Spec.Mode</CODE></A> for more information.<DD><CODE>slaveSelect</CODE> - An array of pin specifications for each of the slaves' SS
(Slave Select) pin. The index of this array designates the
slave index, used later to refer to this slave. The spec is
consisting of the pin number, as labeled on the board, and the
mode, which determines whether the pin will be normal or
open-drain. See <A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api"><CODE>DigitalOutput.Spec.Mode</CODE></A> for more
information.<DD><CODE>config</CODE> - The configuration of the SPI module. See
<A HREF="../../../ioio/lib/api/SpiMaster.Config.html" title="class in ioio.lib.api"><CODE>SpiMaster.Config</CODE></A> for details.
<DT><B>Returns:</B><DD>Interface of the assigned module.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.
<DD><CODE><A HREF="../../../ioio/lib/api/exception/OutOfResourceException.html" title="class in ioio.lib.api.exception">OutOfResourceException</A></CODE> - This is a runtime exception, so it is not necessary to catch
it if the client guarantees that the total number of
concurrent SPI resources is not exceeded.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/SpiMaster.html" title="interface in ioio.lib.api"><CODE>SpiMaster</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openSpiMaster(int, int, int, int[], ioio.lib.api.SpiMaster.Rate)"><!-- --></A><H3>
openSpiMaster</H3>
<PRE>
<A HREF="../../../ioio/lib/api/SpiMaster.html" title="interface in ioio.lib.api">SpiMaster</A> <B>openSpiMaster</B>(int&nbsp;miso,
int&nbsp;mosi,
int&nbsp;clk,
int[]&nbsp;slaveSelect,
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A>&nbsp;rate)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for {@link #openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config),
where the pins are all open with the default modes and default configuration values are used.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config)"><CODE>openSpiMaster(ioio.lib.api.DigitalInput.Spec,
ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec,
ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openSpiMaster(int, int, int, int, ioio.lib.api.SpiMaster.Rate)"><!-- --></A><H3>
openSpiMaster</H3>
<PRE>
<A HREF="../../../ioio/lib/api/SpiMaster.html" title="interface in ioio.lib.api">SpiMaster</A> <B>openSpiMaster</B>(int&nbsp;miso,
int&nbsp;mosi,
int&nbsp;clk,
int&nbsp;slaveSelect,
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A>&nbsp;rate)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Shorthand for {@link #openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config),
where the MISO pins is opened with pull up, and the other pins are open
with the default modes and default configuration values are used.
In this version, a single slave is used.
<P>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IOIO.html#openSpiMaster(ioio.lib.api.DigitalInput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config)"><CODE>openSpiMaster(ioio.lib.api.DigitalInput.Spec,
ioio.lib.api.DigitalOutput.Spec, ioio.lib.api.DigitalOutput.Spec,
ioio.lib.api.DigitalOutput.Spec[], ioio.lib.api.SpiMaster.Config)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openTwiMaster(int, ioio.lib.api.TwiMaster.Rate, boolean)"><!-- --></A><H3>
openTwiMaster</H3>
<PRE>
<A HREF="../../../ioio/lib/api/TwiMaster.html" title="interface in ioio.lib.api">TwiMaster</A> <B>openTwiMaster</B>(int&nbsp;twiNum,
<A HREF="../../../ioio/lib/api/TwiMaster.Rate.html" title="enum in ioio.lib.api">TwiMaster.Rate</A>&nbsp;rate,
boolean&nbsp;smbus)
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open a TWI (Two-Wire Interface, such as I2C/SMBus) master module,
enabling communication with multiple TWI-enabled slave modules.
<p>
TWI is a common hardware communication protocol, enabling half-duplex,
synchronous point-to-multi-point data transfer. It requires a physical
connection of two lines (SDA, SCL) shared by all the bus nodes, where the
SDA is open-drain and externally pulled-up.
<p>
Note that there is a fixed number of TWI modules, and the pins they use
are static. Client has to make sure these pins are not already opened
before calling this method. See board documentation for the number of
modules and the respective pins they use.
<p>
The TWI module will operate, and the pins will work in their respective
modes until close() is invoked on the returned interface. It is illegal
to use pins that have already been opened and has not been closed. A
connection must have been established prior to calling this method, by
invoking <A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()"><CODE>waitForConnect()</CODE></A>.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>twiNum</CODE> - The TWI module index to use. Will also determine the pins
used.<DD><CODE>rate</CODE> - The clock rate. Can be 100KHz / 400KHz / 1MHz.<DD><CODE>smbus</CODE> - When true, will use SMBus voltage levels. When false, I2C
voltage levels.
<DT><B>Returns:</B><DD>Interface of the assigned module.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/TwiMaster.html" title="interface in ioio.lib.api"><CODE>TwiMaster</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="openIcspMaster()"><!-- --></A><H3>
openIcspMaster</H3>
<PRE>
<A HREF="../../../ioio/lib/api/IcspMaster.html" title="interface in ioio.lib.api">IcspMaster</A> <B>openIcspMaster</B>()
throws <A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></PRE>
<DL>
<DD>Open an ICSP channel, enabling Flash programming of an external PIC MCU,
and in particular, another IOIO board.
<p>
ICSP (In-Circuit Serial Programming) is a protocol intended for
programming of PIC MCUs. It is a serial protocol over three wires: PGC
(clock), PGD (data) and MCLR (reset), where PGC and MCLR are controlled
by the master and PGD is shared by the master and slave, depending on the
transaction state.
<p>
Note that there is only one ICSP modules, and the pins it uses are
static. Client has to make sure that the ICSP module is not already in
use, as well as those dedicated pins. See board documentation for the
actual pins used for ICSP.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Interface of the ICSP module.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../ioio/lib/api/exception/ConnectionLostException.html" title="class in ioio.lib.api.exception">ConnectionLostException</A></CODE> - Connection was lost before or during the execution of this
method.<DT><B>See Also:</B><DD><A HREF="../../../ioio/lib/api/IcspMaster.html" title="interface in ioio.lib.api"><CODE>IcspMaster</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IOIO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../ioio/lib/api/IcspMaster.html" title="interface in ioio.lib.api"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../ioio/lib/api/IOIO.VersionType.html" title="enum in ioio.lib.api"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?ioio/lib/api/IOIO.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="IOIO.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
</BODY>
</HTML>