本文整理汇总了Java中ioio.lib.api.Uart.Parity方法的典型用法代码示例。如果您正苦于以下问题:Java Uart.Parity方法的具体用法?Java Uart.Parity怎么用?Java Uart.Parity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ioio.lib.api.Uart
的用法示例。
在下文中一共展示了Uart.Parity方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: uartConfigure
import ioio.lib.api.Uart; //导入方法依赖的package包/类
synchronized public void uartConfigure(int uartNum, int rate,
boolean speed4x, Uart.StopBits stopbits, Uart.Parity parity)
throws IOException {
int parbits = parity == Uart.Parity.EVEN ? 1
: (parity == Uart.Parity.ODD ? 2 : 0);
beginBatch();
writeByte(UART_CONFIG);
writeByte((uartNum << 6) | (speed4x ? 0x08 : 0x00)
| (stopbits == Uart.StopBits.TWO ? 0x04 : 0x00) | parbits);
writeTwoBytes(rate);
endBatch();
}
示例2: openUart
import ioio.lib.api.Uart; //导入方法依赖的package包/类
@Override
public Uart openUart(int rx, int tx, int baud, Uart.Parity parity,
Uart.StopBits stopbits) throws ConnectionLostException {
return openUart(rx == INVALID_PIN ? null : new DigitalInput.Spec(rx),
tx == INVALID_PIN ? null : new DigitalOutput.Spec(tx), baud,
parity, stopbits);
}
示例3: uartConfigure
import ioio.lib.api.Uart; //导入方法依赖的package包/类
synchronized public void uartConfigure(int uartNum, int rate, boolean speed4x,
Uart.StopBits stopbits, Uart.Parity parity) throws IOException {
int parbits = parity == Uart.Parity.EVEN ? 1 : (parity == Uart.Parity.ODD ? 2 : 0);
beginBatch();
writeByte(UART_CONFIG);
writeByte((uartNum << 6) | (speed4x ? 0x08 : 0x00)
| (stopbits == Uart.StopBits.TWO ? 0x04 : 0x00) | parbits);
writeTwoBytes(rate);
endBatch();
}
示例4: openUart
import ioio.lib.api.Uart; //导入方法依赖的package包/类
@Override
public Uart openUart(int rx, int tx, int baud, Uart.Parity parity,
Uart.StopBits stopbits) throws ConnectionLostException {
return openUart(rx == INVALID_PIN ? null : new DigitalInput.Spec(rx),
tx == INVALID_PIN ? null : new DigitalOutput.Spec(tx), baud,
parity, stopbits);
}
示例5: uartConfigure
import ioio.lib.api.Uart; //导入方法依赖的package包/类
synchronized public void uartConfigure(int uartNum, int rate, boolean speed4x,
Uart.StopBits stopbits, Uart.Parity parity) throws IOException {
int parbits = parity == Uart.Parity.EVEN ? 1 : (parity == Uart.Parity.ODD ? 2 : 0);
beginBatch();
writeByte(UART_CONFIG);
writeByte((uartNum << 6) | (speed4x ? 0x08 : 0x00)
| (stopbits == Uart.StopBits.TWO ? 0x04 : 0x00) | parbits);
writeTwoBytes(rate);
endBatch();
}