Sun SPOT API
Green Release  


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
static int PERSISTENT_PROPERTIES_SECTOR_NUMBER
           
 
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
 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.
 byte getHardwareType()
          Get the hardware type code for this device, as defined in ConfigPage.
 I802_15_4_MAC getI802_15_4_MAC()
          Get access to the I802.15.4 radio MAC layer
 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
 IPBPMFactory getPBPMFactory()
          Get the factory for creating port-based protocol managers
 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.
 ILed getRedLed()
          Get access to the red LED on the Spot processor board.
 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.
 IUSBPowerDaemon getUsbPowerDaemon()
          Get the usb power daemon
 boolean isMasterIsolate()
           
 boolean isRunningOnHost()
           
static void main(String[] args)
          Main entry point.
 void refreshConfigPage()
          Force the Spot to re-read the configuration page, or at least invalidate any cached copy.
 void resetExternalBoardMap()
          Clear the cache of external board properties.
 void setPersistentProperty(String key, String value)
          Set a persistent property in the flash memory
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERSISTENT_PROPERTIES_SECTOR_NUMBER

public static final int PERSISTENT_PROPERTIES_SECTOR_NUMBER
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.

Returns:
the AT91_PowerManager

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_MAC

public I802_15_4_MAC getI802_15_4_MAC()
Description copied from interface: ISpot
Get access to the I802.15.4 radio MAC layer

Specified by:
getI802_15_4_MAC in interface ISpot
Returns:
the I802.15.4 MAC layer

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 byte getHardwareType()
Description copied from interface: ISpot
Get the hardware type code for this device, as defined in ConfigPage.

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

refreshConfigPage

public void refreshConfigPage()
Description copied from interface: ISpot
Force the Spot to re-read the configuration page, or at least invalidate any cached copy.

Specified by:
refreshConfigPage in interface ISpot

getExternalBoardMap

public Hashtable getExternalBoardMap()
Description copied from interface: ISpot
Get the map of external boards. Returns a Properties object for each board detected containing the properties read from the board's serial flash. For each board, also return as the key in the map the chip select pin used to select the board.

Specified by:
getExternalBoardMap in interface ISpot
Returns:
a Hashtable where the key is the SpiPcs used as the chip selects for the boards, and the value is board Properties

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

getPBPMFactory

public IPBPMFactory getPBPMFactory()
Description copied from interface: ISpot
Get the factory for creating port-based protocol managers

Specified by:
getPBPMFactory in interface ISpot
Returns:
the PBPM factory

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

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

Sun SPOT API
Green Release  


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