SunSPOT API V3.0


com.sun.spot.peripheral
Class Spot

java.lang.Object
  extended by com.sun.spot.peripheral.Spot
All Implemented Interfaces:
ISpot

public class Spot
extends Object
implements ISpot

The class of the root object of the Spot base library.

There is only one instance of Spot. To access it use:

Spot.getInstance(); For details of public methods see ISpot.


Field Summary
 
Fields inherited from interface com.sun.spot.peripheral.ISpot
MCLK_FREQUENCY, PROPERTY_SPOT_DIAGNOSTICS, SPOT_GLOBAL_FLASH_MANAGER, SPOT_GLOBAL_NOR_FLASH_SECTOR_FACTORY, SYSTEM_TICKER_TICKS_PER_MILLISECOND
 
Method Summary
 void flashConfigPage(ConfigPage configPage)
          Write a ConfigPage into the flash.
 IAT91_AIC getAT91_AIC()
          Get access to the AT91 Interrupt Controller
 IAT91_PIO getAT91_PIO(int pioSelector)
          Get access to the AT91 Parallel I/O Controller.
 IAT91_PowerManager getAT91_PowerManager()
          Return the AT91_PowerManager.
 IAT91_TC getAT91_TC(int index)
          Get access to an AT91 Timer-Counter.
 ConfigPage getConfigPage()
          Get the configuration page held in flash
 IDMAMemoryManager getDMAMemoryManager()
          Get the singleton DMA Memory Manager.
 IDriverRegistry getDriverRegistry()
          Get the Driver Registry.
 Hashtable getExternalBoardMap()
          Get the map of external boards.
 FiqInterruptDaemon getFiqInterruptDaemon()
          Get the FiqInterruptDaemon.
 IFlashMemoryDevice getFlashMemoryDevice()
          Get access to the flash memory on the Spot
 ILed getGreenLed()
          Get access to the green LED on the Spot processor board.
 int getHardwareType()
          Get the hardware type code for this device.
 I802_15_4_MAC[] getI802_15_4_MACs()
          Get access to the I802.15.4 MAC layers
 I802_15_4_PHY getI802_15_4_PHY()
          Get access to the physical I802.15.4 radio device
static ISpot getInstance()
          Get the singleton instance of this class.
 IProprietaryRadio getIProprietaryRadio()
          Get access to the radio via its proprietary (non-I802.15.4) interface.
 ILTC3455 getLTC3455()
          Return the LTC3455 power regulator used by the Spot.
 OTACommandServer getOTACommandServer()
          Get the OTA Command Server, creating one if necessary
 Properties getPersistentProperties()
          Get all the persistent properties, as held in the flash memory
 String getPersistentProperty(String key)
          Get a persistent property, as held in the flash memory
 IPowerController getPowerController()
          Get the PowerController - the AVR on the spot.
 byte[] getPublicKey()
          Get the Public Key used to sign and verify application and library suites, and the config page.
 IRadioPolicyManager getRadioPolicyManager()
          Get the singleton radio policy manager
 ILed getRedLed()
          Get access to the red LED on the Spot processor board.
 IResourceRegistry getResourceRegistry()
          Get the singleton resource registry
 ISecuredSiliconArea getSecuredSiliconArea()
          Get the SecuredSiliconArea
 ISleepManager getSleepManager()
          Get access to the sleep manager for the Spot
 ISpiMaster getSPI()
          Get access to the SPI interface.
 ISpotPins getSpotPins()
          Get the singleton SpotPins instance.
 int getSystemTicks()
          Return a tick count in the range of zero to ISpot.SYSTEM_TICKER_TICKS_PER_MILLISECOND.
 IUSBPowerDaemon getUsbPowerDaemon()
          Get the usb power daemon
 boolean isMasterIsolate()
           
 boolean isRunningOnHost()
           
static void main(String[] args)
          Main entry point.
 void resetExternalBoardMap()
          Clear the cache of external board properties.
static void setInstance(ISpot theSpot)
          FOR TEST PURPOSES ONLY
 void setPersistentProperties(Properties props)
          Set one or more persistent property in the flash memory
 void setPersistentProperty(String key, String value)
          Set a persistent property in the flash memory
 void setProperty(String key, String value)
          Set the system property "key" to have the value "value"
 void storeProperties(Properties props)
          Replace the persistent properties held in the flash memory
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(String[] args)
Main entry point. This is called by Squawk prior to running any user code because this class is specified using -isolateinit.

Parameters:
args - arg[0] indicates whether the main or a child isolate is being started

getInstance

public static ISpot getInstance()
Get the singleton instance of this class.

Returns:
The singleton instance

getFiqInterruptDaemon

public FiqInterruptDaemon getFiqInterruptDaemon()
Description copied from interface: ISpot
Get the FiqInterruptDaemon. This handles interrupts from the power controller.

