当前位置: 首页>>代码示例>>Java>>正文


Java Parity类代码示例

本文整理汇总了Java中ioio.lib.api.Uart.Parity的典型用法代码示例。如果您正苦于以下问题:Java Parity类的具体用法?Java Parity怎么用?Java Parity使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Parity类属于ioio.lib.api.Uart包,在下文中一共展示了Parity类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createIOIOLooper

import ioio.lib.api.Uart.Parity; //导入依赖的package包/类
/** Creates a new connection to an Xbee device.
 *
 * This must be constructed inside a BaseIOIOLooper constructor. Example:
 *<pre>{@code {@literal @}Override
protected IOIOLooper createIOIOLooper() {
return new BaseIOIOLooper() {
{@literal @}Override
protected void setup() throws ConnectionLostException {
Xbee xbee = new Xbee(ioio_, 45, 46, 9600);
}
}
 *}</pre>
 * @param ioio The IOIO device to connect through.
 * @param rX_pin The receiver pin. Must be 3.3V tolerant and must support UART/USART connection.
 * @param tX_pin The transmitter pin. Must be 3.3V tolerant and must support UART/USART connection.
 * @param baud_rate The baud rate of the connection. Must match the baud rate of the Xbee device.
 * The supported standard baud rates are 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 bps, and any non-standard
 * baud rates in the range 0x80 - 0x3D090 bps.
 * @throws ConnectionLostException Thrown when the connection to the IOIO has been lost or disconnected.
 *
 */
public Xbee(IOIO ioio, int rX_pin, int tX_pin, int baud_rate) throws ConnectionLostException{

    this.Ioio = ioio;
    this.Baud_rate = baud_rate;

    Uart = ioio.openUart(rX_pin, tX_pin, baud_rate, Parity.NONE, StopBits.ONE);
    In = Uart.getInputStream();
    Out = Uart.getOutputStream();

    InReader = new BufferedReader(new InputStreamReader(In));
    OutWriter = new BufferedWriter(new OutputStreamWriter(Out));

}
 
开发者ID:zaiddabaeen,项目名称:XBeeIOIO,代码行数:35,代码来源:Xbee.java

示例2: openUart

import ioio.lib.api.Uart.Parity; //导入依赖的package包/类
/**
 * 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 {@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;
 
开发者ID:jrieke,项目名称:ioiometer,代码行数:51,代码来源:IOIO.java

示例3: openUart

import ioio.lib.api.Uart.Parity; //导入依赖的package包/类
/**
 * 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 {@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;
 
开发者ID:flyver,项目名称:Flyver-Apps,代码行数:36,代码来源:IOIO.java

示例4: openUart

import ioio.lib.api.Uart.Parity; //导入依赖的package包/类
/**
 * 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 {@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;
 
开发者ID:edarn,项目名称:kryp-client,代码行数:43,代码来源:IOIO.java


注:本文中的ioio.lib.api.Uart.Parity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。