00001 /*This file has been prepared for Doxygen automatic documentation generation.*/ 00015 00016 /* Copyright (c) 2007, Atmel Corporation All rights reserved. 00017 * 00018 * Redistribution and use in source and binary forms, with or without 00019 * modification, are permitted provided that the following conditions are met: 00020 * 00021 * 1. Redistributions of source code must retain the above copyright notice, 00022 * this list of conditions and the following disclaimer. 00023 * 00024 * 2. Redistributions in binary form must reproduce the above copyright notice, 00025 * this list of conditions and the following disclaimer in the documentation 00026 * and/or other materials provided with the distribution. 00027 * 00028 * 3. The name of ATMEL may not be used to endorse or promote products derived 00029 * from this software without specific prior written permission. 00030 * 00031 * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED 00032 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00033 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 00034 * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 00035 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00036 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00037 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00038 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00039 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 00040 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00041 */ 00042 00043 //_____ I N C L U D E S ____________________________________________________ 00044 00045 #include "config.h" 00046 #include "power_drv.h" 00047 00048 //_____ M A C R O S ________________________________________________________ 00049 00050 00051 //_____ D E C L A R A T I O N ______________________________________________ 00052 00061 void set_power_down_mode(void) 00062 { 00063 Setup_power_down_mode(); 00064 Sleep_instruction(); 00065 } 00066 00067 00068 00077 void set_idle_mode(void) 00078 { 00079 Setup_idle_mode(); 00080 Sleep_instruction(); 00081 } 00082 00091 void set_adc_noise_reduction_mode(void) 00092 { 00093 Setup_adc_noise_reduction_mode(); 00094 Sleep_instruction(); 00095 } 00096 00105 void set_power_save_mode(void) 00106 { 00107 Setup_power_save_mode(); 00108 Sleep_instruction(); 00109 } 00110 00119 void set_standby_mode(void) 00120 { 00121 Setup_standby_mode(); 00122 Sleep_instruction(); 00123 } 00124 00133 void set_ext_standby_mode(void) 00134 { 00135 Setup_ext_standby_mode(); 00136 Sleep_instruction(); 00137 } 00138 00139 00140 00141 00150 void Clock_switch_external(void) 00151 { 00152 Enable_external_clock(); 00153 while (!External_clock_ready()); 00154 Select_external_clock(); 00155 Disable_RC_clock(); 00156 } 00157 00158 00167 void Clock_switch_internal(void) 00168 { 00169 Enable_RC_clock(); 00170 while (!RC_clock_ready()); 00171 Select_RC_clock(); 00172 Disable_external_clock(); 00173 } 00174