Specified by:
getFiqInterruptDaemon in interface ISpot
Returns:
the FiqInterruptDaemon

getGreenLed

public ILed getGreenLed()
Description copied from interface: ISpot
Get access to the green LED on the Spot processor board. Use with caution as this LED is intended for system use.

Specified by:
getGreenLed in interface ISpot
Returns:
ILed the green LED on the Spot processor board

getRedLed

public ILed getRedLed()
Description copied from interface: ISpot
Get access to the red LED on the Spot processor board. Use with caution as this LED is intended for system use.

Specified by:
getRedLed in interface ISpot
Returns:
The red LED on the Spot processor board

getSpotPins

public ISpotPins getSpotPins()
Description copied from interface: ISpot
Get the singleton SpotPins instance.

Specified by:
getSpotPins in interface ISpot
Returns:
ISpotPins the SpotPins

getAT91_PIO

public IAT91_PIO getAT91_PIO(int pioSelector)
Description copied from interface: ISpot
Get access to the AT91 Parallel I/O Controller.

Specified by:
getAT91_PIO in interface ISpot
Parameters:
pioSelector - selects the PIO required (use one of the selector symbols found in IAT91_PIO)
Returns:
the AT91 Parallel Input-Output Controller.

getAT91_PowerManager

public IAT91_PowerManager getAT91_PowerManager()
Return the AT91_PowerManager.

Specified by:
getAT91_PowerManager in interface ISpot
Returns:
the AT91_PowerManager

getRadioPolicyManager

public IRadioPolicyManager getRadioPolicyManager()
Description copied from interface: ISpot
Get the singleton radio policy manager

Specified by:
getRadioPolicyManager in interface ISpot
Returns:
the radio policy manager

getDMAMemoryManager

public IDMAMemoryManager getDMAMemoryManager()
Description copied from interface: ISpot
Get the singleton DMA Memory Manager. The DMA Memory Manager allocates uncached memory suitable for use as DMA buffers.

Specified by:
getDMAMemoryManager in interface ISpot
Returns:
the DMA Memory Manager

getLTC3455

public ILTC3455 getLTC3455()
Return the LTC3455 power regulator used by the Spot.

Specified by:
getLTC3455 in interface ISpot
Returns:
the LTC3455

getAT91_AIC

public IAT91_AIC getAT91_AIC()
Description copied from interface: ISpot
Get access to the AT91 Interrupt Controller

Specified by:
getAT91_AIC in interface ISpot
Returns:
the AT91 Interrupt Controller

getI802_15_4_PHY

public I802_15_4_PHY getI802_15_4_PHY()
Description copied from interface: ISpot
Get access to the physical I802.15.4 radio device

Specified by:
getI802_15_4_PHY in interface ISpot
Returns:
the I802.15.4 physical radio device

getIProprietaryRadio

public IProprietaryRadio getIProprietaryRadio()
Description copied from interface: ISpot
Get access to the radio via its proprietary (non-I802.15.4) interface.

Specified by:
getIProprietaryRadio in interface ISpot
Returns:
the proprietary interface to the radio device

getI802_15_4_MACs

public I802_15_4_MAC[] getI802_15_4_MACs()
Description copied from interface: ISpot
Get access to the I802.15.4 MAC layers

Specified by:
getI802_15_4_MACs in interface ISpot
Returns:
the I802.15.4 MAC layers

getSPI

public ISpiMaster getSPI()
Description copied from interface: ISpot
Get access to the SPI interface. This interface is used to communicate with the radio and the sensor boards

Specified by:
getSPI in interface ISpot
Returns:
the SPI interface.

getDriverRegistry

public IDriverRegistry getDriverRegistry()
Description copied from interface: ISpot
Get the Driver Registry.

Specified by:
getDriverRegistry in interface ISpot
Returns:
the Driver Registry

getFlashMemoryDevice

public IFlashMemoryDevice getFlashMemoryDevice()
Description copied from interface: ISpot
Get access to the flash memory on the Spot

Specified by:
getFlashMemoryDevice in interface ISpot
Returns:
the flash memory controller as an IFlashMemoryDevice

getHardwareType

public int getHardwareType()
Description copied from interface: ISpot
Get the hardware type code for this device.

Specified by:
getHardwareType in interface ISpot
Returns:
the hardware type code

getAT91_TC

public IAT91_TC getAT91_TC(int index)
Get access to an AT91 Timer-Counter.

Specified by:
getAT91_TC in interface ISpot
Parameters:
index - The index of the required TC in the range 0-5
Returns:
The AT91 TC

getUsbPowerDaemon

public IUSBPowerDaemon getUsbPowerDaemon()
Description copied from interface: ISpot
Get the usb power daemon

