// 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;
     * 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 {@link #waitForConnect()}.
     *
     * @param rx       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 {@link DigitalInput.Spec.Mode} for more information. null can be
     *                 passed to designate that we do not want RX input to this module.
     * @param tx       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 {@link DigitalOutput.Spec.Mode} for more information. null can be
     *                 passed to designate that we do not want TX output to this module.
     * @param baud     The clock frequency of the UART module in Hz.
     * @param parity   The parity mode, as in {@link Parity}.
     * @param stopbits Number of stop bits, as in {@link StopBits}.
     * @return Interface of the assigned module.
     * @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 UART resources is not exceeded.
     * @see Uart
     */
    public Uart openUart(DigitalInput.Spec rx, DigitalOutput.Spec tx, int baud, Parity parity,
// 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;

     * 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 {@link #waitForConnect()}.
     *
     * @param rx       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 {@link DigitalInput.Spec.Mode} for more information. null can be
     *                 passed to designate that we do not want RX input to this module.
     * @param tx       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 {@link DigitalOutput.Spec.Mode} for more information. null can be
     *                 passed to designate that we do not want TX output to this module.
     * @param baud     The clock frequency of the UART module in Hz.
     * @param parity   The parity mode, as in {@link Parity}.
     * @param stopbits Number of stop bits, as in {@link StopBits}.
     * @return Interface of the assigned module.
     * @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 UART resources is not exceeded.
     * @see Uart
     */
    public Uart openUart(DigitalInput.Spec rx, DigitalOutput.Spec tx, int baud, Parity parity,
                         StopBits stopbits) throws ConnectionLostException;