T - the type of the value held by the register.public interface RawRegister<T extends java.lang.Number> extends RawMemory
RawRegister interface provides methods for setting and getting the value of a register or memory area
holding a value of type byte, short, int or long. A RawRegister instance can
be obtained from a MMIODevice instance.
Developers should be aware when using this API of the potential performance and memory allocation penalty induced by
primitive auto-boxing. For intensive reading and writing of registers such as data input and data output registers,
the use of the RawBlock returned by MMIODevice.getAsRawBlock() should be preferred.| Modifier and Type | Method and Description |
|---|---|
void |
and(T value)
Sets the value at the memory area associated with this object to the result of performing a logical AND of the
value at the memory area with the argument value.
|
void |
clearBit(int index)
Clears (sets to
0) the designated bit value at the memory area associated with this object. |
void |
clearBits(T mask)
Clears (sets to
0) the specified bits at the memory area associated with this object. |
T |
get()
Gets the value at the memory area associated with this object.
|
java.lang.Class<T> |
getType()
Returns the type of the value this
RawRegister instance can hold. |
boolean |
isBitSet(int index)
Checks whether the designated bit value at the memory area associated with this object is set (equal to
1
) |
void |
or(T value)
Sets the value at the memory area associated with this object to the result of performing a logical OR of the
value at the memory area with the argument value.
|
void |
set(T value)
Sets the value at the memory area associated with this object.
|
void |
setBit(int index)
Sets (to
1) the designated bit value at the memory area associated with this object. |
void |
setBits(T mask)
Sets (to
1) the specified bits at the memory area associated with this object. |
void |
xor(T value)
Sets the value at the memory area associated with this object to the result of performing a logical XOR of the
value at the memory area with the argument value.
|
void and(T value) throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
value - the value to perform a logical AND with.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.void clearBit(int index)
throws java.io.IOException,
UnavailablePeripheralException,
ClosedPeripheralException
0) the designated bit value at the memory area associated with this object.index - the index of the bit.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.java.lang.IllegalArgumentException - if index is less than 0 or greater or equal to the size in bits of the value at the
memory area associated with this object.void clearBits(T mask) throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
0) the specified bits at the memory area associated with this object.mask - the bit mask.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.T get() throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
java.io.IOException - if the associated memory area is not readable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.java.lang.Class<T> getType()
RawRegister instance can hold.RawRegister instance's value type.boolean isBitSet(int index)
throws java.io.IOException,
UnavailablePeripheralException,
ClosedPeripheralException
1
)index - the index of the bit.java.io.IOException - if the associated memory area is not readable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.java.lang.IllegalArgumentException - if index is less than 0 or greater or equal to the size in bits of the value at the
memory area associated with this object.void or(T value) throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
value - the value to perform a logical OR with.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.void set(T value) throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
value - the value to set.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.void setBit(int index)
throws java.io.IOException,
UnavailablePeripheralException,
ClosedPeripheralException
1) the designated bit value at the memory area associated with this object.index - the index of the bit.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.java.lang.IllegalArgumentException - if index is less than 0 or greater or equal to the size in bits of the value at the
memory area associated with this object.void setBits(T mask) throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
1) the specified bits at the memory area associated with this object.mask - the bit mask.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.void xor(T value) throws java.io.IOException, UnavailablePeripheralException, ClosedPeripheralException
value - the value to perform a logical XOR with.java.io.IOException - if the associated memory area is not writable.UnavailablePeripheralException - if this peripheral is not currently available - such as it is locked by another application.ClosedPeripheralException - if the peripheral has been closed.Copyright © 2012, 2013, Oracle and/or its affiliates. All rights reserved.
Legal Notices