public final class MMIODeviceConfig extends java.lang.Object implements PeripheralConfig<MMIODevice>, PeripheralConfig.HardwareAddressing
MMIODeviceConfig class encapsulates the hardware addressing information, and static and dynamic
configuration parameters of an MMIO device.
Some hardware addressing parameter, and static and dynamic configuration parameters may be set to PeripheralConfig.DEFAULT.
Whether such default settings are supported is platform- as well as peripheral driver-dependent.
An instance of MMIODeviceConfig can be passed to the PeripheralManager.open(PeripheralConfig) or
PeripheralManager.open(Class, PeripheralConfig) method to open the designated MMIO device with the specified
configuration. A PeripheralConfigInvalidException is thrown when attempting to open a peripheral device with
an invalid or unsupported configuration.| Modifier and Type | Class and Description |
|---|---|
static class |
MMIODeviceConfig.RawBlockConfig
The
RawBlockConfig class encapsulates the configuration parameters of a memory block. |
static class |
MMIODeviceConfig.RawMemoryConfig
The
RawMemoryConfig class encapsulates the configuration parameters of a generic raw memory area. |
static class |
MMIODeviceConfig.RawRegisterConfig<T extends java.lang.Number>
The
RawRegisterConfig class encapsulates the configuration parameters of a register. |
PeripheralConfig.HardwareAddressing| Modifier and Type | Field and Description |
|---|---|
static int |
REGISTER_TYPE_BYTE
Type for a register holding a byte value.
|
static int |
REGISTER_TYPE_INT
Type for a register holding an integer value.
|
static int |
REGISTER_TYPE_SHORT
Type for a register holding a short integer value.
|
DEFAULT| Constructor and Description |
|---|
MMIODeviceConfig(long address,
int size,
int byteOrdering,
MMIODeviceConfig.RawMemoryConfig... memConfigs)
Creates a new
MMIODeviceConfig with the specified hardware addressing information and configuration
parameters. |
MMIODeviceConfig(java.lang.String deviceName,
long address,
int size,
int byteOrdering,
MMIODeviceConfig.RawMemoryConfig... memConfigs)
Creates a new
MMIODeviceConfig with the specified hardware addressing information and configuration
parameters. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Checks two
MMIODeviceConfig objects for equality. |
long |
getAddress()
Gets the configured memory address of the MMIO device.
|
int |
getByteOrdering()
Gets the configured byte ordering of the MMIO device.
|
java.lang.String |
getDeviceName()
Gets the configured device name (such as to its device file name on UNIX systems).
|
int |
getDeviceNumber()
Gets the configured device number.
|
MMIODeviceConfig.RawMemoryConfig[] |
getRawMemoryConfigs()
Gets the set of configured registers and memory blocks.
|
int |
getSize()
Gets the configured size of the memory-mapped area of the MMIO device.
|
int |
hashCode()
Returns the hash code value for this object.
|
public static final int REGISTER_TYPE_BYTE
public static final int REGISTER_TYPE_INT
public static final int REGISTER_TYPE_SHORT
public MMIODeviceConfig(long address,
int size,
int byteOrdering,
MMIODeviceConfig.RawMemoryConfig... memConfigs)
MMIODeviceConfig with the specified hardware addressing information and configuration
parameters.
Note that if no raw block and raw register configuration is provided, the specified memory area will be mapped to
the RawBlock instance returned by a call to MMIODevice.getAsRawBlock().address - the memory address of the device (a positive or zero integer).size - the size of the memory-mapped area of the device (a positive integer).byteOrdering - the byte ordering of the device, one of: Peripheral.BIG_ENDIAN,
Peripheral.LITTLE_ENDIAN, Peripheral.MIXED_ENDIAN or PeripheralConfig.DEFAULT.memConfigs - the raw block and raw register configurations (may be null or empty).java.lang.IllegalArgumentException - if any of the following is true:
address is not in the defined range;size is not in the defined range;byteOrdering is not one of the defined values.java.lang.IndexOutOfBoundsException - if any of the memConfigs elements is pointing outside of the defined address range ([
0-size]).public MMIODeviceConfig(java.lang.String deviceName,
long address,
int size,
int byteOrdering,
MMIODeviceConfig.RawMemoryConfig... memConfigs)
MMIODeviceConfig with the specified hardware addressing information and configuration
parameters.
Note that if no raw block and raw register configuration is provided, the specified memory area will be mapped to
the RawBlock instance returned by a call to MMIODevice.getAsRawBlock().deviceName - the device name (such as to its device file name on UNIX systems).address - the memory address of the device (a positive or zero integer)or PeripheralConfig.DEFAULT.size - the size of the memory-mapped area of the device (a positive integer).byteOrdering - the byte ordering of the device, one of: Peripheral.BIG_ENDIAN,
Peripheral.LITTLE_ENDIAN, Peripheral.MIXED_ENDIAN or PeripheralConfig.DEFAULT.memConfigs - the raw block and raw register configurations (may be null or empty).java.lang.IllegalArgumentException - if any of the following is true:
address is not in the defined range;size is not in the defined range;byteOrdering is not one of the defined values.java.lang.NullPointerException - if deviceName is null.java.lang.IndexOutOfBoundsException - if any of the memConfigs elements is pointing outside of the defined address range ([
0-size]).public long getAddress()
PeripheralConfig.DEFAULT..public java.lang.String getDeviceName()
getDeviceName in interface PeripheralConfig.HardwareAddressingnull.public int getDeviceNumber()
getDeviceNumber in interface PeripheralConfig.HardwareAddressingPeripheralConfig.DEFAULT.public int getByteOrdering()
Peripheral.BIG_ENDIAN,
Peripheral.LITTLE_ENDIAN, Peripheral.MIXED_ENDIAN or PeripheralConfig.DEFAULT.public MMIODeviceConfig.RawMemoryConfig[] getRawMemoryConfigs()
null if none is defined.public int getSize()
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
MMIODeviceConfig objects for equality.equals in class java.lang.Objectobj - the object to test for equality with this object.true if obj is a MMIODeviceConfig and has
the same hardware addressing information and configuration parameter values
as this MMIODeviceConfig object.Copyright © 2012, 2013, Oracle and/or its affiliates. All rights reserved.
Legal Notices