public static class I2cDeviceSynch.ReadWindow
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
READ_REGISTER_COUNT_MAX
enableI2cReadMode and enableI2cWriteMode both impose a maximum length
on the size of data that can be read or written at one time.
|
static int |
WRITE_REGISTER_COUNT_MAX |
Constructor and Description |
---|
ReadWindow(int iregFirst,
int creg,
I2cDeviceSynch.ReadMode readMode)
Create a new register window with the indicated starting register and register count
|
Modifier and Type | Method and Description |
---|---|
boolean |
canBeUsedToRead()
Answers as to whether we're allowed to read using this window.
|
boolean |
contains(I2cDeviceSynch.ReadWindow him)
Answers as to whether the receiver wholly contains the indicated window.
|
boolean |
contains(int ireg,
int creg)
Answers as to whether the receiver wholly contains the indicated set of registers.
|
boolean |
containsWithSameMode(I2cDeviceSynch.ReadWindow him)
Answers as to whether the receiver wholly contains the indicated window
and also has the same modality.
|
I2cDeviceSynch.ReadMode |
getReadMode()
Returns the mode of the window
|
int |
getRegisterCount()
Returns the number of registers in the window
|
int |
getRegisterFirst()
Returns the first register in the window
|
int |
getRegisterMax()
Returns the first register NOT in the window
|
boolean |
hasWindowBeenUsedForRead()
Returns whether a read has ever been issued for this window or not
|
boolean |
mayInitiateSwitchToReadMode()
Answers as to whether this window in its present state ought to cause a transition
to read-mode when there's nothing else for the device to be doing.
|
void |
noteWindowUsedForRead()
Sets that a read has in fact been issued for this window
|
I2cDeviceSynch.ReadWindow |
readableCopy()
Returns a copy of this window but with the
usedForRead flag clear |
boolean |
sameAsIncludingMode(I2cDeviceSynch.ReadWindow him)
Do the receiver and the indicated register window cover exactly the
same set of registers and have the same modality?
|
public static final int READ_REGISTER_COUNT_MAX
READ_REGISTER_COUNT_MAX
and WRITE_REGISTER_COUNT_MAX
indicate those maximum sizes.WRITE_REGISTER_COUNT_MAX
,
Constant Field Valuespublic static final int WRITE_REGISTER_COUNT_MAX
READ_REGISTER_COUNT_MAX
,
Constant Field Valuespublic ReadWindow(int iregFirst, int creg, I2cDeviceSynch.ReadMode readMode)
iregFirst
- the index of the first register to readcreg
- the number of registers to readreadMode
- whether to repeat-read or read only oncepublic int getRegisterFirst()
public int getRegisterMax()
public int getRegisterCount()
public I2cDeviceSynch.ReadMode getReadMode()
public boolean hasWindowBeenUsedForRead()
public void noteWindowUsedForRead()
public boolean canBeUsedToRead()
noteWindowUsedForRead()
has been called on them.public boolean mayInitiateSwitchToReadMode()
public I2cDeviceSynch.ReadWindow readableCopy()
usedForRead
flag clearpublic boolean sameAsIncludingMode(I2cDeviceSynch.ReadWindow him)
him
- the other window to compare topublic boolean contains(I2cDeviceSynch.ReadWindow him)
him
- the window we wish to see whether we containcontains(int, int)
public boolean containsWithSameMode(I2cDeviceSynch.ReadWindow him)
him
- the window we wish to see whether we containpublic boolean contains(int ireg, int creg)
ireg
- the first register of interestcreg
- the number of registers of interest