// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/PulseInput.java
// public enum PulseMode {
//     /**
//      * Positive pulse measurement (rising-edge-to-falling-edge).
//      */
//     POSITIVE(1),
//     /**
//      * Negative pulse measurement (falling-edge-to-rising-edge).
//      */
//     NEGATIVE(1),
//     /**
//      * Frequency measurement (rising-edge-to-rising-edge).
//      */
//     FREQ(1),
//     /**
//      * Frequency measurement (rising-edge-to-rising-edge) with 4x scaling.
//      */
//     FREQ_SCALE_4(4),
//     /**
//      * Frequency measurement (rising-edge-to-rising-edge) with 16x scaling.
//      */
//     FREQ_SCALE_16(16);
// 
//     /**
//      * The scaling factor as an integer.
//      */
//     public final int scaling;
// 
//     private PulseMode(int s) {
//         scaling = s;
//     }
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/TwiMaster.java
// enum Rate {
//     RATE_100KHz, RATE_400KHz, RATE_1MHz
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/Uart.java
// enum Parity {
//     /**
//      * No parity.
//      */
//     NONE,
//     /**
//      * Even parity.
//      */
//     EVEN,
//     /**
//      * Odd parity.
//      */
//     ODD
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/Uart.java
// enum StopBits {
//     /**
//      * One stop bit.
//      */
//     ONE,
//     /**
//      * Two stop bits.
//      */
//     TWO
// }


import ioio.lib.api.PulseInput.PulseMode;
import ioio.lib.api.TwiMaster.Rate;
import ioio.lib.api.Uart.Parity;
import ioio.lib.api.Uart.StopBits;
import ioio.lib.api.exception.ConnectionLostException;
import ioio.lib.api.exception.IncompatibilityException;
import ioio.lib.api.exception.OutOfResourceException;
import java.io.Closeable;
     * 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 {@link #waitForConnect()}.
     *
     * @param spec            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
     *                        {@link DigitalInput.Spec.Mode} for more information.
     * @param rate            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.
     * @param mode            The mode in which to operate. Determines whether the module will measure pulse
     *                        durations or frequency.
     * @param doublePrecision 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 {@link PulseInput}.
     * @return An instance of the {@link PulseInput}, which can be used to obtain the data.
     * @throws ConnectionLostException Connection was lost before or during the execution of this method.
     * @throws OutOfResourceException  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.
     * @see PulseInput
     */
    public PulseInput openPulseInput(DigitalInput.Spec spec, PulseInput.ClockRate rate,
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/PulseInput.java
// public enum PulseMode {
//     /**
//      * Positive pulse measurement (rising-edge-to-falling-edge).
//      */
//     POSITIVE(1),
//     /**
//      * Negative pulse measurement (falling-edge-to-rising-edge).
//      */
//     NEGATIVE(1),
//     /**
//      * Frequency measurement (rising-edge-to-rising-edge).
//      */
//     FREQ(1),
//     /**
//      * Frequency measurement (rising-edge-to-rising-edge) with 4x scaling.
//      */
//     FREQ_SCALE_4(4),
//     /**
//      * Frequency measurement (rising-edge-to-rising-edge) with 16x scaling.
//      */
//     FREQ_SCALE_16(16);
// 
//     /**
//      * The scaling factor as an integer.
//      */
//     public final int scaling;
// 
//     private PulseMode(int s) {
//         scaling = s;
//     }
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/TwiMaster.java
// enum Rate {
//     RATE_100KHz, RATE_400KHz, RATE_1MHz
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/Uart.java
// enum Parity {
//     /**
//      * No parity.
//      */
//     NONE,
//     /**
//      * Even parity.
//      */
//     EVEN,
//     /**
//      * Odd parity.
//      */
//     ODD
// }
// 
// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/Uart.java
// enum StopBits {
//     /**
//      * One stop bit.
//      */
//     ONE,
//     /**
//      * Two stop bits.
//      */
//     TWO
// }


// Path: IOIO/iOIOLibAndroid/src/main/java/ioio/lib/api/IOIO.java
import ioio.lib.api.PulseInput.PulseMode;
import ioio.lib.api.TwiMaster.Rate;
import ioio.lib.api.Uart.Parity;
import ioio.lib.api.Uart.StopBits;
import ioio.lib.api.exception.ConnectionLostException;
import ioio.lib.api.exception.IncompatibilityException;
import ioio.lib.api.exception.OutOfResourceException;
import java.io.Closeable;

     * 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 {@link #waitForConnect()}.
     *
     * @param spec            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
     *                        {@link DigitalInput.Spec.Mode} for more information.
     * @param rate            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.
     * @param mode            The mode in which to operate. Determines whether the module will measure pulse
     *                        durations or frequency.
     * @param doublePrecision 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 {@link PulseInput}.
     * @return An instance of the {@link PulseInput}, which can be used to obtain the data.
     * @throws ConnectionLostException Connection was lost before or during the execution of this method.
     * @throws OutOfResourceException  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.
     * @see PulseInput
     */
    public PulseInput openPulseInput(DigitalInput.Spec spec, PulseInput.ClockRate rate,
                                     PulseInput.PulseMode mode, boolean doublePrecision) throws ConnectionLostException;