- Main Page
- Modules
- Data Structures
- Files
- Related Pages

- File List
- Globals

# power_drv.h

Go to the documentation of this file.

    00001
    00002
    00003
    00004
    00005
    00006
    00007
    00008
    00009
    00010
    00011
    00012
    00013
    00014
    00015
    00016
    00017
    00018 #ifndef _POWER_DRV_H_
    00019 #define _POWER_DRV_H_
    00020
    00024
    00025 //_____ M A C R O S ________________________________________________________
    00026
    00027 #define Setup_idle_mode()                       (SMCR=0,SMCR |= (1<<SE))
    00028 #define Setup_power_down_mode()                 (SMCR=0,SMCR |= (1<<SE)+(1<<SM1))
    00029 #define Setup_adc_noise_reduction_mode()        (SMCR=0,SMCR |= (1<<SE)+(1<<SM0))
    00030 #define Setup_power_save_mode()                 (SMCR=0,SMCR |= (1<<SE)+(1<<SM1)+(1<<SM0))
    00031 #define Setup_standby_mode()                    (SMCR=0,SMCR |= (1<<SE)+(1<<SM2)+(1<<SM1))
    00032 #define Setup_ext_standby_mode()                (SMCR=0,SMCR |= (1<<SE)+(1<<SM2)+(1<<SM1)+(1<<SM0))
    00033
    00043 #define Clear_prescaler()                       (CLKPR = (1<<CLKPCE),CLKPR = 0)
    00044
    00054 #define Set_prescaler(x)                        (CLKPR = (1<<CKLPCE),CLKPR = x)
    00055
    00056
    00057
    00058 #define Sleep_instruction()      {asm("SLEEP");}
    00059
    00060 //Backward compatibility
    00061 #define Set_power_down_mode()    set_power_down_mode()
    00062 #define Set_idle_mode()          set_idle_mode()
    00063
    00064 //_____ D E C L A R A T I O N ______________________________________________
    00065
    00066 void set_idle_mode(void);
    00067 void set_power_down_mode(void);
    00068 void set_adc_noise_reduction_mode(void);
    00069 void set_power_save_mode(void);
    00070 void set_standby_mode(void);
    00071 void set_ext_standby_mode(void);
    00072
    00081 #define Enter_idle_mode()                 (set_idle_mode())
    00082
    00091 #define Enter_power_down_mode()           (set_power_down_mode())
    00092
    00101 #define Enter_adc_noise_reduction_mode()  (set_adc_noise_reduction_mode())
    00102
    00111 #define Enter_power_save_mode()           (set_power_save_mode())
    00112
    00121 #define Enter_standby_mode()              (set_standby_mode())
    00122
    00131 #define Enter_ext_standby_mode()          (set_ext_standby_mode())
    00132
    00133
    00135
    00136 #endif  // _POWER_DRV_H_
    00137