Class UARTInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.deepjava.runtime.mpc5200.driver.UARTInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Modified
public class UARTInputStream extends InputStream
Input Stream to read bytes from an UART interface. Don't forget to initialize the interface before using this class.
-
-
Constructor Summary
Constructors Constructor Description UARTInputStream(int uart)
Creates an input stream on a given SCI interface.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
available()
Returns the number of bytes available from the stream.int
read()
Reads one byte from the UART3.int
read(byte[] buffer)
Reads the given number of bytes from the UART3.int
read(byte[] buffer, int off, int count)
Reads the given number of bytes from the UART3.-
Methods inherited from class java.io.InputStream
close, mark, markSupported, reset
-
-
-
-
Field Detail
-
pPSC1
public static final int pPSC1
- See Also:
- Constant Field Values
-
pPSC2
public static final int pPSC2
- See Also:
- Constant Field Values
-
pPSC3
public static final int pPSC3
- See Also:
- Constant Field Values
-
pPSC4
public static final int pPSC4
- See Also:
- Constant Field Values
-
pPSC5
public static final int pPSC5
- See Also:
- Constant Field Values
-
pPSC6
public static final int pPSC6
- See Also:
- Constant Field Values
-
-
Method Detail
-
available
public int available()
Returns the number of bytes available from the stream.- Overrides:
available
in classInputStream
- Returns:
- number of bytes available.
-
read
public int read()
Reads one byte from the UART3. A call of this method is not blocking!- Specified by:
read
in classInputStream
- Returns:
- byte read
-
read
public int read(byte[] buffer)
Reads the given number of bytes from the UART3. A call of this method is not blocking!- Overrides:
read
in classInputStream
- Parameters:
buffer
- Byte array to write the received data.- Returns:
- the number of bytes read.
-
read
public int read(byte[] buffer, int off, int count)
Reads the given number of bytes from the UART3. A call of this method is not blocking!- Overrides:
read
in classInputStream
- Parameters:
buffer
- Byte array to write the received data.off
- Offset in the array to start writing the data.count
- Length (number of bytes) to read.- Returns:
- the number of bytes read.
-
-