|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.platform.tmote.Action
com.sentilla.platform.tmote.ExternUart
public class ExternUart
Provides access to the Tmote's external UART (universal asynchronous receiver/transmitter).
Field Summary | |
---|---|
protected short |
baudrate
|
static byte |
Bits7EvenStop1
|
static byte |
Bits7EvenStop2
|
static byte |
Bits7NoneStop1
|
static byte |
Bits7NoneStop2
|
static byte |
Bits7OddStop1
|
static byte |
Bits7OddStop2
|
static byte |
Bits8EvenStop1
|
static byte |
Bits8EvenStop2
|
static byte |
Bits8NoneStop1
|
static byte |
Bits8NoneStop2
|
static byte |
Bits8OddStop1
|
static byte |
Bits8OddStop2
|
protected byte[] |
buffer
|
protected short |
bufsz
|
static byte |
CLOSE_OP
|
static byte |
DOWN
|
protected short |
e_offset
|
protected byte |
error
|
protected int |
interbyte_wait
|
protected byte |
modulation
|
protected short |
num_waitchars
|
protected byte |
op
|
static byte |
OPEN_OP
|
protected byte |
portparams
|
protected short |
s_offset
|
static byte |
STATUS_OP
|
static short |
UBR_4800Baud8Mhz
|
static byte |
UMCTL_4800Baud8Mhz
|
static byte |
UP
|
protected int |
wait_period
|
static byte |
WRITE_OP
|
Fields inherited from class com.sentilla.platform.tmote.Action |
---|
actionAuto, actionId, actionState, isolateOwner |
Fields inherited from interface com.sentilla.system.Action |
---|
DONE, ERROR, IDLE, PENDING |
Constructor Summary | |
---|---|
ExternUart()
Constructor initializes a uart port. |
Method Summary | |
---|---|
void |
close()
Closes Uart. |
String |
getDriverName(int n)
Returns the valid name(s) for each driver. |
Driver |
getNextDriver()
Used by the Driver registry (Drivers) to get the next Driver in the linked list of drivers. |
void |
open()
|
void |
open(short b,
byte p,
byte m)
Opens a Uart with baudrate (UBR register) set to b and modulation (UMCTL register) set to m. |
void |
relay(com.sentilla.io.ByteBuffer buf,
int outlen,
int inlen)
Stream a ByteBuffer on the uart port. |
void |
relay(com.sentilla.io.ByteBuffer buf,
int outlen,
int inlen,
int t0,
int t1)
Stream a ByteBuffer on the uart port. |
void |
setNextDriver(Driver d)
Used by the Driver registry (Drivers) to create a linked list of drivers. |
Methods inherited from class com.sentilla.platform.tmote.Action |
---|
block, block, cancel, getActionState, initAction, isDone, lookup, submit |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte WRITE_OP
public static final byte CLOSE_OP
public static final byte OPEN_OP
public static final byte STATUS_OP
public static final byte UP
public static final byte DOWN
public static final byte Bits7OddStop1
public static final byte Bits7OddStop2
public static final byte Bits7EvenStop1
public static final byte Bits7EvenStop2
public static final byte Bits8OddStop1
public static final byte Bits8OddStop2
public static final byte Bits8EvenStop1
public static final byte Bits8EvenStop2
public static final byte Bits7NoneStop1
public static final byte Bits7NoneStop2
public static final byte Bits8NoneStop1
public static final byte Bits8NoneStop2
public static final short UBR_4800Baud8Mhz
public static final byte UMCTL_4800Baud8Mhz
protected byte op
protected byte error
protected short s_offset
protected short e_offset
protected byte[] buffer
protected int interbyte_wait
protected short bufsz
protected int wait_period
protected short num_waitchars
protected short baudrate
protected byte portparams
protected byte modulation
Constructor Detail |
---|
public ExternUart()
Method Detail |
---|
public void open() throws com.sentilla.io.IORuntimeException
com.sentilla.io.IORuntimeException
public void open(short b, byte p, byte m) throws com.sentilla.io.IORuntimeException
com.sentilla.io.IORuntimeException
public void close() throws com.sentilla.io.IORuntimeException
com.sentilla.io.IORuntimeException
public void relay(com.sentilla.io.ByteBuffer buf, int outlen, int inlen) throws com.sentilla.io.IORuntimeException
relay
in interface com.sentilla.io.SynchronousSendRx
com.sentilla.io.IORuntimeException
public void relay(com.sentilla.io.ByteBuffer buf, int outlen, int inlen, int t0, int t1) throws com.sentilla.io.IORuntimeException
t0
- number of 32 KHz cycles to wait for the reception of the first byte.t1
- number of 32 Khz cycles to wait between byte reception, i.e. interbyte timeout.
com.sentilla.io.IORuntimeException
public String getDriverName(int n)
Driver
getDriverName
returns a
string for n=0 to n=N-1, and returns null for all other values of n.
A driver may return multiple names because it provides the default implementation for a specific name, such as associating "flash" by default to the external flash, or "extflash" if an application specifically asserts it requires the external flash resources. Some drivers may return only a single valid name, such as "intflash" for the internal flash.
getDriverName
in interface Driver
public void setNextDriver(Driver d)
Driver
setNextDriver
in interface Driver
d
- A reference to the next driver in the list of registered driversDrivers
public Driver getNextDriver()
Driver
getNextDriver
in interface Driver
Drivers
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |