1242 lines
72 KiB
HTML
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> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IOIO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
</EM>
|
|
</TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../ioio/lib/api/IcspMaster.html" title="interface in ioio.lib.api"><B>PREV CLASS</B></A>
|
|
<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>
|
|
<A HREF="IOIO.html" target="_top"><B>NO FRAMES</B></A>
|
|
<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: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <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 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>
|
|
A versioned component in the system.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
<!-- =========== 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 int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#INVALID_PIN">INVALID_PIN</A></B></CODE>
|
|
|
|
<BR>
|
|
An invalid pin number.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE>static int</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#LED_PIN">LED_PIN</A></B></CODE>
|
|
|
|
<BR>
|
|
The pin number used to designate the on-board 'stat' LED.</TD>
|
|
</TR>
|
|
</TABLE>
|
|
|
|
<!-- ========== 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> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#disconnect()">disconnect</A></B>()</CODE>
|
|
|
|
<BR>
|
|
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> 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> v)</CODE>
|
|
|
|
<BR>
|
|
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> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#hardReset()">hardReset</A></B>()</CODE>
|
|
|
|
<BR>
|
|
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> <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 pin)</CODE>
|
|
|
|
<BR>
|
|
Open a pin for analog input.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <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> spec)</CODE>
|
|
|
|
<BR>
|
|
Open a pin for digital input.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <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 pin)</CODE>
|
|
|
|
<BR>
|
|
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> <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 pin,
|
|
<A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalInput.Spec.Mode</A> mode)</CODE>
|
|
|
|
<BR>
|
|
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> <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> spec,
|
|
boolean startValue)</CODE>
|
|
|
|
<BR>
|
|
Open a pin for digital output.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <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 pin)</CODE>
|
|
|
|
<BR>
|
|
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> <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 pin,
|
|
boolean startValue)</CODE>
|
|
|
|
<BR>
|
|
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> <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 pin,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalOutput.Spec.Mode</A> mode,
|
|
boolean startValue)</CODE>
|
|
|
|
<BR>
|
|
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> <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>
|
|
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> <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> spec,
|
|
<A HREF="../../../ioio/lib/api/PulseInput.ClockRate.html" title="enum in ioio.lib.api">PulseInput.ClockRate</A> rate,
|
|
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A> mode,
|
|
boolean doublePrecision)</CODE>
|
|
|
|
<BR>
|
|
Open a pin for pulse input.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> <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 pin,
|
|
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A> mode)</CODE>
|
|
|
|
<BR>
|
|
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> <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> spec,
|
|
int freqHz)</CODE>
|
|
|
|
<BR>
|
|
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> <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 pin,
|
|
int freqHz)</CODE>
|
|
|
|
<BR>
|
|
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> <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> miso,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A> mosi,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A> clk,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>[] slaveSelect,
|
|
<A HREF="../../../ioio/lib/api/SpiMaster.Config.html" title="class in ioio.lib.api">SpiMaster.Config</A> config)</CODE>
|
|
|
|
<BR>
|
|
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> <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 miso,
|
|
int mosi,
|
|
int clk,
|
|
int[] slaveSelect,
|
|
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A> rate)</CODE>
|
|
|
|
<BR>
|
|
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> <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 miso,
|
|
int mosi,
|
|
int clk,
|
|
int slaveSelect,
|
|
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A> rate)</CODE>
|
|
|
|
<BR>
|
|
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> <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 twiNum,
|
|
<A HREF="../../../ioio/lib/api/TwiMaster.Rate.html" title="enum in ioio.lib.api">TwiMaster.Rate</A> rate,
|
|
boolean smbus)</CODE>
|
|
|
|
<BR>
|
|
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> <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> rx,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A> tx,
|
|
int baud,
|
|
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A> parity,
|
|
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A> stopbits)</CODE>
|
|
|
|
<BR>
|
|
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> <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 rx,
|
|
int tx,
|
|
int baud,
|
|
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A> parity,
|
|
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A> stopbits)</CODE>
|
|
|
|
<BR>
|
|
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> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#softReset()">softReset</A></B>()</CODE>
|
|
|
|
<BR>
|
|
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> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#waitForConnect()">waitForConnect</A></B>()</CODE>
|
|
|
|
<BR>
|
|
Establishes connection with the IOIO board.</TD>
|
|
</TR>
|
|
<TR BGCOLOR="white" CLASS="TableRowColor">
|
|
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
|
|
<CODE> void</CODE></FONT></TD>
|
|
<TD><CODE><B><A HREF="../../../ioio/lib/api/IOIO.html#waitForDisconnect()">waitForDisconnect</A></B>()</CODE>
|
|
|
|
<BR>
|
|
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>
|
|
|
|
<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> 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> 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 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 pin,
|
|
<A HREF="../../../ioio/lib/api/DigitalInput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalInput.Spec.Mode</A> 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> spec,
|
|
boolean 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 pin,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.Mode.html" title="enum in ioio.lib.api">DigitalOutput.Spec.Mode</A> mode,
|
|
boolean 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 pin,
|
|
boolean 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 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 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> spec,
|
|
int 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 pin,
|
|
int 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> spec,
|
|
<A HREF="../../../ioio/lib/api/PulseInput.ClockRate.html" title="enum in ioio.lib.api">PulseInput.ClockRate</A> rate,
|
|
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A> mode,
|
|
boolean 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 pin,
|
|
<A HREF="../../../ioio/lib/api/PulseInput.PulseMode.html" title="enum in ioio.lib.api">PulseInput.PulseMode</A> 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> rx,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A> tx,
|
|
int baud,
|
|
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A> parity,
|
|
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A> 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 rx,
|
|
int tx,
|
|
int baud,
|
|
<A HREF="../../../ioio/lib/api/Uart.Parity.html" title="enum in ioio.lib.api">Uart.Parity</A> parity,
|
|
<A HREF="../../../ioio/lib/api/Uart.StopBits.html" title="enum in ioio.lib.api">Uart.StopBits</A> 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> miso,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A> mosi,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A> clk,
|
|
<A HREF="../../../ioio/lib/api/DigitalOutput.Spec.html" title="class in ioio.lib.api">DigitalOutput.Spec</A>[] slaveSelect,
|
|
<A HREF="../../../ioio/lib/api/SpiMaster.Config.html" title="class in ioio.lib.api">SpiMaster.Config</A> 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 miso,
|
|
int mosi,
|
|
int clk,
|
|
int[] slaveSelect,
|
|
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A> 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 miso,
|
|
int mosi,
|
|
int clk,
|
|
int slaveSelect,
|
|
<A HREF="../../../ioio/lib/api/SpiMaster.Rate.html" title="enum in ioio.lib.api">SpiMaster.Rate</A> 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 twiNum,
|
|
<A HREF="../../../ioio/lib/api/TwiMaster.Rate.html" title="enum in ioio.lib.api">TwiMaster.Rate</A> rate,
|
|
boolean 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> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/IOIO.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
|
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
|
</TR>
|
|
</TABLE>
|
|
</TD>
|
|
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
|
</EM>
|
|
</TD>
|
|
</TR>
|
|
|
|
<TR>
|
|
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
|
<A HREF="../../../ioio/lib/api/IcspMaster.html" title="interface in ioio.lib.api"><B>PREV CLASS</B></A>
|
|
<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>
|
|
<A HREF="IOIO.html" target="_top"><B>NO FRAMES</B></A>
|
|
<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: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD>
|
|
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
|
|
DETAIL: <A HREF="#field_detail">FIELD</A> | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD>
|
|
</TR>
|
|
</TABLE>
|
|
<A NAME="skip-navbar_bottom"></A>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
|
|
<HR>
|
|
|
|
</BODY>
|
|
</HTML>
|