com.dalsemi.system
Class TINIOS

java.lang.Object
  |
  +--com.dalsemi.system.TINIOS

public class TINIOS
extends java.lang.Object

The TINIOS class contains static methods to read the state of the running tasks, set system type variables, etc. The default encoding String is also kept here.


Constructor Summary
TINIOS()
           
 
Method Summary
static void blastHeapOnReboot(int blastType)
          Calling this function will cause the heap to be destroyed (reinitialized) on the next boot.
static void feedWatchdog()
          Feed the Watchdog timer.
static java.lang.String getDefaultEncoding()
           
static int getExternalSerialPortAddress(int portNum)
           
static boolean getExternalSerialPortEnable(int portNum)
           
static boolean getExternalSerialPortSearchEnable()
           
static int getFreeRAM()
          Gets the free RAM.
static int getLCDAddress()
          Gets the address of the LCD port.
static int getOwnerIDByTaskID(int taskid)
          Get tasks unique hash id from the taskid
static boolean getSerialBootMessagesState()
          Deprecated.  
static int getTaskID()
          Get tasks unique hash id from the taskid
static java.lang.String[] getTaskTable()
          Return the task table
static int[] getTaskTableIDs()
          Return the task table
static java.lang.String getTINIOSFirmwareVersion()
          Get a string representing the TINI OS Firmware Version.
static boolean isCurrentTaskInit()
          Is the current process the init process? (HEX file in bank 7)
static boolean isTaskRunning(int taskid)
          Check to see if task with specified Hash ID is running
static int killTask(int taskID)
          Stop and remove task from system.
static void reboot()
          Does a quick (and at this point ugly) system reboot.
static void setDebugMessagesState(boolean on)
          Set the state of debug messages.
static void setExternalSerialPortAddress(int portNum, int address)
           
static void setExternalSerialPortEnable(int portNum, boolean enable)
           
static void setExternalSerialPortSearchEnable(boolean enable)
           
static void setLCDAddress(int address)
          Sets the address of the LCD Port.
static void setSerialBootMessagesState(boolean on)
          Set the state of serial boot up messages.
static void setWatchdogTimeout(int mstimeout)
          Set the TINI Watchdog timeout.
static void sleepProcess(int ms)
          Delay a process for ms milliseconds.
static long uptimeMillis()
          Gets the approximate number of milliseconds the system has been running.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TINIOS

public TINIOS()
Method Detail

getDefaultEncoding

public static final java.lang.String getDefaultEncoding()

getExternalSerialPortEnable

public static boolean getExternalSerialPortEnable(int portNum)

setExternalSerialPortEnable

public static void setExternalSerialPortEnable(int portNum,
                                               boolean enable)

getExternalSerialPortSearchEnable

public static boolean getExternalSerialPortSearchEnable()

setExternalSerialPortSearchEnable

public static void setExternalSerialPortSearchEnable(boolean enable)

getExternalSerialPortAddress

public static int getExternalSerialPortAddress(int portNum)

setExternalSerialPortAddress

public static void setExternalSerialPortAddress(int portNum,
                                                int address)

setWatchdogTimeout

public static void setWatchdogTimeout(int mstimeout)
Set the TINI Watchdog timeout.
Parameters:
mstimeout - - Timeout, in milliseconds. Don't set this too low, because Java ain't that quick! Set to zero to turn off the watchdog.
See Also:

feedWatchdog

public static void feedWatchdog()
Feed the Watchdog timer. Call this before the timeout set by setWatchdogTimeout() or feel the bite.
See Also:

getTINIOSFirmwareVersion

public static java.lang.String getTINIOSFirmwareVersion()
Get a string representing the TINI OS Firmware Version.
See Also:

isCurrentTaskInit

public static boolean isCurrentTaskInit()
Is the current process the init process? (HEX file in bank 7)
See Also:
Thread.sleep()

sleepProcess

public static final void sleepProcess(int ms)
Delay a process for ms milliseconds.
Parameters:
ms - the amout of time to sleep.
See Also:
Thread.sleep()

getTaskID

public static int getTaskID()
Get tasks unique hash id from the taskid
Returns:
my Task ID
See Also:

getOwnerIDByTaskID

public static int getOwnerIDByTaskID(int taskid)
Get tasks unique hash id from the taskid
Returns:
my Task ID
See Also:

isTaskRunning

public static boolean isTaskRunning(int taskid)
Check to see if task with specified Hash ID is running
Parameters:
taskid - ID of task
Returns:
true if task is running
See Also:

getTaskTable

public static java.lang.String[] getTaskTable()
Return the task table
Returns:
String array with size equal to number of tasks.
See Also:

getTaskTableIDs

public static int[] getTaskTableIDs()
Return the task table
Returns:
int array with size equal to number of tasks.
See Also:

killTask

public static int killTask(int taskID)
Stop and remove task from system.
Parameters:
taskID - Task ID of task to kill.
Returns:
Task ID killed.
See Also:

getFreeRAM

public static final int getFreeRAM()
Gets the free RAM.
Returns:
Available free RAM.
See Also:

reboot

public static final void reboot()
Does a quick (and at this point ugly) system reboot.
See Also:

getSerialBootMessagesState

public static final boolean getSerialBootMessagesState()
Deprecated.  
Get the state of serial boot up messages.
Returns:
true or false state of boot messages.
See Also:

setSerialBootMessagesState

public static final void setSerialBootMessagesState(boolean on)
Set the state of serial boot up messages.
Parameters:
on - Set to true to turn on boot messages, false to turn off
See Also:

setDebugMessagesState

public static final void setDebugMessagesState(boolean on)
Set the state of debug messages.
Parameters:
on - Set to true to turn on debug messages, false to turn off
See Also:

uptimeMillis

public static final long uptimeMillis()
Gets the approximate number of milliseconds the system has been running. This number is guaranteed to be less than or equal to the actual uptime. It will never be larger.
Returns:
number of milliseconds since last boot.
See Also:

blastHeapOnReboot

public static final void blastHeapOnReboot(int blastType)
Calling this function will cause the heap to be destroyed (reinitialized) on the next boot. All data in RAM will be destroyed. Initialization of system variables is conditional. WARNING: This is designed to be used when the application the user wishes to run is already in flash, and does not care if the filesystem is destroyed. NOTE: System variables are kept in a separate portion of the RAM, and are only destroyed with the proper parameter to this function. Calling this function only sets the trigger for the next boot. The trigger is disengaged immediately after it fires after boot. Every subsequent boot will be unaffected, unless the user calls this function again.
Parameters:
blastType - - 0 for heap reinit only 1 for heap reinit and stored system variable init

getLCDAddress

public static int getLCDAddress()
Gets the address of the LCD port.
Returns:
- the address of the LCD Port - defaults to 0x00380000

setLCDAddress

public static void setLCDAddress(int address)
Sets the address of the LCD Port.
Parameters:
- - the address of the LCD port.