com.motorola.oem.osc
Class DisplayConfig

java.lang.Object
  extended by com.motorola.oem.osc.DisplayConfig

public class DisplayConfig
extends java.lang.Object

Configure and control the main display FPGA settings.

The main operations:
1) Load FPGA configuration image file obtained from FPGA maufacturer.
2) Send FPGA control command.


Method Summary
static void loadFpgaConfigFile(java.lang.String userResourceName)
          Configure FPGA for user main display.
static void loadFpgaConfigFile(java.lang.String userResourceName, boolean force)
          Configure FPGA for user main display.
static void sendFpgaCommand(byte command)
          Send control command to the FPGA or display.
static void setDeviceOutputResolution(int width, int height)
          Set device's output resolution.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sendFpgaCommand

public static void sendFpgaCommand(byte command)
                            throws java.lang.IllegalArgumentException
Send control command to the FPGA or display.
The available commands are manufacturer dependent and will be detailed by the FPGA and/or display's manufacturers.

Common commands available may be:
1) Set rescaler algorithm.
            Pixel duplication. 
            Linear interpolation. 
            Cubic interpolation. 
            Boosted cubic interpolation.
 
2) Enable/Disable rotation (180 degrees).
3) Power on/off.

Example:
import com.motorola.oem.osc.DisplayConfig;
...
// Set rescaler algorithm to 'Boosted cubic interpolation'
DisplayConfig.sendFpgaCommand((byte)0x44);

Parameters:
command - represented as one byte (8 bits)
Throws:
java.lang.IllegalArgumentException

loadFpgaConfigFile

public static void loadFpgaConfigFile(java.lang.String userResourceName,
                                      boolean force)
                               throws java.lang.IllegalArgumentException,
                                      java.lang.Exception
Configure FPGA for user main display. The FPGA manufacturer's BIN configuration file URL should be provided as the first parameter (same manner as provided to getResourceAsStream(String) method).

The provided config file and config-file-name will be stored to the device's non volatile memory.
Once stored, the user config file will be loaded to the FPGA every time device powers up.
An attempt to re-load a file with a name identical to the one stored will be ignored unless force parameter is set to true.
In this case the load will override the old configuration file by the new file.
The new display settings will take effect right after method returns.


Example:
// load config file located within JAR file
loadFpgaConfigFile("/Xilinx320x240RV001.bin", true);

Parameters:
userResourceName - Config file URL points to MIDlet's JAR file.
force - Indicates whether to force file load
Throws:
java.lang.IllegalArgumentException
java.lang.Exception

loadFpgaConfigFile

public static void loadFpgaConfigFile(java.lang.String userResourceName)
                               throws java.lang.IllegalArgumentException,
                                      java.lang.Exception
Configure FPGA for user main display. The FPGA manufacturer's BIN configuration file URL should be provided as the first parameter (same manner as provided to getResourceAsStream(String) method).

The provided config file and config-file-name will be stored to the device's non volatile memory.
Once stored, the user config file will be loaded to the FPGA every time device powers up.
An attempt to re-load a file with a name identical to the one stored, will be ignored.
In order to force FPGA re-load use loadFpgaConfigFile(String, boolean).
The new display settings will take effect right after method returns.


Example:
// load config file located under 'res' folder within JAR file
loadFpgaConfigFile("/res/Xilinx320x240RV001.bin");

Parameters:
userResourceName - Config file URL points to MIDlet's JAR file
Throws:
java.lang.IllegalArgumentException
java.lang.Exception

setDeviceOutputResolution

public static void setDeviceOutputResolution(int width,
                                             int height)
                                      throws java.lang.IllegalArgumentException
Set device's output resolution.
Resolutions are device's dependent (See the device's user guide).
Note: The device's output resolution is the FPGA input resolution.
Example:
import com.motorola.oem.osc.DisplayConfig;
...
// Set resolution to QVGA
DisplayConfig.setDeviceOutputResolution(320, 240);

Parameters:
width - Display's width in pixels
height - Display's height in pixels
Throws:
java.lang.IllegalArgumentException