SunSPOT API V5.0


com.sun.spot.peripheral
Interface IAT91_PowerManager

All Superinterfaces:
IDriver

public interface IAT91_PowerManager
extends IDriver

Interface to the AT91 power manager for the Sun SPOT, allowing peripheral power consumption to be controlled by switching the peripheral clocks on or off.

Author:
Syntropy

Field Summary
static int[] PERIPHERAL_BUS_SPEEDS
          Speed of the peripheral bus in each of the shallow sleep modes.
static int SHALLOW_SLEEP_CLOCK_MODE_18_MHZ
          Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 18.432MHz/18.432MHz.
static int SHALLOW_SLEEP_CLOCK_MODE_45_MHZ
          Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 45MHz/45MHz.
static int SHALLOW_SLEEP_CLOCK_MODE_9_MHZ
          Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 9.216MHz/9.216MHz.
static int SHALLOW_SLEEP_CLOCK_MODE_NORMAL
          Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 180MHz/60MHz.
 
Method Summary
 void disablePeripheralClock(int mask)
          Disable the clocks for peripherals whose bits are set in the mask.
 void enablePeripheralClock(int mask)
          Enable the clocks for peripherals whose bits are set in the mask.
 int getEnabledPeripheralClocks()
          Return a mask containing a set bit for each peripheral whose clock is enabled.
 void setShallowSleepClockMode(int mode)
          Select the clock mode to use when shallow sleeping.
 void setUsartEnable(boolean enable)
          Enable or disable UART0 and USART1 support (initially it is enabled).
 void setUsbEnable(boolean enable)
          Enable or disable USB support (initially it is enabled).
 
Methods inherited from interface com.sun.spot.peripheral.IDriver
getDriverName, setUp, shutDown, tearDown
 

Field Detail

SHALLOW_SLEEP_CLOCK_MODE_NORMAL

static final int SHALLOW_SLEEP_CLOCK_MODE_NORMAL
Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 180MHz/60MHz. This is the default setting.

See Also:
Constant Field Values

SHALLOW_SLEEP_CLOCK_MODE_45_MHZ

static final int SHALLOW_SLEEP_CLOCK_MODE_45_MHZ
Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 45MHz/45MHz. NOTE: in this mode timer-counters active during shallow sleep that are connected to MCK will count at the slower speed during shallow sleep NOTE: USARTs will not function at the correct baud rate during shallow sleep with this mode selected

See Also:
Constant Field Values

SHALLOW_SLEEP_CLOCK_MODE_18_MHZ

static final int SHALLOW_SLEEP_CLOCK_MODE_18_MHZ
Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 18.432MHz/18.432MHz. NOTE: in this mode timer-counters active during shallow sleep that are connected to MCK will count at the slower speed during shallow sleep NOTE: USARTs will not function at the correct baud rate during shallow sleep with this mode selected

See Also:
Constant Field Values

SHALLOW_SLEEP_CLOCK_MODE_9_MHZ

static final int SHALLOW_SLEEP_CLOCK_MODE_9_MHZ
Mode to specify in setShallowSleepClockMode(int) to select PCK/MCK of 9.216MHz/9.216MHz. NOTE: in this mode timer-counters active during shallow sleep that are connected to MCK will count at the slower speed during shallow sleep NOTE: USARTs will not function at the correct baud rate during shallow sleep with this mode selected

See Also:
Constant Field Values

PERIPHERAL_BUS_SPEEDS

static final int[] PERIPHERAL_BUS_SPEEDS
Speed of the peripheral bus in each of the shallow sleep modes. For example PERIPHERAL_BUS_SPEEDS[SHALLOW_SLEEP_CLOCK_MODE_18_MHZ]

Method Detail

enablePeripheralClock

void enablePeripheralClock(int mask)
Enable the clocks for peripherals whose bits are set in the mask.

Parameters:
mask - containing one bit that is the peripheral clock to enable

disablePeripheralClock

void disablePeripheralClock(int mask)
Disable the clocks for peripherals whose bits are set in the mask.

Parameters:
mask - containing one bit that is the peripheral clock to disable

getEnabledPeripheralClocks

int getEnabledPeripheralClocks()
Return a mask containing a set bit for each peripheral whose clock is enabled.

Returns:
mask containing one set bit for each enabled peripheral clock

setUsbEnable

void setUsbEnable(boolean enable)
Enable or disable USB support (initially it is enabled). The only reason to disable this is to save power. Do not disable the USB support if the SPOT is connected to a USB host. If disabled, USART support will not be reenabled when the VM exits; it will be reenabled next time the SPOT is turned on.

Parameters:
enable - true if USB support is to be enabled, false otherwise

setUsartEnable

void setUsartEnable(boolean enable)
Enable or disable UART0 and USART1 support (initially it is enabled). The only reason to disable this is to save power. Do not disable the USB support if the SPOT is using a USART connection. If disabled, USART support will not be reenabled when the VM exits; it will be reenabled next time the SPOT is turned on.

Parameters:
enable - true if USART support is to be enabled, false otherwise

setShallowSleepClockMode

void setShallowSleepClockMode(int mode)
Select the clock mode to use when shallow sleeping. The default mode is selected each time the VM starts.

Parameters:
mode - a mode as specified in IAT91_PowerManager.

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.