DisablePower/developers

From Wiring

Jump to: navigation, search
This page is intended as a reference for core developers only, and the content is only changed after a consensus has been reached through discussion of any such changes. Please use the Discussion page to talk about any changes or issues you have with the current implementation.
enablePower()
Classification Power management utility functions
Suggested location WPower.h
C++ required No
Timing constraints None
Version introduced 1.0 (0100)
Framework dependencies None
Prototype(s)
static inline void disablePower(uint8_t P)
Required? Yes
Issues None


Contents

Description

The enablePower() and disablePower() methods enable and disable power to specific devices or sections of the Wiring hardware.

Black Box Input

The desired section of either POWER_ADC (analog input), POWER_SPI (SPI), POWER_WIRE (Wire), POWER_TIMER0 (Timer0, disbling this will stop all Wiring activity), POWER_TIMER1 (Timer1), POWER_TIMER2 (Timer2), POWER_TIMER3 (Timer3), POWER_TIMER4 (Timer 4), POWER_TIMER5 (Timer5), POWER_SERIAL0 (Serial), POWER_SERIAL1 (Serial1) or POWER_ALL (all the above) is provided.

Black Box Output

No output.

Overloading

None. Single signature only.

Notes

By default power is enabled in all sections on the Wiring board. Note that the Wiring functionality regarding a specific section will stop by disabling power. These methods are useful to do efficient power management in conditions where power is very limited or has to be very efficient. The methods are provided for advanced users who know exactly what they are doing. Sections / features are encapsulated by constants as follow: POWER_ADC (analog input), POWER_SPI (SPI), POWER_WIRE (Wire), POWER_TIMER0 (Timer0, disbling this will stop all Wiring activity), POWER_TIMER1 (Timer1), POWER_TIMER2 (Timer2), POWER_TIMER3 (Timer3), POWER_TIMER4 (Timer 4), POWER_TIMER5 (Timer5), POWER_SERIAL0 (Serial), POWER_SERIAL1 (Serial1) and POWER_ALL (all the above). The power management functions provide a method to stop the clock to individual peripherals to reduce power consumption. Note: calling enablePower() or disablePower() commands might have no effect on some microcontroller (atmega128 for example).

Proposed Changes

Personal tools