Class RegisterDescriptor
- java.lang.Object
- 
- cbsw.RegisterDescriptor
 
- 
 public class RegisterDescriptor extends java.lang.ObjectA bit-field descriptor 
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.StringdescriptionA human-readable description.protected intlengthThe length in bits of the bit-field.protected java.lang.StringnameA short, unique name for the bit-field.protected java.lang.StringoffsetThe offset in bits of the bit-field.protected booleanroUsed to mark the bit-field as read-only.
 - 
Constructor SummaryConstructors Constructor Description RegisterDescriptor()No-argument constructor called by unmarshaller
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description RegisterDescriptorclone(java.lang.String prefix)Clone this register descriptor with prefix to name.java.lang.Stringget(java.util.BitSet regBits)Returns a hex String representation of the register bitsbyte[]getBytes(java.util.BitSet regBits)Returns an array of bytes spanning the register bitsbyte[]getBytes(java.util.BitSet regBits, int offset)Returns an array of bytes spanning the register bitsjava.lang.StringgetDescription()Returns the bit-field descriptionintgetLength()Returns the bit-field lengthjava.lang.StringgetName()Returns the bit-field namejava.lang.StringgetOffset()Returns the bit-field offsetbooleanisReadOnly()Whether the underlying bit-field is marked read-only.booleanmatches(java.lang.String regex)Test whether the bit-field name matches the regex.voidset(java.util.BitSet regBits, boolean flag)Set the register bits for all offsetsvoidset(java.util.BitSet regBits, java.lang.String regString)Set the register bits for all offsets
 
- 
- 
- 
Field Detail- 
descriptionprotected java.lang.String description A human-readable description. Preferably terse. 
 - 
nameprotected java.lang.String name A short, unique name for the bit-field. Used as the key to locate it. 
 - 
offsetprotected java.lang.String offset The offset in bits of the bit-field. Can be a comma-separated list. 
 - 
lengthprotected int length The length in bits of the bit-field. 
 - 
roprotected boolean ro Used to mark the bit-field as read-only. 
 
- 
 - 
Method Detail- 
clonepublic RegisterDescriptor clone(java.lang.String prefix) Clone this register descriptor with prefix to name. - Parameters:
- prefix- A prefix added the the descriptor name.
- Returns:
- The cloned RegisterDescriptor.
 
 - 
getDescriptionpublic java.lang.String getDescription() Returns the bit-field description - Returns:
- The descriptive text
 
 - 
getNamepublic java.lang.String getName() Returns the bit-field name - Returns:
- The name
 
 - 
matchespublic boolean matches(java.lang.String regex) Test whether the bit-field name matches the regex. - Parameters:
- regex- The regex pattern to match.
- Returns:
- true if match else false.
 
 - 
getOffsetpublic java.lang.String getOffset() Returns the bit-field offset - Returns:
- The offset
 
 - 
getLengthpublic int getLength() Returns the bit-field length - Returns:
- The length
 
 - 
isReadOnlypublic boolean isReadOnly() Whether the underlying bit-field is marked read-only. - Returns:
- True if the bit-field is marked read-only
 
 - 
getBytespublic byte[] getBytes(java.util.BitSet regBits) Returns an array of bytes spanning the register bits - Parameters:
- regBits- The register bits
- Returns:
- The array of bytes containing the register values
 
 - 
getBytespublic byte[] getBytes(java.util.BitSet regBits, int offset)Returns an array of bytes spanning the register bits - Parameters:
- regBits- The register bits
- offset- The bit-field offset
- Returns:
- The array of bytes containing the register values
 
 - 
getpublic java.lang.String get(java.util.BitSet regBits) Returns a hex String representation of the register bits - Parameters:
- regBits- The register bits
- Returns:
- Hex String representation of register bits
 
 - 
setpublic void set(java.util.BitSet regBits, boolean flag)Set the register bits for all offsets - Parameters:
- regBits- The register bits
- flag- boolean representation of value to set
 
 - 
setpublic void set(java.util.BitSet regBits, java.lang.String regString)Set the register bits for all offsets - Parameters:
- regBits- The register bits
- regString- Hex String representation of value to set
 
 
- 
 
-