SunSPOT host 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(); This is the host-side implementation. Operations that manipulate SPOT-specific hardware are not supported on the host and will throw a SpotFatalException. For more details on specific operations, see ISpot.


Field Summary
static String SPOT_BASESTATION_MANAGER
           
static String SPOT_BASESTATION_SHARING
           
 
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()
          Get the singleton AT91 chip power manager
 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()
           
 IProprietaryRadio getIProprietaryRadio()
          Get access to the radio via its proprietary (non-I802.15.4) interface.
 ILTC3455 getLTC3455()
          power control chip driver
 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()
           
 void resetExternalBoardMap()
          Clear the cache of external board properties.
 void setExternalBoardProperties(PeripheralChipSelect cs_pin, Properties p)
           
 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 setRadioPolicyManager(IRadioPolicyManager radioPolicyManager)
          For testing only
 void storeProperties(Properties props)
          Replace the persistent properties held in the flash memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SPOT_BASESTATION_MANAGER

public static final String SPOT_BASESTATION_MANAGER
See Also:
Constant Field Values

SPOT_BASESTATION_SHARING

public static final String SPOT_BASESTATION_SHARING
See Also:
Constant Field Values
Method Detail

getInstance

public static ISpot getInstance()

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

getResourceRegistry

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

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

setRadioPolicyManager

public void setRadioPolicyManager(IRadioPolicyManager radioPolicyManager)
For testing only


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

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

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

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

getSpotPins

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

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

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

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

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_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

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

getSecuredSiliconArea

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

Specified by:
getSecuredSiliconArea in interface ISpot
Returns:
the SecuredSiliconArea

getAT91_TC

public IAT91_TC getAT91_TC(int index)
Description copied from interface: ISpot
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

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

setExternalBoardProperties

public void setExternalBoardProperties(PeripheralChipSelect cs_pin,
                                       Properties p)

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

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

getLTC3455

public ILTC3455 getLTC3455()
Description copied from interface: ISpot
power control chip driver

Specified by:
getLTC3455 in interface ISpot
Returns:
the power control chip driver

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

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

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

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

isRunningOnHost

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

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

getOTACommandServer

public OTACommandServer getOTACommandServer()
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

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

getAT91_PowerManager

public IAT91_PowerManager getAT91_PowerManager()
Description copied from interface: ISpot
Get the singleton AT91 chip power manager

Specified by:
getAT91_PowerManager in interface ISpot
Returns:
the AT91 power 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

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

SunSPOT host API V3.0


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