public final class MMIODeviceConfig extends java.lang.Object implements PeripheralConfig
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
The
RawRegisterConfig class encapsulates the configuration parameters of a register. |
| 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. |
| Modifier and Type | Method and Description |
|---|---|
long |
getAddress()
Gets the configured memory address of the MMIO device.
|
int |
getByteOrdering()
Gets the configured byte ordering of the MMIO device.
|
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.
|
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 null 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 long getAddress()
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()
Copyright (c) 2012, Oracle and/or its affiliates. All Rights Reserved. Use of this specification is subject to license terms.