Specified by:
getUsbPowerDaemon in interface ISpot
Returns:
the usb power daemon

getSecuredSiliconArea

public ISecuredSiliconArea getSecuredSiliconArea()
Description copied from interface: ISpot
Get the SecuredSiliconArea

Specified by:
getSecuredSiliconArea in interface ISpot
Returns:
the SecuredSiliconArea

getConfigPage

public ConfigPage getConfigPage()
Description copied from interface: ISpot
Get the configuration page held in flash

Specified by:
getConfigPage in interface ISpot
Returns:
the configuration page

getPublicKey

public byte[] getPublicKey()
Description copied from interface: ISpot
Get the Public Key used to sign and verify application and library suites, and the config page.

Specified by:
getPublicKey in interface ISpot
Returns:
byte[] The Public Key

flashConfigPage

public void flashConfigPage(ConfigPage configPage)
Description copied from interface: ISpot
Write a ConfigPage into the flash.

Specified by:
flashConfigPage in interface ISpot

getExternalBoardMap

public Hashtable getExternalBoardMap()
Description copied from interface: ISpot
Get the map of external boards. This returns a Hashtable containing an entry for each detected board. The key of the entry is the PeripheralChipSelect used as the chip select for the board, and the value is a Properties object containing the properties read from its serial flash memory.

Specified by:
getExternalBoardMap in interface ISpot
Returns:
a Hashtable as described above

resetExternalBoardMap

public void resetExternalBoardMap()
Description copied from interface: ISpot
Clear the cache of external board properties. The cache will be re-read from the boards next time it is used.

Specified by:
resetExternalBoardMap in interface ISpot

getSleepManager

public ISleepManager getSleepManager()
Description copied from interface: ISpot
Get access to the sleep manager for the Spot

Specified by:
getSleepManager in interface ISpot
Returns:
The sleep manager

getPowerController

public IPowerController getPowerController()
Description copied from interface: ISpot
Get the PowerController - the AVR on the spot.

Specified by:
getPowerController in interface ISpot
Returns:
the PowerController

isMasterIsolate

public boolean isMasterIsolate()
Specified by:
isMasterIsolate in interface ISpot
Returns:
true if this method has been called in the context of the master isolate

getPersistentProperty

public String getPersistentProperty(String key)
Description copied from interface: ISpot
Get a persistent property, as held in the flash memory

Specified by:
getPersistentProperty in interface ISpot
Returns:
the value or null if no property with the specified key

getPersistentProperties

public Properties getPersistentProperties()
Description copied from interface: ISpot
Get all the persistent properties, as held in the flash memory

Specified by:
getPersistentProperties in interface ISpot
Returns:
the set of persistent properties

setPersistentProperty

public void setPersistentProperty(String key,
                                  String value)
Description copied from interface: ISpot
Set a persistent property in the flash memory

Specified by:
setPersistentProperty in interface ISpot
value - the value required or null to erase

setPersistentProperties

public void setPersistentProperties(Properties props)
Description copied from interface: ISpot
Set one or more persistent property in the flash memory

Specified by:
setPersistentProperties in interface ISpot
Parameters:
props - the properties to set

storeProperties

public void storeProperties(Properties props)
                     throws IOException
Description copied from interface: ISpot
Replace the persistent properties held in the flash memory

Specified by:
storeProperties in interface ISpot
Parameters:
props - the properties to set
Throws:
IOException

isRunningOnHost

public boolean isRunningOnHost()
Specified by:
isRunningOnHost in interface ISpot
Returns:
true if running on the host, false if on the SPOT

getOTACommandServer

public OTACommandServer getOTACommandServer()
                                     throws IOException
Description copied from interface: ISpot
Get the OTA Command Server, creating one if necessary

Specified by:
getOTACommandServer in interface ISpot
Returns:
the OTA command server
Throws:
IOException

setProperty

public void setProperty(String key,
                        String value)
Description copied from interface: ISpot
Set the system property "key" to have the value "value"

Specified by:
setProperty in interface ISpot

getSystemTicks

public int getSystemTicks()
Description copied from interface: ISpot
Return a tick count in the range of zero to ISpot.SYSTEM_TICKER_TICKS_PER_MILLISECOND. The count resets to zero every millisecond

Specified by:
getSystemTicks in interface ISpot
Returns:
the tick count

getResourceRegistry

public IResourceRegistry getResourceRegistry()
Description copied from interface: ISpot
Get the singleton resource registry

Specified by:
getResourceRegistry in interface ISpot
Returns:
the resource registry

setInstance

public static void setInstance(ISpot theSpot)
FOR TEST PURPOSES ONLY


SunSPOT API V3.0


Copyright © 2006, 2007 Sun Microsystems, Inc. All Rights Reserved.